Showing posts with label Educational Technology. Show all posts
Showing posts with label Educational Technology. Show all posts

Wednesday, 13 January 2016

GPIO Zero - making coding less language intensive.




In a previous post Getting Physical with Python I wrote about the difficulty some of the younger children in my computing group had with the volume of typing required to get started with physical computing. They did not struggle with understanding but it took too much time and help to enter the volume of text required. This took away some of the excitement and slowed things down.

At the time I thought to speed this up it would be good to write a python library to reduce the amount of text needed to get things to happen. Unfortunately I had lots of other things to do and this never went anywhere. However someone else also thought it would be good to make it easy to get started with physical computing and was able to do something about it.

That person was Ben Nuttall of the Raspberry Pi Foundation. Along with Martin O'Hanlon and Dave Jones he has created GPIO Zero. You can read his account of how it happened on his blog.

This python library can be used to very simply control components using the GPIO pins. The initial function set is based around the popular CamJam EduKits  (Kit 1- Starter, Kit 2 - Sensors) and makes a great starting point for physical computing using python.

A simple light and button combination can be controlled with the below example:

from gpiozero import LED, Button led = LED(15) button = Button(14) button.when_pressed = led.on button.when_released = led.off

instead of something like this:

import os 
import time  
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM) 
GPIO.setwarnings(False) 


GPIO.setup(14, GPIO.IN)
GPIO.setup(15, GPIO.OUT) 

while True: 
        if GPIO.input(14) == False: 
              GPIO.output(15, HIGH)   
        else: 
               GPIO.output(15, LOW)  

 time.sleep(0.5) 

The reduction in volume of code and setup required is brilliant. GPIO Zero is an amazing tool for education. This is especially true where the volume of text entry is a barrier (either with younger or SEN children).

The tool allows the focus to be on the programming concepts and not on the entry of text. When i worked with my HomeEd computing group there was a difficulty fro a number of the students (aged between 5 and 15) in using the GPIO library as there was a lot of code to enter. They were generally happy with what they were trying to achieve but found that it took a long time to enter the lines of code required just to light up the LEDs.

This meant that in the one hour session that is what we achieved, lighting up the LEDs. Whilst this was a success and the children were happy with getting there it would have been much better to spend more of the time in the session exploring what could be done rather than entering lots of text.

GPIO Zero takes away some of the burden allowing children to focus on what they are trying to achieve rather than on copying out lots of lines of code (especially the set up parts that are conceptually more difficult to grasp and result in questions about what is BCM etc).

I have found that where I have used this it has meant I can more on more quickly and cover more of the computational thinking ideas where previously there would have been more time waiting for the students to catch up with the typing required. It also works well to satiate the desire for instant gratification that appears to be fairly common among my pupils. They only have to spend a short time entering code before they can see a result.

It is also much easier in a classroom to debug the code they have written if there are errors. The reduced volume of code makes for less searching to find the capitol that should't be there. This make students more able to do it themselves or makes it quicker for me when they can't see what is wrong. The reduction in time taken here give me the opportunity to get to more pupils and help them to progress.



I have also used this at home with my son (8) whilst he has been creating a robot using the CamJam EduKit 3 - Robots. This was really powerful because it allowed him to achieve results in short pockets of time before he lost focus and wanted to move on. He used the provided worksheets to set up the robot and connect the components and I translated the code parts into GPIO Zero for him to get the robot working.

So in summary the feedback is - Thanks Ben this is an awesome tool to help me teach computing.

If you are interested in using GPIO Zero there is a great getting started guide on the Raspberry Pi website in the resources 'Learn' Section.

More information can be found on pythonhosted.org or on GitHub. There is also a Google Doc with information and a place to add comments / requests.

Wednesday, 21 January 2015

Low cost Raspberry Pi Visualiser

The kit I revived from takeing part in the Element 14 Raspberry Pi Educators Roadtest gave me another project idea.

After delivering CPD at Sheffield Hallam University i was very envious of their AV set up with a visulaiser and PC and RPi all connected to the screen. I can't make all this happen but with the RPi and camera I can make my own.

For work with the Raspberry Pi the box was even the right size to make a stand so i added a lighting solution (cheap torch from the garage and/or a clip on e reader light. Now for under £40 I had a visulaiser set up that i could use in the classroom.


A quick mock up above shows the basic idea but I'll post the full details here once it has been completed along with the python code to control the camera.

Wednesday, 19 November 2014

Raspberry Pi CPD in Sheffield


Part of the idea of Picademy was that delegates would go out and spread the word. So as part of my effort I spent this evening delivering Raspberry Pi CPD to the Sheffield CAS hub at Sheffield Hallam University.

The session was mainly made up of Computing ITT students from Sheffield Hallam University so it was really interesting to see a different approach to new information (from my secondary pupils). Most of the delegates had little or no exposure but there were two who had used the Pi for their own projects (a security camera and a remote media center).

After a quick introduction to the Pi we spent time describing how the Pi could be set up in classrooms and introduced the Raspberry Pi foundation's resources. Preparing for this event gave me the chance to look again at what is provided and the resources there really do give all the information that you need to get started using the Raspberry Pi and moving on to using it productively in the classroom.

After the set up and a brief summary of some of activities available for using the Pi in the classroom I spent some time focusing on some of my favorite schemes. as a parent of a 7 year old I can't avoid minecraft at home and have found that it is equally as engaging for secondary pupils. I shared some of Craig Richardson's resources from his blog on Minecraft Pi - Arghbox. the delegates were also given a chance to try out some of the scripts on the Pi's they had set up. This may have been a mistake with some of the more game obsessed ITT students (mainly male). This was hastily used to point out the importance of choosing classes and classroom management strategy carefully when using a game students are already familiar with.

We then looked at some of the other ideas I have used in the classroom. The use of Sonic Pi (paticularly as an application that appears to appeal more equally to both genders) to engage students creativity and teach programming in a fun way. We also looked at the possibilities using the GPIO pins for physical computing. I am very interested in 'Personally Meaningful Projects' as a key motivator for students to get involved in programming and the GPIO pins provide this possibility. I shared some example of projects my students and students from further afield have created using the Pi. We also discussed the support available from the community.

The great thing about the ITT students is that once they had a spark of an idea they appeared very enthusiastic to take this on and try using this in their teaching practices. Several were keen to borrow the university Raspberry Pi set and some were talking about purchasing their own and projects they could work on. Hopefully this talk will be converted to action and there will be a few more computing teachers in Sheffield schools enthused about the benefits of using Raspberry Pi in the classroom. If nothing else I did a little Picademy product placement and did my best (if not quite 'The Apprentice' level) pitch for the resources available on the Raspberry Pi site. I left the event feeling buzzy and motivated to do it again so it can't be all bad.

The Prezi I used to as a place holder for the introductory videos and some links for the resources we discussed is here.



As a side / end note this was a chance to play with some presentation tech I can only dream of in my classroom. I had a Pi on one button, the Prezi on another and a visualiser showing the actual Pi on a third. This was the first time I had used the set up at the university and I was very pleased with the possibilities. At the press of a swanky touch screen I could switch between the projected picture of my hands doing magic with the Pi and the actual out put of the Pi, then switch to the diagram on the Prezi showing the possible connections. This made the screen work hard for me and really helped to show what was going on. The only downside was managing multiple mice and a second keyboard a few paces away (due to the university padlocked setup) and talking at the same time. I don't imagine I will be getting this sort of system in my classroom anytime soon but it was good to try it out for an evening.

Thursday, 20 February 2014

Raspberry Why?

(1)
 
I have heard lots anecdotally about the use of Raspberry Pi in schools and there has been some talk about them “gathering dust in school cupboards”(2). and questioning along the lines of “Do UK schools really need the Raspberry Pi?”(3)In my own experience I have seen schools use them to “do programming” where they could be best to use the suite of 30 PCs they already have.
 
This forced use of technology for the sake of it is neither what the Raspberry Pi was intended for or based on good pedagogy. Eben Upton stated that the idea of starting the Raspberry Pi project was to get more children programming, but this is not how it will happen.
 
His vision was a playground for the children to experiment and even likens the Pi to a child's bike (compared to the family car that is the PC) the Pi is “owned by the child” and “if they break it it's not a disaster, they can walk”.(4) This ownership and experimentation is not the case in a classroom of Pis attached to PCs used to do “some programming”. All this is doing is making it take a little longer to get to the programming bit that they could do more quickly and easily by using the PC they are attached to.
 
This forced usage comes from a well meaning desire to give pupils some exposure to a device that has become a must have in computing education. It is a very admirable thing to be able to expose the young people in our care to a range of different devices, but we should understand fully what we are trying to do with them before running out and buying a class set.
 
This approach seems very common in education and it it is what has led me to create this blog. We see new technology and then try and find a use for it in the classroom. Some of these technologies would be much better not used at all when they are implemented in this way (how many interactive whiteboards in secondary schools are actually used interactively?).
 
For the Raspberry Pi, a device that was designed to engage and interest students in computing is in danger of becoming a tool to do the opposite.(5) Without using these devices to fulfil their potential we are doing our pupils (and the devices) a disservice. we have been presented with an amazing tool and we are wasting it because of a lack of imagination or lack of flexibility in the way we manage the learning process.
 
We should be using these Pi to enable experimentation and self led learning. It should be a tool that allows the students to answer for themselves the “what happens if I...” questions we get asked about computers all of the time. It gives us a platform where students can try things out. They can break things and no one is going to come shouting.
“If Something goes wrong it’s no big deal - you just swap out a new SD card, and your Raspberry Pi is factory-new again” (6)
 
Where the Pi will add most value is where students are able to set the agenda and pursue projects that interest them. A great example of this is Amy Mather(7) who got interested in the Pi and programming after attending events outside of school. She became interested in Conway's Game of Life and programmed a version on her Pi. She went through several versions and eventually added on an external LED display. If we can create an environment in our classrooms that will encourage this kind of exploration then we will be doing things right.
 
The Pi was not designed as a tool to sit in rows in a classroom with. but that doesn't mean we can’t use it effectively in a school. We just need to change our approach. I also recognise that we cannot completely change the paradigm within which we operate.
 
To move to a more productive usage of these devices we need to find ways to help teachers bridge the gap. There are several schemes that aim to do this. One successful scheme is Sonic Pi developed by Dr Sam Aaron. Sonic Pi is an open source programming environment designed to explore and teach programming concepts through the process of creating new sounds.(8) The software comes with a scheme of work that was jointly developed with Carrie Anne Philbin (Teacher, Author (9) and founder of Geek Gurl Diaries) . The Scheme of work is designed around the new Computing PoS and teaches programming concepts in an interesting and engaging way. As an introduction to the Pi it gives students a good grounding on some key programming concepts.
 
If we can take this sort of scheme as a start point then find ways to allow students to experiment with less directed projects then I think we are getting closer to utilising this tool to it’s potential. Where people have allowed this experimentation in schools (mostly as extra curricular activity) there have been some amazing projects. Students have created robots, wearable devices and even sent their creations into space (well nearly).(10)
 
(11)

For me the ultimate utilisation of the PI would be some form of introduction and then cross curricular projects where students can be creative and make things for themselves. It would be even better if students had ownership of the devices and products. We should aim to create a space where students contribute ideas and expertise to their peers, where we could guide and direct rather than dictate we will be able to help to foster pupils natural enthusiasm. We should aim to create mini Raspberry Jams in our classrooms.(12)
 
This approach also meet the demands of the National curriculum, the Computing PoS explicitly mentions undertaking creative projects using a range of devices.(13)
 
As we are limited in our time and resources we need to think about what we can do to make the devices more classroom friendly. There are lots of products available aimed to help us to do this. Teachers worried about the robustness of the devices can find a myriad of cases designed for the Pi. My particular favourite is the Pimoroni Pibow it’s robust construction is ideal for school use. It even comes in a range of colours from Rainbow to Ninja. I especially like the fact that it does not hide the Pi away inside an opaque box.
 
Where we are limited by time we need to look at premade kits to add on to the PI to allow the physical computing elements to be created quickly Products such as Buzz box are the start of these but there is still work to be done. The system allows consists of modules that can be linked together to create a diverse range of products.(14) This modular approach means that devices ranging from a simple calculator to a Robot of physiological monitoring device can be built. These ready made plug and play additions can reduce the time it takes to put together a working prototype, allowing pupils interest to be maintained in the early stages of a project where failure or limited activities can be demotivating.(15)

We don't need to rely on commercial suppliers we can add some structure to give students a little direction. Provide our own kit of parts that they can experiment with until they are ready to fully strike out on their own. We can also look to our colleagues in technology to see how they approach creative "maker" style projects, they have been doing this for years. We should look at what they do best and steal it for use in our classrooms. Even better if we can work with them to collaborate on work building student led projects.
 
Educational suppliers are beginning to catch on to this approach and when visiting the BETT show I found a supplier already offering Raspberry Pi Project kits for use in the classroom. The kits range from breadboards and components to kits with units of work. As more teachers take this approach the range of equipment available to support us will also increase making it an easier path to follow.
 
I think the Raspberry Pi is an awesome piece of hardware. It is already really great used in the hobbyist context where personal interests are pursued. I think it will also be great in the classroom one we get over the “wonder device”  stage where every school has got to have them without a lot of thought on why. We should be looking to see what new technologies can offer educationally rather than looking for places to shoehorn them into lessons just for the sake of it.





 







References:

(2) Shona Ghosh. "Raspberry Pi "gathering dust" in schools | Education | News | PC Pro." 2014. 15 Jan. 2014          <http://www.pcpro.co.uk/news/education/386302/raspberry-pi-gathering-dust-in-schools>

(3) "Bash Street bytes: Do UK schools really need the Raspberry Pi ..." 2012. 15 Jan. 2014                                    <http://www.theregister.co.uk/2012/11/27/feature_raspberry_pi_in_schools/>

(4) "Bash Street bytes: Do UK schools really need the Raspberry Pi ..." 2012. 15 Jan. 2014                                    <http://www.theregister.co.uk/2012/11/27/feature_raspberry_pi_in_schools/>

(5) "About us | Raspberry Pi." 2012. 15 Jan. 2014 <http://www.raspberrypi.org/about>

(6) Upton, Eben, and Gareth Halfacree. Meet the Raspberry Pi. Wiley. com, 2012.

(7) "Raspberry Jamboree 2013: Amy Mather - Conway's ... - YouTube." 2013. 15 Jan. 2014                                      <http://www.youtube.com/watch?v=a35XINnYFtA>

(8) "Sonic Pi." 2013. 15 Jan. 2014 <http://www.cl.cam.ac.uk/projects/raspberrypi/sonicpi/>

(9) "Adventures in Raspberry Pi: Amazon.co.uk: Carrie Anne Philbin ..." 2013. 18 Jan. 2014                                    <http://www.amazon.co.uk/Adventures-Raspberry-Carrie-Anne-Philbin/dp/1118751256>

(10) "High Altitude Ballooning, sixth-form style | Raspberry Pi." 2013. 16 Jan. 2014                                                    <http://www.raspberrypi.org/archives/4390>


(12) "#RaspberryJam | the global community of events for enthusiasts of ..." 2012. 16 Jan. 2014                                  <http://raspberryjam.org.uk/>

(13) "National curriculum in England: computing programmes of ... - Gov.UK." 2013. 16 Jan. 2014                              <https://www.gov.uk/government/publications/national-curriculum-in-england-computing-programmes-of-study/national-curriculum-in-england-computing-programmes-of-study>

(14) Callaghana, Vic et al. "Putting the Buzz Back into Computer Science Education." Workshop Proceedings of the 9th International Conference on Intelligent Environments 26 Jul. 2013: 454.

(15) Callaghan, Victor. "Buzz-Boarding; practical support for teaching computing based on the internet-of-things." The Higher Education Academy-STEM (2012).

(16) "Raspberry Jamboree 2013 Panel Discussion ... - YouTube." 2013. 15 Jan. 2014 <http://www.youtube.com/watch?v=1cqc0XdYezM>
(6)