Preamble 2 – An Evening with Arduino and LEDs

In my last post, I mentioned that I had bought an initial electronics play kit consisting of an Arduino Uno, USB cable, breadboard, jump wires and a selection of LEDs and resistors. I also mentioned that I had access to the book Beginning Arduino by Michael McRoberts.

The first chapter of the book takes you through what the Arduino is, how to install the IDE for programming it and how to upload your first sketch to it (a sketch is a compiled program that is uploaded to the Arduino board from the IDE). It then goes through the Arduino IDE in a bit more detail. The second chapter goes straight into the first project which is to make an LED blink.

Using just the Arduino, breadboard, an LED, a suitable resistor and two jumper wires, I made the circuit that would light the LED from port 10 of the Arduino board. (Note: the Beginning Arduino book explained how to calculate what would be a suitable resistor)

Here is a still photo of the setup:

Now you’re possibly thinking, “that’s easy” or “that’s useless”, and you may be right. But that LED was blinking in a manner controlled by a sketch written by me on my laptop. It was an LED in a circuit that didn’t exist until I built it from the bits I had bought. I found this to be a very exciting moment.

I then extended it by adding two more LED circuits on other ports and changed the sketch to light them up in a traffic light sequence. Here’s a video of what I ended up with:

The 3 LEDs are all different because I bought a lucky-dip bag of LEDs and wasn’t lucky enough to get red, green and yellow of the same type and size.

I then spent the rest of the evening playing with timings and sketches to light the LEDs in different patterns.

Advertisements

Preamble 1 – An Introduction & My Initial Purchases

Many years ago, I started my post-secondary school education with an electrical and electronic engineering qualification. After completing that, I changed to Computer Studies and have been working in I.T. and DOS/Windows/Intel PC software development ever since. See the About page for a little more detail.

I don’t know what has made me want to look at electronics again in recent years, I think it is possibly seeing a lot of mash-up and electronics projects appearing on the web as all sorts of wonderful toys become accessible. I had been considering getting a Raspberry Pi to play about with for a while but, recently, when I was in my local electronics store, I bought an Arduino and a few extra bits and pieces to play with:

Arduino Uno and the bits I bought with it

I picked up the following:

  1. Arduino Uno & USB cable
  2. A bread board
  3. Jump wire kit
  4. Lucky-dip bag of LEDs
  5. Lucky-dip bag of Resistors

I also had access to the following book:

Book Cover for Beginning Arduino by Michael McRoberts

This book was great at explaining the initial electronics principles that enabled me to use the above kit to get LEDs up and running and controlled by the Arduino. I’ll detail the two little LED projects that I got running in my next post.