Showing posts with label Raspberry Pi. Show all posts
Showing posts with label Raspberry Pi. Show all posts

Thursday, 19 May 2016

Hack the Teacher - A lesson in physical computing using a Raspberry Pi Zero Christmas Jumper

Just before Christmas I had some fun with a Christmas Jumper and Physical computing based around the (then) new Raspberry Pi Zero. Here is the rather belated write up of the lesson.



I was not quick enough to get hold of a Magpi issue 40 when they were first in the shops so I subscribed and waited for it to be delivered to my door. Initially I didn't really know why I wanted the attached free Raspberry pi Zero, I just knew I wanted one.

The Jumper


However when it arrived inspiration arrived with it and I decided I needed to make a Christmas jumper and that it would be a really good tool to get some of my students interested in programming. I came up with a simple plan of a Christmas tree with some lights and set about creating the base for the project.

This was all going well apart from two factors; I now only had a weekend to complete the project to be able to use the jumper in lessons (before the end of term), and my inability to sew.

Not one to be daunted I found some felt and cut out the basic shapes then had a crash course from my wife on how to attache them using needle and thread. So I eventually (after a late night sewing) managed to attache the tree using a simple running stitch in the centre of the tree and then added blanket stitch around the edge to secure it in place (and add decoration). From a distance the effect was relatively respectable. (if you look closely you can see that the quality of my blanket stitch improves as it goes around)

The second evening I spent setting up the electronics. I played with a couple of different configurations but in the end decided on individually programmable LEDs. Each LED is connected to a separate pin on the Pi Zero and to Ground. This left maximum flexibility in what could be done with the lights.


I had initially thought about hiding all the connections inside the jumper but as I was putting it all together I quite liked the idea of it all being visible. To this end all of the wiring was attached to the front of the jumper and the Pi Zero itself was sewn onto the jumper. I also used a portable USB power supply to allow me to walk around without being tethered to a plug socket.





After getting it all wired up I connected the PiZero up to a monitor and set about creating a test program that would show the lights on the tree working. It could also be used as a starting point for the students to modify the existing code to create their own sequences. To make it a little easier I set up a few functions that set groups of light as on or off and the made a short sequence using the functions. I set this up to start on boot so I could just connect the power and the light sequence would start.





The video shows one of the LEDs had failed but this proved to be a loose wire that was hastily soldered up and everything was up and running.

The Lesson

The idea for a lesson using the jumper was inspired by last years code.org hour of code which had students programming a sequence of lights for Christmas trees outside the Whitehouse.

The plan was to explain how the GPIO library is used to turn the lights on and off and then let the students view the code for the existing sequence before coming up with their own code to control the jumpers LEDs.

Preparation

To allow students access to the PiZero I needed to connect it up to the school network. The plan was to do this over wireless with a USB wireless network adapter. (in reality I had problems getting onto the school WiFi network so I took off the jumper and used a wired adapter instead) The students could then login to the PiZero using SSH and use nano to create their programs.

The students downloaded putty to their workstations in order to do this.

Introduction
Demonstration of the jumper working

Explanation of GPIO Library commands to control the LEDs (including the functions I created earlier)

Main Activity
Students to design an algorithm for the light sequence

Students to use python and the GPIO library to program the sequence - this was done by logging in over SSH using putty and copying the basic file (including the functions and GPIO setup) giving it their own name.

Students test the code on the jumper - this required a bit of co-ordination to ensure we only ran one script at a time.

Extension
Able students create their own functions that they can reuse in their sequence.


Plenary
Demonstration of some of the best (aesthetically) sequences

Discussion about code efficiency and creation of functions to avoid duplication of code


Review

The lesson went well with a good deal of enthusiasm generated by the idea of 'hacking the teacher' the students were initially very overly excited by downloading putty and being able to log in remotely to the Raspberry Pi on my jumper.

The students were fairly quick to be able to get a short piece of code working (mostly just a single flashing LED) and then move on to experimenting with using the functions I had built.

At this stage there was a good deal of discussion about what they could do that would be amusing (fortunately I had thought of this at the design stage and I think I managed to avoid any embarrassing light combinations of a phallic nature, or at least they didn't find any during the lesson). Once they had discovered they could not create anything rude they settled for pretty and started to compete on who could create the best sequence.

There was lots of experimentation of how fast they could get lights to flash or change and with what sort of changes looked good. Some of this was a little held up by the fact that there was only one jumper so students occasionally had to wait for someone else to test their code before they could run theirs. It might have been good to have some breadboard prototypes for testing to reduce some of the waiting but i feel that that may have spoiled the interest provided by making the code run on my jumper. This would have been even better if we could have got on over wireless and I could have been walking around the room whilst they were testing their code on me but this was a small niggle.

Overall the lesson was a great success with students engaged in creating code and experimenting to see what they could do as they learnt more about how the Library worked. There were some great creative responses and some good use of functions with parameters for time that could be reused at different points in the code.

If i did this again with another class I would probably use the GPIO Zero library to reduce the code required to get things working but with students staring by using my example code they had a reasonable start anyway.


The rest of the day as I walked around school I did spend alot of time assuring students (and some staff) that "No it's not a bomb" (it was just after Ahmed's clock incident) and "No I won't catch fire". However I did get several question about how it was made and could they make one too, so hopefully some more students aware of the possibilities of computing.

Wednesday, 3 February 2016

BETT 2016 - Raspberry Pi physical computing workshop

Last year I was intending to run a workshop for Raspberry Pi at BETT but was recovering from an appendectomy instead. This year tempting fate I volunteered again and fortunately avoided any surgery in the run up to the show.

I had been working with ,my son Toby who had created his own robot using the CamJam EduKit 3 and I had used GPIO Zero to help to reduce the level of typing required to get his creation working. As I intended to talk about Physical computing Toby came along too with his robot. to show what could be done with a few simple lines of code.



He was very pleased to be able to show off his creation and say a little about how he had made it. he was also very excited to have his own badge with his newly created job title.





We then got hands on and had the attendees making their own simple circuits and writing the code to make things happen in the real world. Having some hands on time was a really powerful tool to demonstrate how quickly results could be seen using simple components and GPIO Zero. I did promise at the show that I would add the presentation here with the information links so here it is on Prezi - Lets get physical -  an introduction to Physical computing with GPIO Zero.


The show was challenging environment to deliver training in with all of the competing noise and activities occurring around the stand. It was an interesting cross between market trader and teacher. Attracting people into the stand and then guiding them through creating a circuit and controlling it with code It was also a challenge with people arriving to the stand (attracted by what was happening) part way through the session and wanting to join in.

The sessions both ran slightly different to the plan (and  to each other) but I think we were able share the power of being able to make things happen in the physical world.  I think especially with the late arrivals it was a great demonstration of how results can be achieved really quickly using GPIO Zero due to the less onerous volume of code required.

If i was going to do this again i would probably take some pre-prepared  kits with the components for the circuits or even use a HAT to simplify the process. I would also think about printing some copies of the code / circuit diagrams to make it easier to manage with late arrivals and swapping the screen around from basic to advanced tasks. Having both on a laminated card (or just a bit of paper would do) would have made it easier for those who arrived late to have a play with the basic example without me having to switch the screen back and forward.

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, 29 April 2015

Sci Fi Your Pi a design Challenge from Element14

After my success in the Raspberry Pi Educators Roadtest winning the prize for the UK (an Up mini 3D printer) I thought I would put in a proposal for their latest design challenge.

The title of the design challenge is "Sci Fi Your Pi" and centres around the idea of creating objects from or inspired by Science Fiction. This video explains what it is all about

I struggled initially to think of anything interesting being stuck on the suggestions made in the introduction to the challenge. However it was my search for difference that gave me the idea of looking at creating a Steampunk inspired device.

The kit for the challenge comes with a GPS model so this along with the strong adventurer spirit in Steampunk fiction I ended up with the idea of a Navigation device.

My idea has been selected from a large number of applicants among a very interesting group of projects. So far I have outlined my initial inspiration and described what I am hoping to produce for the challenge.  I have received the kit and I am putting together a plan of how I am going to make it work.



For anyone not familiar with Steampunk this video gives a fairly good introduction through a number of film clips. 



The spirit of adventure and exploration (as exemplified by the work of HG Wells and Joules Verne) felt like a great basis for a project where I will be trying new things and creating something a bit different to some of my other projects.

You can follow my progress on the Element 14 community with the tag steampunk_navigation. 

Friday, 17 April 2015

The Sound of Music - Sonic Pi with The Home Ed Computing Group

With the last session I had discovered the difficulty of the volume of text required when using python and the CamJam Edukits for some of the younger children. I have been working on a python library to help with this but this week i decided to use a different tool to look at coding concepts.

Sonic Pi is a great tool because it allows you to teach coding and make music at the same time. It was also a good way of being able to progress in complexity with computing concepts (introducing iteration) but keeping the level of text entry required to a minimum.

Sonic Pi is freely available software as part of the standard Raspian build and is also available for other platforms (more information here on the Sonic Pi Website)

The simple nature of the commands required for the children to be able to make music means it is a really good tool for younger (or children less able to read / type).

Some of the barriers I had found in the Python session had been easily overcome by the simple nature of the commands. I think would have struggled with getting some of the children to start looping blocks of code in Python yet they were all happily making repeating tunes with Sonic Pi. I really wanted to avoid simplifying things too much and this has provided a great bridge between the simple block programming that some of the children have done before and text based languages.

Sonic Pi itself is based on Ruby so it teaching a specific code structure and language that will continue to be useful. O so it is simplified in that the tasks it is performing are much more complex than the Play and sleep combinations, but it is a really engaging and relevant way to work with code.

I have written lots before about Sonic Pi so i will try and avoid this becoming the Sonic Pi fan page. However in reducing the volume of typing required I have found another way in which Sonic Pi makes coding accessible to a wider audience.

The group seemed to really enjoy this session and it was one of the most requested areas to do more with.

I am starting to look to move away from just leading the sessions and i already have several children with ideas for their own projects. This is an idea I am really keen to explore as i feel the best way to learn about computing is by finding challenges and solving them using computing. If children can find something that interests them they are much more motivated to explore than if they are being directed by someone else.

Saturday, 28 March 2015

Getting Physical with Python

This session with my HomeEd group I introduced some physical computing using the CamJam Edu kit .

Last time I blogged about the challenge of teaching a group with my own children (who are not used to a classroom environment). This week I had the additional challenge of my normal child swap falling through so I ended up with 3 of my own children to contend with.

With this in mind my plan was for more independent work with some supporting materials to make it easier for the children to work without my direction all of the time.

I also planned to manage the situation by placing my offspring carefully either side of me in the room so I could switch between the instruction and paying them attention. This worked much better for me to be able to manage the session. Although at one stage it did mean carrying 2 of my children whilst trying to explain things on the board (using my daughter to point out the relevant bits whilst I talked).

I had decided that I did not want to over simplify things for the children by using scratch. We had also been mainly working at the command line so it made sense to progress with this and use nano to create python files to control the components. This also followed the CamJam worksheets so I could use those to provide additional guidance so the children could refer back to the instructions.

As the group is very mixed (5-15) there was a range of experience in the group but most had not used electrical components in a breadboard before. After a quick introduction they were all setting up the simple LED and resistor circuits.

Most of the group managed to get as far as getting the lights lit but it did take some time to get there. The real limiting factor I found with using python with the younger children was the speed they were able to type the code was very slow compared to the older students (as they are still working on their reading skills this is actually quite a hard task).

There was no apparent problem understanding the concepts and adding text to control things, but the amount of text that needed reading and adding to the code was a problem. To make it easier for these younger students (and any students who find reading / typing difficult) it would be useful to reduce the volume of typing that is required to produce a result.

That said nearly all of the children had at least lit the LEDs by the end of the session even if this had involved a bit of help with typing from the adults in the room.








Wednesday, 25 March 2015

Sheffield Raspberry Jam hosted by BCS South Yorkshire Branch



Last year the BCS South Yorkshire Branch decided it would be good to host some more interactive events. We normally host speakers and have a very similar audience for our talks. The idea was to bring some more people to the BCS and do something a bit different.

There had not been a Raspberry Jam in Sheffield for sometime and this looked like a good way to engage with a different community of computing enthusiasts. We set the event up for our march event which would also fall in science week.

A call out on twitter and contacting some of our contacts in the Raspberry Pi community gathered a few projects together to get things rolling. The crowd favorite was the Scalectrix set up that could be controlled by an attached variable resistor, code on the Raspberry Pi, or over the internet.

Paul from Pimoroni also came along to show of some of their products and talk about what can be done with hardware projects.

The event drew in a fair number of new faces and there was a great deal of questions for the showcase projects and this led to discussions and questions between the attendees about what they had seen and about interesting ways to use the Raspberry Pi and to teach people about computing.

There is also a renewed enthusiasm for Raspberry Jam in Sheffield and there is now a team keen to run regular events (the next is on the 28th of march at the access space and can be booked here) the twitter account is back up and running @PiJamSheffield  where you can find information about future events.

You can find out more about future BCS events in South Yorkshire on the Branch Website.


Raspberry PI Set up and Hello World

Having introduced the basics of computing this week the plan was to get the children setting up the Raspberry Pi and starting to program.

There was a little setup confusion with the venue meaning that there was a delay getting everything out and a much less ordered start to the session as kit was quickly located and brought out to us. We also discovered that the table arrangement we were using did not allow for enough power outlets to be available. A swift rearrangement of table and we had everyone near enough to a plug or extension to get running.

This was a completely new experience for me as I am used to arriving in my classroom that has all of the kit stuck on tables ready for me when I arrive and just moving cables around between the desktop and the Raspberry Pi. With the help of Jeremy (one of the other parents with an IT background) and Hamish from the University of Sheffield (who had come to see the Pi Bank kits in action) the children were all eventually up and running.

After the kit arrived we had to tackle the normal issue of setup with failed memory cards and trying to sort out which display option would work best. This was where the Pi Bank kits really helped. The range of connection options included meant that even with a collection of different monitors of differing ages we were able to get all the children connected and logging in.

It was at some point during the effort to help all of the children that I was shown the possible horror of teaching my own children. As a Home Educator I spend a large amount of time teaching my own children but not normally in a large room with other children to share the attention.

I think the sharing of my attention is something that will remain a challenge for my children to get used to and for me to work around, I need to find a way to channel my children's natural desire for my attention in a way that does not affect the groups progress.

Despite these distractions and the issues with the equipment we did manage to get everyone logged in to the Raspberry Pi. In fact we managed to move on and get the children started with looking at the file system and starting to create basic programs. The children used `ls` to look at the files and folders then `mkdir` to make their own folders. We then had a go at the traditional "Hello World" program in python using nano. Some even managed get the program prompting for user input.

Overall we managed to achieve the objectives even if it was not as calm and organised as I would have liked. However comparing this with the setup lessons I have taught in school is a favorable comparison,  We normally teach this in Y8 (12/13 year olds) and I find that normally I can expect to only get the class as far as making their own folders then needing to pack up the kit. This is with all the extra parts all setup on desks. With our mixed ability and age group we have been able to progress to making a simple program. With some tweaks to the organisation and a reduction in distractions i am expecting the group to progress fairly quickly.

To this end I have changed the setup plan for next week and the tables should be arranged near to the power outlet and the venue have promised to have the monitors, keyboards and mice setup and waiting for us. This should allow us to get started more quickly and move on to the physical computing experiments I have planned. I have also purchased and burned a fresh set of SD cards that I will be assigning to the children to use and save their work on each week.

Tuesday, 10 March 2015

Agobo The Hackable Raspberry Pi Robot - now with emotions





My wife gave me a 4Tronix AgoBo robot kit for Christmas (at my request). I built it a few weeks ago but didn't really have time to do anything with it.

The AgoBo is a Raspberry Pi A+ based robot kit. I also ordered the Plus plate that adds a Neopixel and lots of prototyping space on a board that mounts above the RPi. The kit is a really good affordable robot kit that can be customised very easily, especially with the PlusPlate. It is this customisation that really attracted me to the AgoBo in the first place.

When the robot arrived I thought that the Ultrasonic sensor looked like a pair of eyes but AgoBo was lacking a mouth. On another evening I was rooting through a box of electronic bits I bought for RPi projects and found an 8x8  LED matrix. 


I had seen plenty of robot that used these as eyes and thought that this could work. However with the robot being so small the matrix was far too large. I had another dig in the box and found a more suitably sized replacement.


The 5011AS display fitted just below the ultra sonic sensor with the pins above and below the main board. Aligned horizontally the segments could be used to make a smile or sad face by lighting the correct segments.

This idea was put on the back burner for a couple of weeks whilst normal life got in the way. and I kept thinking about how to mount the module effectively under the board. When I was able to experiment with the robot again (finally loaded the example software and tried out the supplied python scripts) I couldn't resist having a try with the mouth idea.

I haven't found time to solder the header on to the plus plate yet and wanted to get the mouth working so I grabbed a breadboard and some cables to try it out before I sorted it all out properly.



I had a ten cable female to female ribbon so I divided that into two (5 cables in each) to connect the ten pins of the display. With the ends of the cable connected there was very little room between the pins but with a little blue tack the display mounted nicely with two pins each side below the board and three above. To keep things tidy I separated the first part of the cable for a short length and then wrapped the cable up over RPi and under the PlusPlate (with a little Blue Tack of course).







I then grabbed a few resistors and connected the cables to the breadboard and then connected the other side to the header I fitted to the main board (in preparation for connecting the plus plate).


This is where I ran into my first problem.limited time and a failure to read instructions lead to an error in the connections. Instead of looking at the instructions I looked at the numbers on the top of the PlusPlate and reading down from the top started used the first available pins. Unfortunately these pins are already in use by AgoBo so there was a bit of a conflict when I tried to use these to run the mouth.

So looking back at the instructions I made a list of the pins that were in use and looked again at the PlusPlate for available pins and moved the connections to pins that were not already in use by AgoBo.

Once I had the connections all set up (correctly this time) I needed to set up- the code to run the mouth and control the facial expressions. I decided i wanted a smile (obviously, what's cuter than a smiling robot?) a sad face, a confused face and an open mouth, After this time consulting the instructions (the data sheet from Jameco) I drew a little diagram of which pin controlled which segments of the display and worked out a little table of which should be displayed for each facial expression.



With this organised I set up a Python library (mouth.py) to set up the facial expression and then a quick script to test the expressions. The test script (mouthtest.py) shows each expression I have set up so far. the smile, sad face and 'oh' i am really pleased with. I am not to sure about the confused face so I may not use that very much. These scripts will be available from my AgoBo Github fork here.


.



With the mouth working I wanted to work the expressions in to the normal running program for Agobo. I had written a quick script previously for him to avoid objects using the ultra sonic sensor so I used this as a starting point.

I ran into a small issue here as I had set up the mouth library using GPIO numbers and the AgoBo library is set up using board numbers. after a little head scratching (I am still unsure why in an error state the face always seems to display 'oh') I spotted the error and changed the mouth library to match the python library and now Agobo will avoid objects whilst displaying his emotions.

Currently he is happy moving forward until he finds an object. This makes him sad and he turns 90 degrees. If he can move forward he is happy again. If instead there is another object in his path he is shocked / cross ('oh') and turns 180 degrees. Again if the way he clear he is happy again and proceeds. However if there is another object he becomes confused (or his face does) and then turns 90 degrees (away from the initial object and proceeds on his way happy again.




Sunday, 8 February 2015

The Visual-Pi-ser a low cost classroom visualiser

In may last post I described my idea for a low cost visualiser based on the Raspberry Pi kit I was sent as part of the Element 14 Raspberry Pi Educators Road Test. I promised i would add more detail so here it is.



The box for the kit is used as a stand to hold the RPi case. The case in the kit has a mounting point for the camera and the arrangement holds the camera steady over the items to be shown. The main issue for this set up using the box is that the camera has a relatively large minimum focal distance so items at the range as out of focus until the camera is modified.

To modify the camera is a fixed focus unit and the lens is held in place with blobs of glue that can be removed with a craft knife to free up the lens (N.B. the lens can be sensitive to static and can be easily damaged so this needs to be done with care).


This modification allows the lens to be rotated and the items brought into focus. It also has the added advantage of slightly magnifying the subject.

The size of the box supplied is ideal for small physical computing projects but a larger box would give a larger field of view for bigger projects. The camera itself is controlled by using the Raspivid command:

raspivid -t 300000 -rot 90

This rotates the video by 90 degrees (as the camera mount is at 90 degrees to the box) and runs the video for 30000 miliseconds (30 seconds). If a longer or shorter time period is required then the number of milisecond can be changed. If you want to terminate the video session you can do so by using ctrl+c


I have created a guide on how to crate you own Visual-Pi-ser on github.


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.

Monday, 19 January 2015

Element 14 Educators Road test

Over the holidays I have been experimenting with timelapse photography of crystal formation with the Raspberry Pi. i have been doing this as I have been selected as on of the participants in the Element 14 Raspberry Pi Educators Roadtest. If you haven't come across the Element 14 Roadtests before they are a scheme where kit is sent out to a selected group of volunteers to test and write about. They runs the tests fairly regularly and all you need to do to enter is to write a proposal of what you will do with the kit.

This particular roadtest is of the Raspberry Pi B+ Camera Kit and i wanted to come up with a proposal using the camera functionality in a way I could use the kit with students to teach Computing and Science. My proposal was to work with KS£ and Home educated students on two slightly different projects both based around taking timelapse photography of crystals forming.



We have been playing with crystals at home for a bit with my Home Educated son and this looked like a great project to try with the Raspberry Pi and Pi Camera Module. The Addition of the Wi-Pi adapter and the case with camera mount made it ideal for applications like this where connection to monitor and keyboard would be difficult and a secure mount for the camera essential.

Part of the deal is that you write at least three blog posts and a review of the kit on the Element 14 community website . I am still working on the review and the third blog post but the first two are up already:

Part 1: Introduction to the project

Part 2: Testing



EDIT: (09/03/15)

The Road test is now complete and I have some more blog entries and a review of the kit. I also ended up doing a couple of side projects and wrote a scheme of work for the Time Lapse Crystals project.

Part 3: Home Education Project

Part 4: Summary

Review

Scheme of Work

Side Project 1: Visual-Pi-ser

Side Project 2: Snow Timelapse


The Roadtest was a good opportunity to experiment with the RPi camera module and I enjoyed the chance to try something different. The time lapse photography was a good way to combine science and computing and also produce some beautiful results. I have included one of the example videos here. This one is probably my favourite, It was taken from below the crystals with lighting above as part of the home education project.


Friday, 19 December 2014

The first rule of computing club........

....................don't talk about computing club


It struck me today that my computing club is made up almost entirely of girls. It also occurred to me that I hadn't ever publicly called it computing club.

I started the group to work up some entries for the Sonic Pi space music competition. A small group of students (10) arrived the first week and I showed them how to set up the Raspberry Pi and gave them a quick introduction to the Sonic Pi interface. Before long they were producing basic tunes and adding loops.

The group has since grown to around 15 regularly attending students and they are all engaging in coding pieces of music for the competition. It was not until I was looking through the list that I realised quite how many girls I had ended up with. out of the 15 I only have 3 boys who regularly attend (compared with our scratch games club that is entirely boys).

I have worked before with groups of students using Sonic Pi and found that it is great for engaging all students (not mainly the boys like a lot of the robotics work I have done) but this was something different as none of the students had used Sonic Pi before.

This was a marketing issue!

I sent round the poster along with a note to all of the Y7-9 classes asking for anyone who wanted to try making music with the Raspberry Pi, no previous experience necessary. There was no mention of computing, coding, or programming.

The response was all from students who were interested in making music rather than those interested in programming. They now all know (not that it was a big secret really) that to make the music they are coding, but they are making music. This appears to be a difference in the approach to what they are doing and has affected how they are engaged with something new. They are not intrinsically interested in the method of making the computer do something, they are interested in the end result (in this case music).

I now have a predominantly female group of programmers all engaged in coding. Once we have finished working on the music competition I am going to be looking for ways to maintain this engagement using the output as the motivator and the coding as the 'what you have to do to get there' bit.

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, 3 July 2014

Making music with Y5s




We had our Y5 Day at school last week. After tweeting about the day using Sonic Pi I had a couple of requests for information about what I did. So I have documented the plan and my observations here.

We were given a slot in the creativity strand so I thought this was an ideal opportunity to do something a bit different and engaging. The plan was to make some music with Sonic Pi and teach a bit of programming along the way. I had been given three session each of one hour. I set up the classroom before the students arrived with each Pi already hooked up and running Sonic Pi v2.0 (from my Picademy SD card image).

I had an interactive whiteboard with simple display software (ActivInspire on a Promethean board) to allow me to write on the board. Unfortunately I was not able to display my Pi screen to the students using the projector. So I had a large monitor that the students could see when they initially gathered around a central table for the introduction.

The plan was heavily based on the Picademy session delivered by Dr Sam Aaron and Carrie Ann Philbin.  I also used the Sonic Pi article in  Magpie issue 23 as a reference.

The Plan

Introduction - (approx 5 min)

Find out who had done any programming before or used scratch (to adapt the complexity and to be used later as an example if they knew how to do things in scratch)

Introduce Sonic Pi, show a quick example of what can be done using a preprogrammed routine or one of the example scripts. Show what happens when some of the parameters are changed by getting students to change them.

Activity 1 - (approx 15 min)

Explain simple play and sleep commands, write some examples on the board.

e.g.
play 68
sleep 1
play 58
sleep 1


Students to experiment with their own simple tunes, and with changing the midi numbers and sleep durations.

Activity 2 - (approx 10 min)

Explain that to get a tune we often have repeated elements.Explain that this could be done by retyping the code but this would not be efficient.

Introduce loops (if some have prior knowledge of scratch ask them what we do in scratch to do this - put 'forever' around the code) show students how this is done with Sonic Pi. I did this by adding the loop do to the code I had written on the board earlier to show how it wrapped round the code like the 'forever' in scratch.

e.g.
loop do
      play 68
      sleep 1
      play 58
      sleep 1
end

Students to experiment adding loops to their code.

N.B. at this point I had some students asking 'what if i only want to repeat it x times?' so I added an adhoc extra activity to explain.

Activity 2a - (approx 10 min)

Explain that we might want to repeat a specified number of times instead of keep looping forever. Explain that this can be done with '.times do'. Again I used the code I had on the board to show how this worked removing the loop do and adding the new command

e.g.
3.times do
      play 68
      sleep 1
      play 58
      sleep 1
end

Students to experiment with repeating a specified number of times. 

Activity 3 - (approx 10 min)

Introduce the 'sample' command. I used a new slide on my display to show an example sample command then asked students what we would do if we wanted it to loop.

e.g.
sample :loop_amen
sleep 1.753

this then became

loop do
    sample :loop_amen
    sleep 1.753
end

Students to experiment with adding samples

Activity 4 - (approx 10 min)

Introduce the examples to students. Show them where to find the examples and synth information using 'Help'. Remind them that the numbers in blue are parameters that can be changed.

Students to experiment with the use_synth command and using example blocks. Put together a small piece of music

Plenary - (approx 5 min)

Quick reminder of the main learning points; sequencing, loops efficiency....

Play out students work (or some examples if not enough time) to rest of the class.


Show and Tell

At the end of the day there was a 'show and tell' assembly where parents of the y6 pupils, the primary school staff and the Y7s and staff who helped on the day were invited to hear about what the students had been doing.

Each school chose a couple of volunteer students to show what they had been doing in the last session. For the students who were in my last session this included a performance of their music in the hall. This was especially well received and really showed what could be achieved in a very short time by students who had no previous experience with Sonic Pi (or in most case any written programming at all).

How it went

The sessions on the whole worked well. We had a limited number of working Rapsberry Pi set-ups and with some groups that made it difficult to get everyone fully involved; for some large groups we had some groups of four working with one Pi. This was due to a number of factors but mainly due to a batch of corrupted memory cards and limited capacity to build new cards at short notice. For next time I am going to ensure I have plenty of spare cards on standby.

We also did not have any headphone splitters so they had to pass around the headphones to hear the results. This was again a bit challenging in the large groups, but where there were groups of three or less it actually worked really well as the students were discussing what they were typing then listening to the results in turn. This promoted more active group working and lots of discussion about what do add to their programs. We are intending to purchase some of the splitters to enable a 1:1 headphone assignment, but I may be using these only after I have the groups working well or remove them if I find that the wearing of headphones is reducing this productive interaction.

I was really pleased that all of the groups produced reasonable credible music products during the sessions. There were even some groups who were moving ahead so I had them experimenting with threading. Overall the day was really successful in getting students to be creative and engaging them in learning some computer science. 

Gender Bias

I was interested to see that during the sessions there was no noticeable gender split in the engagement of pupils. The girls and boys seemed to be equally engaged in creating music, where in previous sessions (robotics based) there was a noticable split with more boys being engaged than girls. I am unsure if this was solely because of the nature of the activity or other factors (e.g. in a different school, age of the pupils). It will be interesting to see if this is the same when we implement this as part of our standard curriculum next year.

Other options and resources

I had a bit of a short lead time to deliver the session so didn't have any time for additional research so I used the Session that Dr Sam Aaron delivered at Picademy as my main inspiration. However I have since discovered that there is now a Sonic Pi taster activity on the Raspberry Pi website. This provides a fairly good introduction that I could have used.

I did use v2.0 for these session but you could do very a similar type of session with the current release (or you could download the latest release candidate of v2.0).

The full Sonic Pi scheme of work is available on the Raspberry Pi website and you could use the first lesson from that scheme as an alternative (the scheme is currently written for Sonic PI v1 but will be updated once v2.0 is fully released).

For support with Sonic Pi Dr Sam Aaron has a dedicated Sonic Pi Google+ group. There is also the Sonic Pi website for more information. The Raspberry Pi official forums are also a great resource for support from the community. They even have a dedicated education section.

Wednesday, 18 June 2014

Picademy

Two days of CPD is enough to fill most teachers with dread but the Raspberry Pi Foundation is changing all that with its Picademy. Two days of Raspberry Pi training focussed around using the device to it's full potential in the classroom.
 
In April the first Picademy was a great success and the feedback from educators on twitter caught my attention. If you read my first post on this (somewhat neglected) blog you will be aware I had been doing some research into the use of the Raspberry Pi in classrooms. This led me to look for more engaging ways of teaching computing where I could utilise the Pi to it's full extent. I wanted to avoid the replace PowerPoint with Scratch on Raspbery Pi approach and create engaging projects for my students.
 
So where could I go to engage with others and get some inspiration. it was then that #picademy started to appear on twitter. Brilliant, how do I get to go along thought I. Unfortunately the first dates fell over the Easter break and we already had plans. However a series of fortunate events led to a place on the second run. A hastily booked train and hotel later I was off to Cambridge.
 
 
 
We all arrived at Pi Towers not quite knowing what to expect but with high expectations based on what we had seen from the first event.  We were not to be disappointed. After a few housekeeping points we were straight into a day packed full of workshops covering a wide range of activities we could use with students in our classrooms. This included Sonic Pi with Sam Aaron, GPIO with Clive Beale, Minecraft Pi with Craig Richardson and Pi Cam with Ben Nuttall.  There were also sessions on the use of Pi in the classroom using VNC, GitHub and the Raspberry Pi Community. All of the session were led by enthusiastic experts and the content had been backed up with real life experience in classrooms.
 
 
 
These sessions gave a great overview of the varied ways the Pi can be used to engage and enthuse students. I was particularly impressed by the range of ways the Pi can be used to promote the creativity of students.


After a busy day training our minds still buzzing with new information we headed out for the evening meal. This was an amazing opportunity to discuss ideas and network with the other attendees. There were also most of the Pi Towers team on hand to quiz further; how many training providers do you know who are still answering questions at 2130?




The second day started with some inspiring sessions from Eben Upton, Rachel Raynes and  Lance Howarth. A reminder of why the Pi was created and more on creativity.

It was then our turn to get creative in the 'unconference'. The idea being to put to use the inspiration from the first day to practice our skill, create new resources and solve issue we had encountered. In small groups we were able to consolidate what we had seen and further develop our ideas. Some groups worked on teaching resources and others on areas of interest.


 
Our group worked on a few ideas until we settled on the idea of a quiz bear. This initially involved doing unspeakable things to Babbage to embed the Pi inside with an LED smile and buttons in his ears. Fortunately for Babbage, time was short so a plastic cup made a more easily modified host. We developed the idea to create the idea of a modular scheme of work for Technology and Computing. The main idea being to create the basic elements using recipe cards and combine them together. This would get progressively more complicated and open ended (I will post more about this once we have more to share).


After feverishly working in our groups we all came back together to share what we had produced. Each group or individual shared what they had worked on and/or produced. This ranged from personal development consolidating the skills to imaginative products and schemes of work. One of my favourites was the Micheal Jackson Tribute Glove (#MJTG). This was a development of a previous project by one of the group members and produced a dancing animated MJ on screen controlled by the hand of Dan Aldred.



A short video of the end result can be found here.



After all the sharing we gathered for a presentation of the very shiny Raspberry Pi 'Certified Educator badges'. The course was over but we were all still buzzing; in fact my group continued work on the train home, putting together a plan of action to complete our scheme of work.



This was without doubt the best CPD event that I have attended as a teacher but better than that it has opened my eyes to more of the creative possibilities. I have been a firm advocate of not using technology just for the point of using it and had started work to find ways to really utilise the Pi. Picademy has really helped to firm up this approach in my mind and has really shown me how much value the Raspberry Pi has as a tool to engage students and get them being creative in the classroom.


Much has been made of training the next generation of computer scientists, but without engaging curiosity and promoting creativity then we will only be producing a generation of robotic programmers with no love for the subject. Hopefully #picademy and the Raspberry Pi Certified Educators it has produced will be able to help the Foundation to provide that creativity and inspiration.

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)