Category Archives: Arduino

LED Cube


I’ve seen many LED cube projects pop up on relevant blogs (HackaDay and MAKE blog to name two) and wanted to make my own but it never reached the top of my todo list until I recently started playing with the WS2812 RGB LEDs (more commonly known to some as NeoPixels). These delightful LEDs come in wonderfully small packages (I’m using the 5050 surface mount ones but I believe they are also available as through-hole 5mm LEDs). I made a spinning dodecahedron out of milled PCBs which was adorned with such LEDs (read about that here) and when I took delivery of the bare WS2812B LEDs, which only have four contacts (power, ground, data in and data out) I realised I could free-form them in a series of columns to create a cube. I expect this has probably been done before but as I was due to give a workshop on Controlling LEDs with Arduino I thought this would make an ideal example.

Click Continue Reading for details.

Continue reading

Halloween Costume – MAD Scientist

This Halloween and the month leading up to it I put together a MAD Scientist costume. Most of the preparation was in the assembly of the 16×8 LED array which was free-formed to sit inside and take the shape of a brain-shaped jelly mould. It was the chance encounter with the jelly mould that sparked this costume off. The semi-transparent vacuum-formed mould looked ideal and it was a good fit for wearing on my head like a hat.
I already had some MAX7219’s so I knew that I was going to use these to drive the LED arrays and the left-over LEDs from swapping the colours on the LED Message Board were prime candidates for the array. I fool-hardedly embarked upon a bi-colour array, alternating Red and Blue without giving any thought to the different voltages required by the two types of LED. I kind of got away with it and was able to made a few animations based around the colour difference (i.e. police lights) but if I were to do it again I’d probably opt for just a single colour.

LED arrays rest in the brain jelly mould with an Arduino (Freeduino kit) driving the array.

LED arrays rest in the brain jelly mould with an Arduino (Freeduino kit) driving the array.

With the LED array nearing completion my attention turned to the asthetics of the brain. I didn’t want the LEDs to be obvious so would need to add an opaque layer and decided to paper mache some tissue paper inside the plastic. Finding white and pink tissue paper (the pink was too vibrant so the white went on first) I quite easily obtained a thin layer of coloured paper between the plastic and the LEDs. The LEDs are arranged on some single-core wire which was bent to the shape of the mould before the whole lot (including the MAX boards) was hot-glued in place.
A lab coat was bought on e-bay for less than £10 (wish I had spent a little more time on this as I went for a lab coat with striped edges instead of a plain lab coat). I took the lab coat with me to MAKLab and had a go at digital embroidery with an emblem and some text on the breast of the coat. This didn’t turn out brilliantly as we only had some cheap thread to hand but I felt it gave a weathered look. Had I not left it so late I might have given the coat a proper weathering (couple of coffee stains, dragging it around the studio and maybe a wash or two to loosen it up, add some elbow patches etc.)

M.A.D. Labs Inc - Dr E Gore

M.A.D. Labs Inc – Dr E Gore

To accessorise I found an old pair of safety goggles which had seen better days and dust mask and applied speckles of ink to both by spraying them using a sharpie pen and a makeshift air nozzle (straw cut and shaped to a 2mm hole). Blowing through the straw and placing the sharpie nib in front of the nozzle I got a few splashes and splats of colour (black with some red accents).

I took my old animatronic hand off the servo board and restrung it (the fishing lines had all snapped anyway). This was place on a carriage in the breast pocket of the lab coat and the fishing lines ran down the inside of the jacket to the lower pocket.

Gloved animatronic hand in pocket

Gloved animatronic hand in pocket

A hole in the other pocket permitted a cable to be run from the pocket up the jacket to the collar where it connected to a socket at the back of the head to supply power and signal from an Arduino in the pocket to the brain LED array.
I bought a halloween costume wig (£12) and modified it to accept the brain where the used to be a bald patch. This is held on by some hot-glue between the plastic of the mould and the fabric of the wig. I finished this off with some electrical tape (intending to match the Red/White/Blue of the lab coat but only going as far as Red and White).
The assembled costume cost me less than £30 (lab coat £10, wig £12, jelly mould £1 or so, tissue paper £2 with lots to spare, the rest was found or repurposed) and was great fun to put together and even more fun to wear.

Mad Scientist and Dalek

Circuit diagram and code available for anyone who is interested (though neither are anything special), leave me a comment and if there’s any interest I’ll post them here.

Thoughts for upgrades or alternatives:
RGB LEDs arranged beneath the jelly mould would allow for more advanced animation and expression.
Even PWM control of the brightness of individual LEDs would be good (the MAX chip allows for 16 brightness levels but they are set for the entire array not individual LEDs).
Makeup, dirty/sooty look for the face perhaps with panda eyes where the goggles provide protection.
Weather the brain jelly mould (it’s a bit too clean and shiny)
Better blend the brain-face boundary, I wanted a metal strip but ran out of time and just taped up the edge of the mould. Perhaps add some wires or bolt/screw-heads.
Replace safety goggles with something DIY, perhaps steampunk-ish.
Similarly the dust mask wasn’t ideal, replace with custom ‘respirator’ continuing the bio-hazard symbology on the lab coat.
Replace Red/White/Blue strips on lab coat with Black/Yellow 45deg stripes (don’t know if or where these would be available).
More accessories, i.e. test tubes, black rubber gauntlets (I had some disposable gloves left over from spray painting), robot pet etc.
Could be a couples costume if the other half dressed as a frankenstein/monster/lab rat.

LED Twitter Display for MAKLab

[1st September 2013] With the help of Glasgow Open Source Hardware Group (GOSHG) members I’ve replaced all the LEDs on MAKLab‘s old/defunct 80×7 LED Display Board (RC8200 from “Real Color Displays Inc”). Removing the old processor (a Z80) and superfluous ICs (8-to-1 Multiplexer, buffers, NANDs, ANDs, J-K Flip-Flops and such-like) I’ve got full control of the LEDs with just 7 pins (4 to control the rows, 2 to clock in data into the columns and one to strobe the data to the LEDs). Up until now I’ve been using an Arduino Mega ADK and Ethernet Shield to handle the processing (today I added some code to make use of the microSD slot such that messages could be read from the SD and displayed if an Ethernet connection is not made). I’m now considering options for condensing the hardware controlling the display. I like the Ethernet shield with the microSD slot but having it on top of an Arduino Mega takes up a lot of space. Considering something like the Arduino Uno Ethernet, though I’d like more code space (will try optimising/condensing to fit on an UNO since I certainly don’t need the pin count or other features of the Mega).

Having recently discovered Vine and rediscovered Twitter I’ve been Vine-ing and Tweeting about the board.

Other than the Vine-ing and occasional Tweets I’ve not been documenting my work on this project, instead just forging ahead over the past few weeks, so I thought I’d add a blog post and add to it from time to time. This post is a work in progress, published with the intention that I actually do something with it (way too many draft blog posts that won’t see the light of day).

Android Controlled Tank

At work someone mentioned using a robot to distribute the Friday afternoon sweeties and I accepted the challenge. Already having a tank remotely controlled with a PS3 Controller I decided it would need a camera to see where it’s going. Having recently upgraded my phone I was able to use the old one with IP Webcam to share the camera feed over wifi.


When I stumbled upon a brief article on Let’s Make Robots about a LEGO robot with a wifi camera which is controlled by a custom Android App. I followed the instructions on the website linked in the article and had the proof of concept up and running with the free version of the app. Upon buying the Pro version of the app I was able to drive the tank around via bluetooth and simultaneously see the camera footage from the old phone over WiFi.


My configuration takes a Heng Long 1:32 scale Bulldog Tank base (chassis, motors, gearbox and treads) driven by a Dagu 4-channel motor controller (over the top in this instance but a common item now found in three of my robots) and controlled by an Arduino MEGA ADK (also over the top but I was using this for the USB Host aspect when the tank was operated by PS3 controller via bluetooth dongle). The bluetooth dongle has been replaced with a Bluetooth module for a simple serial link.

The Bluetooth module I have is only identified by the following address written on the back and the label BT_Board v1.1. Thankfully I didn’t need to do much to make it work, just wired up the power (VCC, GND) and plugged the Tx and Rx of the bluetooth module into the Rx and Tx of the Arduino (crossed over so Tx talks to Rx and vice versa).

Servo added and the Arduino code updated I can now tilt the camera using some buttons on the BTBotControl interface.

A video has been uploaded to YouTube.

Where should I go from here?

  • Overhaul Arduino sketch to allow for joystick control of camera angle (like a pan and tilt mode where horizontal joystick moves will rotate the robot but vertical moves only raise or lower the camera).
  • Perhaps mount an Airsoft BB gun (I have the original one from the tank turret).
  • Write my own custom Android app? Try piping control of the robot through the on-board Android phone, doing away with the mix of Bluetooth and WiFi. While I’m at it make more use of the Android, it has GPS, an accelerometer etc.
  • Reversing view using phone’s second camera? Phone orientation means the rear-view camera is hidden in the holder.

Digispark Name Badge

My first Digispark project was a hastily thrown-together name badge for the Edinburgh Mini Maker Faire.

The badge consisted of a Digispark, an I2C shield, I2C LCD and a SRF02 Ultrasonic Rangefinder.
The SRF02 was selected for it’s small form factor and the ability to communicate with it over I2C. Instead of taking up two pins for trig and echo like my other Ultrasonic Rangefinders this allows both the LCD and the rangefinder to share the two I2C pins of the Digispark’s I/Os, leaving me with 4 ‘spare’ pins.
Power for the Digispark was supplied by a 9V PP3 battery, though I considered alternatives such as 4x AA batteries, a stack of button cell batteries and a LiPo. The decision was made on a balance of weight and ease of use. The Digispark has a 5V regulator on board, taking any voltage over 6 or 7V and regulating it to the 5V which the three major components require. It isn’t necessary to use the regulator if your power source is going to remain at 5V, hence I considered 4x rechargable AA batteries (1.2V x 4 = 4.8V) unregulated. A mintyboost or similar voltage booster/converter would also have been a viable power supply and would have cut down on weight (I suspect), however I didn’t have the components to hand.

Mounting the Digispark, LCD and rangefinder on a simple plexi frame gave the badge a more finished look.
With the Digispark prominently displayed (albeit backwards) on the front of the badge I will be able to disconnect it for reprogramming or for showing it off… “oh look at me I’ve got a tiny Arduino”.
Software is rather primitive at present. The rangefinder is polled and different messages are displayed according to proximity. At maximum range the LCD is turned off, primarily as a power saving measure. Up close the message will scroll some text. As the LCD is powered by an HD44780 I was able to make use of up to 8 custom characters. I toyed with the notion of producing animations with the custom characters but quickly ran into stack heap collisions so I opted for a few simple graphics. Further custom characters could have been employed by updating the custom characters on-the-fly though they could not all be displayed at once.
Further features I would like to (would have liked to – depending on when you read this) include would be a few buttons to choose between different modes/displays. Perhaps some RGB LEDs to liven the display up a bit.
As I thought I might want to re-purpose the LCD I didn’t solder to the pins. Since there wasn’t much space for adding a jumper cable I coiled some single core wire around the pins and covered in heat shrink. Time will tell if this method is robust enough, I may find myself applying a spot of solder if the connection is ‘flaky’.