Mike's Lost In Space B9 Robot     |   home

Tread Section   |    Tread Belts   |    Wheels   |    Legs   |    Leg Motion   |    Donut MK I   |    Donut MK II   |    Torso   |    CSS   |    Radio TX/RX   |    Power Pack   |    Back Plate   |    Neon   |    Chest Buttons   |    Belly and Chest Lights   |    Lightening Wrist & Claws   |    New Wrist Inserts   |    40,000 volts   |    Arms   |    Radar Ears   |    Bubble Lifter   |    Brain   |    Brain Lights   |    Bubble   |    Transporting   |    24" Robot   |    Misc.   |    Events

...... Belly and Chest Lights ......

Why bother to build a controller?

You can get an Arduino, fully assembled from China for about $4 with free postage, and wire your LEDs directly to that.

You don't even need to know how to write code - you can have mine for free - i lifted this sample code by Bill Earl from the Adafruit site and spent about 10min hacking it to suit a B9 Belly and Chest lights.

You can use a Nano, Uno, or Mega etc, here it's running on a Nano. The circuit on the left is just providing 5v power and the Nano is on the right.


LEDs typically require 20mA or less, with a voltage drop of say 1.8v (or more for white LEDs).
 So for 5 volt supply you could have:  
           V = IR               
   5 - 1.8 = 0.02 x R     
        3.2 = 0.02 x R     
           R = 3.2 / .02     
           R = 160 ohms  

Bigger resister will give less brightness.

Typical wiring diagram could look something like this:

If you only want random flashing lights, the position of the lights doesn't matter. But if you want to use the startup sequence, and/or have the chest lights at a different speed, then the Arduino pins should be wired up in the following order:


Once loaded the code will start operating as soon as power is supplied.

You can choose to start the flashing lights immediately, or have it cycle through the belly lights in a pattern before starting.

Since it needed 14 flashing lights i've used digital pins D2-D13 for the 12 belly lights and the analogue pins A0-A1 set as digital D14-D15 for the chest lights.

Here is the code, you are free to copy and modify it however you wish.

The sketch will look like this:

Note: You could use the same setup for the brain lights, using an Arduino Mega would give more than enough output pins.