So today is my last session with the children and we will be creating quality audio and enhanced lighting sequence coding for me to combine into the final code for their book monsters. I finally got the tilt mechanism working and the wiring for the lights embedded in the monster’s eyes.
This short video show the demo kit working.

A big thanks to the schools and the children involved; it has been a wonderful project to be involved in and one I thoroughly enjoyed.

Session 4 took place at the Innovation Centre as we needed access to some quality microphones and speakers.

In this session we quickly recapped the previous session and then discussed that the Book Monster would talk to the children when books were posted. To do this we needed to create some audio files that could be randomly played and we used the free audio software Audacity to do this.

We practiced recording our voices with Audacity to make sure the sound levels were okay and then learnt how to clip the beginning and end of the clip where necessary.

Next we drafted several phrases we wanted the monster to say and then practised them in our best Monster voices. Once we were happy with them we recorded them carefully and then exported the files as MP3 files and saved them to the SD card we used with the Raspberry Pi.

Once completed we put the SD card back in the Pi, connected it up and turned it on.

We located the files on the SD card and copied them to a folder we created on the desktop of the Pi to use in our next piece of code.

We discussed how sound could be played and the code we could use as below.

Today was really fun because we made a light flash like a traffic light. First we had to put in 3 bulbs instead of 1. First the red light bulb went in then the yellow at the same time then we off the both of them and off the green like a traffic light. We were the first one as normal.(By Miguel)

Session 3 was going to be a challenging session as we would be introducing multiple LEDs, breadboards (we did look at breadboards briefly in session 2) and programming the LEDs to work independently.

The children quickly and confidently set up their Pi and opened their last program in Python. In session 2 we had to wire an LED to the Pi but some of the jumper leads we used did not connect to the pins very securely so we substituted this with a breadboard for ease of use. A breadboard allows several electrical components such as switches, LEDs and buzzers to be connected easily to test circuits. There are different sizes of breadboard and the one below is the breadboard we used.

It is important to understand how the breadboard is wired and the image below shows how the pins on top of the board are connected by wires internally.

We used the breadboard to create a simple circuit with one LED and used our lights v2 program to make it flash.

I then asked the children to make the following circuits and predict if they would work.

These circuits are called series circuits as each component is linked to the other in a linear way. The LEDs did not light up. Without getting too technical there is not enough voltage from the GPIO pin to light all three LEDs in this way.

I then asked the children to connect the LEDS as below. This circuit is called a parallel circuit and because each LED is connected directly to the GPIO pin there is no loss of voltage and so all 3 LEDs light up.

The children were now able to control all 3 LEDs and we discussed if we could control the LEDs individually from the one GPIO pin. Obviously we could only program the GPIO pin connected to all 3 LEDs so the answer was no. The children then discussed how they could achieve this by using more than one GPIO pin per LED and changing their code.

They very carefully created the circuit below to control all 3 LEDs independently.

They were then asked to alter the code in Lights v2 to utilise all 3 connected GPIO pins and save this as Lights v3.

The children then created their own code to make their own sequences of lights.

I was very impressed on how much progress the children had made in three sessions. They were now able to set up the Pi, use a breadboard to make their own circuits, connect this to the Pi and then create original code to control the LEDs to flash to their own sequences using Python.

The children from all three schools seemed very excited about the second session.

We recapped session one and many of the children were able to recall several of the acronyms we discussed and were given the task of setting up the Pi independently for this session.

We revisited the GPIO pins and discussed the fact that these pins were programmable so that they could act as outputs or inputs and we discussed inputs and outputs for devices in our world such as burglar alarms, traffic lights, remote controls, etc.

We created a similar circuit to the one we did in session one but this time we used a GPIO pin rather than the 3.3v pin. When we did this the LED did not light up and we discussed that we had to programme how the GPIO pin we were using worked.

We used the command sudo idle from the command line to launch the program Python. The sudo command is important here and means Super-User DO allowing us to directly control the GPIO pins.

We created a new python file called Lights v1 and then looked at the following code.

The ## is very important when coding in Python as they do not represent any code but allow the programmer to make a comment about the code and what it does. This is very useful when the code does not work and it needs to be debugged. It is particularly useful when the code is shared with other coders as it allows them to understand what each line of code is designed to do. We have highlighted this in red here for clarity only.

The first line ensures the Pi can use the commands to control the GPIO pins.

The GPIO pins have two modes of identification. For example, GPIO4 can also be referred to as pin 7. The second line tells the Pi the naming system we will use to identify the pins.

The third line tells the Pi the GPIO pin we are using (pin 7 also known as GPIO4) to act as an output

The fourth line turns the pin on and sends an electrical current through the pin.

The children were aware of the importance of syntax when coding and were very careful not to make any mistakes. They then saved their Python file and ran it. The LED came on and the satisfaction on the faces of the children was clear to see.

The last activity of the session was to try and get the LED to flash. To do this we had to use the time library and the sleep command. Below is an example of the code the children created to make a flashing LED in a file they called lights v2.

I created packs of Raspberry Pi materials for the children to utilise during our first session at St Francis with small groups of children from each of the schools.

The packs included a Raspberry Pi, a clear Pi case, power supply for the Pi, HDMI cable, a serial to HDMI converter and power lead (the monitors we were using had no HDMI input), monitor with serial cable, an LED, an SD Card with the Raspbian OS installed and some custom built jumper wires. I used the keyboard, mouse and ethernet cable from existing PCs in the ICT suite.

The session looked at understanding what a Raspberry Pi is, how to connect the kit in the box to the various ports and running the Pi from the SD card. The children were great and thoroughly enjoyed connecting the components and learning an assortment of acronyms such as LED, HDMI, USB, etc.

On start up the Pi is set to open to a command line interface not a usual desktop interface and the children had to login and use the startx command to get a more familiar desktop interface.

We discussed the settings the Pi used when booting up and decided we would change some of this for ease of use later.

From the command line interface we typed sudo raspi-config to enter the Configuration Tool and made changes so that the Pi booted to the desktop and made the default audio output the 3.5mm audio out rather than the HDMI output because we will be connecting speakers later in the project.

We were then introduced to the concept of coding and that everything the Pi can do is coded somewhere. We want on the Internet and found the default search engine was duckduckgo.com and discussed changing this to Google. The only way we could do this was to edit the code in the Raspbian OS. The children became aware very quickly of the importance of syntax and that any slight error in creating / editing code could result in the Pi not working properly. The children carefully carried out the task below and were very excited to see that they had changed the way the Pi operated the next time they used the Internet and it defaulted to Google.

The Curriculum Innovation team was contacted by Dan Copley, the Headteacher of St Francis Catholic Primary, to discuss an idea he had on creating a man size book monster. The book monster would be located in the library and children would ‘feed’ the book monster with books when they returned the books to the library. He enlisted the help of a local model maker / special effects expert Ellie Morley to work with the children to design and build the 1.5m models. Dan wanted the book monsters to interact with the children when they posted the books and discussed this with me (Paul Scott from the Curriculum Innovation team). Discussions included parts of the monster moving but from a technical perspective it was clear this would be prohibitively expensive to achieve so it was agreed that the monster would have eyes that lit up and it would speak to the children when fed by books.

I looked at several ways to achieve this and decided that the most cost effective solution would be to use a Raspberry Pi.

I visited some very helpful staff at Bradford University’s Pi Nest who gave some good advice on what I would need to use the Pi to control external components such as LEDs and switches. With this information and access to on-line resources such as www.raspberrypi.org and YouTube I decided to investigate a solution coded using Python on the Pi.

Today we learnt how to wire up multiple LED lights to a breadboard and also learnt how to write the correct code to make them light up at different times. I found it a bit difficult because of all the different code we had to do and I also found it difficult because of the wires we had to put in the breadboard.

Today I learnt how to use the bread board using 3 LED lights. It was really fun because my group made it turn off and on like a traffic light. We made it turn red, then yellow, then green. It was yet again another really complicating challenge but one we achieved!
By Ella