After Googling around a bit and brushing up my knowledge of basic electronics (that had gotten a bit rusty since I haven't done any electrical work after high-school), I had an idea how we would do it. I ordered various electronics bits and bobs from the net, such as LEDs, jumper wires, resistors, few breadboards, switches, a GPIO cable etc. You can get this stuff from pretty much any electronics shop, either online or if you have a brick and mortar one nearby. I ordered a shipment from Pimoroni since they have all kinds of nice accessories, for example a lego compatible breadboard, a lego compatible base plate for the Pibow case I already had, some colourful USB and HDMI cables and SD cards etc.
While waiting for the shipment to arrive, I talked to Kaisla about electronics and tried to teach her some basic concepts. Like what is an electric circuit, how current flows in the circuit and how we need to adjust the current to our needs with resistors and how switches work by breaking the circuit. She seemed to understand most of that pretty well and even came up with some examples from real life, like the light switches in our house. I also talked to her about how dangerous electricity can be and that we must be cautious whenever we're working with electronics. We also learned that it's important to plan the electric circuits and how it's usually done by drawing a circuit diagram and she drew a simple one with one LED and a resistor.
Robot AntennaBefore going ahead with the traffic lights project, I decided that we should try something a little more simple first. I found this nice beginner project called Robot Antenna in the official Raspberry Pi site that has lots of good learning resources. It involves a very simple circuit with one LED and one resistor and then it can be programmed using a modified version of Scratch, called ScratchGPIO, with the same familiar user interface that we are already used to with Scratch.
When we received the shipment, we were both excited and Kaisla was very happy about the things I had gotten her, like a pink SD card and a purple USB power cable. She was very pleased that she had her own memory card and wanted to decorate it with a butterfly sticker.
Before starting with the robot antenna project, we first tried if we could just light up a LED without any programming involved. The GPIO pins on the Rasberry Pi have different purposes, some need to be programmatically turned on but some have constant power output (you can read more about them here if interested). So we put together the circuit of one red LED and one resistor (we used 330 Ohm like in the instructions for the robot antenna) with some jumper wires and connected to the 3.3 volt power output pin and a ground pin on the RPi. It was an exiting moment when I plugged in the USB power cable for the first time, but the LED did light up! We then tried all the other different coloured LEDs I had bought, green, yellow and blue, and they all light up nicely (even the blue did light up without changing the resistor, even though it requires more voltage).
All in all, it has been a very interesting first hardware project for both of us and we have both learned a lot. Next we will start planning the traffic lights project, and I'll write more about that later.