Reading Time: 3 minutes

Raspberry Pi is a small, cheap computer on a circuit board the size of a credit card. I spent a very interesting day in training today, learning how to use a Raspberry Pi with Python programming, creating small embedded systems and connecting to servers, with applications (in theory!) for the Internet of Things. Today a little red light, tomorrow the world!

World domination aside, it was the first time in years that I had built an electronic circuit, or done any microcontroller programming, so it was a very hands on day and a really fun change from my usual work.

The Kit

The Breadboard

For me, the first challenges to overcome were in using electronic components with a breadboard again. The breadboards we used were very much like this:

Electronics breadboard, sold by Spark Fun

Breadboard – Full-Size (Bare), as sold by Spark Fun.com. But does it spark joy? You know, I think it could 🙂

The first task we had with our Raspberry Pi kit was to turn a red LED on and off with a Python programming. It was nice to be doing something so practical, even though I had forgotten a lot of the basics, like that various components only work one way round (I know!).

The breadboard (as I learned) connects up the components whose legs you stick into it along rows and columns, except where there is a groove separating different blocks (didn’t realise that part so that tripped me up at one point).

On one side of the Raspberry Pi, there is a set of numbered connector pins called GPIO (General Purpose Input / Output). Some of them have different electronic characteristics, and they are all numbered so that they can be matched up with port numbers when you’re programming.

At this point, things did start coming back to me, with some happy memories of an Open University course in Microprocessor-based computers, in the days when they sent out a programmable temperature measuring kit. That was C and Assembler, this was Python; that was temperatures, this was lighting; this was Raspberry Pi, and that was, umm, something else. But hey, 2 out of 3 isn’t bad!

Raspberry Pi and Python Projects

  1. Turning a Red Light On and Off with Raspberry Pi and Python

  2. Traffic Lights with Python and Raspberry Pi

    We used our Raspberry Pi and breadboard to build and control a small circuit modelling traffic lights.

    Here is a photo of the Raspberry Pi and circuit, showing the green light lit up:
    Raspberry Pi and breadboard with small circuit, showing green light lit up

    Everyone likes a green traffic light, right?

    Here’s another photo, that also includes the Python code and text output:

    Raspberry Pi, breadboard with circuit, and monitor showing Python program code and text output

    Exciting stuff: Python program code and text output showing the Raspberry Pi traffic light controller in action!

    Traffic Lights: Video 1

    Traffic Lights: Video 2, with Python code and text output

Links

(Full-size Breadboard. Spark Fun's images are CC-BY-2.0)

Share