Lighting Lots of 1.2v Bulbs...or Bright LEDs

Hi All,

My Arduino UNO is on its way!

I am planning to build an advent calendar for my first project - I want it to automatically light the correct day.

I'm a software developer, so the code wont be a problem (Once aquainted with the syntax etc). What I'm not sure about is how to control the 25 bulbs required? i.e. There are 13 pins...how on earth would I wire this?

Looking for guidance rather than a solution. I want to ideally use 1.2v bulbs...or bright LEDs as they need to light a box for each day, which will be approx 10cm x 10cm

Any help will be much appreciated.

Thank you.

Hi, you probably need a shift register, as explained here:

http://arduino.cc/en/Tutorial/ShiftOut

There are 20 pins, but still not enough, 0-13 and the analog inputs A0-A5 can function the same as the digital pins as well.

Several choices here:

  1. Use shift registers to provide more outputs. 74HC595 shift registers have 8 outputs and can be cascaded, so four would be needed.

  2. Use a multiplexing chip like the MAX7219 or MAX7221.

  3. Multiplex the lamps directly with the Arduino.

(1) Will be the simplest code, but lots of wires, (3) Will be the least complicated electrically, but the code will be more difficult, (2) is somewhere in between.

FWIW, if it were me, my preference would be LEDs over 1.2V incandescent bulbs. Current drawn from Arduino pins should be limited to 20mA.

If you use LEDs, you may try Charlieplexing http://www.arduino.cc/playground/code/charlieplex With 6 Pins you can control 30 LEDs.

Since this is over a month and no high-speed is required...

  • Maybe a manual switch on the 15th?? or
  • A minimum-charlie-like-plex where there are two groups of 15 LEDs driven HIGH and each of the two groups can be separately driven LOW. If you're sure you'll only ever light one LED, you'd only need 1 resistor per group...

I would multiplex the lights in a 5 x 5 matrix (10 output pins). If you use LEDs then it's really easy, and if you keep the LED current to 35mA or less than you need no additional hardware except for 5 series resistors. The code will be very simple too because you are not trying to light more than one at a time.

Wow - Thanks for all the replies! I guess this quite an active community!

I'll look into all of those...thinking multipleks (Eks key not working! :) ) direct from Arduino at the moment, based on Jack's suggestion that this will be the least compleks eletronics wise, which is what I need for my first project...start gently!

Thanks again - Will try to post build photos etc.

Simon.

I would go with the shifter idea. If those light bulbs draw more than a few mas, it needs to be powered separately. I tend to think your light bulbs will draw over 100ma each.

The shifter idea is simple and flexible.

There are hybrids of the various suggestions as well, e.g. multiplex the LEDs as a 7x5 matrix, use a shift register for the 7 columns, and drive the rows via MCU pins.

Populate the entire 7x5 matrix, add a real time clock, and with a little extra code, the thing could be laid out like a calendar and work fine from year to year. Not sure if that’s the look you’re after though, and I’d probably explore simpler solutions first :smiley:

Merry Christmas! (Now that’s really rushing the season isn’t it!)

Hmmm...Having read last two posts, I'm now thinking shifter registers x 2

Found a great tutorial: http://bildr.org/2011/02/74hc595/

Impressed...I now know what a shift register does! 8)

I'm getting the SparkFun Inventors kit, which happens to come with a 74HC595, so I can at least get something running as a prototype (of a prototype!) before commencing the build.

Thanks again all...Excited and looking forward to getting started on this! :)

Just so you know, you can multiplex shift registers so that 2 hc595 can control 64 leds / bulbs (for that to work with the bulbs, you will need some additional hardware help).

smh_999: Hmmm...Having read last two posts, I'm now thinking shifter registers x 2

Found a great tutorial: http://bildr.org/2011/02/74hc595/

Impressed...I now know what a shift register does! 8)

I'm getting the SparkFun Inventors kit, which happens to come with a 74HC595, so I can at least get something running as a prototype (of a prototype!) before commencing the build.

Thanks again all...Excited and looking forward to getting started on this! :)

By all means experiment with using shift registers to educate yourself. However, I think using 74HC595 shift registers for this application is a silly idea. You will need three 74HC595s (assuming you drive the 25th LED direct from the Arduino, since three 8-bit shift registers gives you only 24 outputs), and they have a lower output current rating (25mA per output, 50mA for the whole package) than the Arduino pins (40mA per output, 200mA for the whole package). You will also need 25 series resistors instead of 5. The only advantage of using shift registers is that you can drive 24 LEDs (or more, if you use more then three shift registers) from 3 pins. But it does not sound to me that you are short of pins, so I suspect you can easily spare the 10 pins that a 5x5 matrix needs. Why use more components and wiring that necessary?

You will need three 74HC595s

How many shift registers you need will be a function of how you use them.

dc42 - Thanks, having looked at this again, I am thinking a 5x5 matrix would be the way to go.

My application is very similar to this: http://www.instructables.com/id/Yet-Another-Daft-Punk-Coffee-TableDisplay/

I'm thinking now I want the days to light up to the current day - So on 14th December, we have 14 LED's lit - But, given a max output of 200ma, thats 10 20ma LED's lit.

Can anyone advise how I might get past this problem? I would need a maximum of 500ma lit (25 20ma LEDs) so 500ma in total.

Please bear in mind I'm new Arduino & Electronics! :)

Hi, Modern LEDs are pretty bright at 5ma. Test a few...

If you want to light lots of LEDs at once, then shift registers might be a reasonable solution after all. With the 75HC595 you are limited to about 9mA per LED so as not to exceed the 70mA rating of the chip. If you want more current then that, look at TPIC6B595 shift registers instead.

For a 5x5 matrix, I'd use a MAX7219 if I didn't want to mess with writing the multiplexing code. Or, to have the Arduino do the multiplexing, five pins to drive the columns, via some small transistors or a ULN2003, and five to drive the rows direct, with an appropriate resistor in each row line.

Here’s the general idea if the LEDs are multiplexed by the Arduino directly. Only one column is turned on at a time. If using the MAX7219 or some such external multiplexer, the LED array is identical, the five rows and five columns would then connect directly to the multiplexer chip, and the resistors and transistors would be eliminated.

Hi All,

I've realised this is actually quite an involved project for an electronics newbie!

Wondering if anyone could offer me some electronics help...not specifically Ardunio.

I've got to the point where all I'm trying to do is light a single bulb using a 9v battery. This is working, although the light is very dim.

Heres what I did:

  • 9v (Battery) minus 1.25v (Bulb) = 7.75v
  • 0.25w (Bulb) = 250ma
  • 7.75v divided by 0.25a = 31ohms
  • I only had a 33ohm resistor, so 7.75/33 = 0.23a (230ma)

So - I attach the +9v of the battery to one terminal on the bulb holder, ground/negative to the other terminal, with a 33ohmn resistor (Orange/Orange/Black/Gold) in-line.

It just about lights up...in fact only seems to light up when I touch the terminals with my fingers...not sure how this is affecting it.

Worth mentioning I was following this: http://www.wd5gnr.com/basiccir.htm

Anyways...I accept this is not arduino related. Any help much apprecited!!

Thanks! Simon.

You've got the right idea. However, 230mA is a lot of current for an ordinary 9V battery to supply, so probably the battery voltage was dropping significantly below 9V. Ordinary LEDs need much less current than torch (flashlight) bulbs.