Arduino Uno for Christmas

Img_20101226_193345

I was lucky enough to be given an Arduino Uno for Christmas. For those who haven't heard of Arduino before, it's an open-source programmable electronics prototyping board. It allows you to write code then flash it onto the board and interact with other electronic components such as LEDs or speakers.

For me the Arduino is the perfect combination of software and hardware. It allows me to programme then see that code interact with the physical world. For example, it only took an hour of experimenting to get a little flashing traffic light system working. The code is similar to C++, and while I'm more experienced with JavaScript and Python it was relative easy to get use to. Here's the code:

int redPin = 10;
int yellowPin = 9;
int greenPin = 8;

void setup() {
    pinMode(redPin, OUTPUT);
    pinMode(yellowPin, OUTPUT);
    pinMode(greenPin, OUTPUT);
}

void loop() {
    digitalWrite(redPin, HIGH);
    delay(300);
    digitalWrite(yellowPin, HIGH);
    delay(300);
    digitalWrite(greenPin, HIGH);
    delay(2000);
    digitalWrite(redPin, LOW);
    digitalWrite(yellowPin, LOW);
    digitalWrite(greenPin, LOW);
    delay(300);
}

 

As you can see it's relatively simple. The fun part is wiring it all up the breadboard with resisters and LEDs and seeing the flashed code running.

I'm really looking forward to making more advanced devices, ultimately culminating in a robotic arm which has always been a dream of mine to build.

Building the Pong Electonics Kit

After entering the world of electronics with my first project, I was eager to move onto something a little more complicated. Luckily, a Christmas gift from my girlfriend provided the answer, the Classic TV Game or Pong to you and me.


The concept of the kit is simple but brilliant. Once you've put together and soldered all the componets in the kit you're rewarded by hooking it up to the TV and playing virtual tennis against the computer or friends.

As with the previous MiniPOV kit, construction was relatively simple but that's kinda the point. These kits are designed as an introduction to electronics and allow you to practice soldering on real circuit boards. While I'm very new to electronics I have learnt some basics points:

  1. A clamp that holds the board in place is essential (magnifying glass is a bonus)
  2. Flux is your friend
  3. A multimeter is a trusted companion that helps put your mind at ease during a build
  4. Lighting is very important. Lots of good strong light on your build makes life a lot easier
One of the unexpected outcomes I've noticed while building these kits is the relaxing effect they have. I spend a lot of time coding wed sites, jumping from social network updates to emails, only giving each one some of my attention. However, when building these kits I become very focused, especially when soldering. A steady hand, precision and full concentration is required for quality solders and I find this level of focus very relaxing.

For my next project I've decided to ramp up the difficulty, and hopefully the fun, by building a robot. The term robot is a little misleading here as it's actually two motor powered wheels and half a ping-pong ball. Nevertheless, the construction and programming are significantly more complex and should provide a worthy challenge.

Building the MiniPOV v3

For a long time I've been interested in electronics, it comes with the geek territory. So when I read about the Arduino electronics platform and it's ability to be programmed via Processing I was very excited. However, I decided to start small and build up my non-existent electronic skills.

To develop my skills I bought a MiniPOV v3 kit, this is a little kit designed to teach soldering, programming micro-controls and is just fun play with. In total, the kit took around five to six hours to construct and flash.

At first the soldering rather difficult and resulted in a few messy joints, but over time I got better, with faster and cleaner solders. While not perfect, it did work first time. I decided to document the process with a serious of photos and videos.



Once the kit was built, the final stage was to program the micro-controller. The device is connected the the PC via USB to Serial port converter (bought with the kit) and flashed with a C compiled hex file. The message is stored in the source code as a two-dimensional array of eight binary values per row. Each binary value represents a single LED and each row is a strip of LEDs.

For example:
b8(00000001) # All LED's off except for the last one

To write out a simple message such as "HELLO" you need to create each row and work out which LED's are on and which are off, this can become very tedious for longer messages. Therefore, I quickly coded a MiniPOV Online Text Generator. This tool allows you to simply build up a messages by clicking on boxes and then generating the required C code ready to be pasted into the source code. Nice and easy.

I use the Linux distro Ubuntu as my OS, this made programming the MiniPOV relatively easy. The first thing is to install the required software: gcc, avrdude, avr-libc, binutils-avr and gcc-a (for Windows or Mac,  the official MiniPOV site has more details). With all the required software installed, it was a simple matter of overwriting the table image[] in mypov.c file with the custom code generated earlier, compiling the code and flashing the device.

I thoroughly enjoyed the whole process, learnt a lot and developed a bunch of new skills. Now I'm really excited to move on to my next project, a two-player Pong kit that hooks up to your TV via  S-Video. It's going to be awesome.