Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me with designing a 4 color LED circuit

Not open for further replies.


Newbie level 2
Aug 9, 2007
Reaction score
Trophy points
Activity points
Hello, I’ve never built anything in regards to electronics and really don't know the first thing about it, but I want something and am asking for some help.

I want to be able to push a button (the button needs to be at least 4 inches from circuit board) and then have 4 color LED lights to blink one right after the other in a circular motion very fast and after a couple of seconds of doing that I want it to RANDOMLY pick a light and for that light to stay shining. (Kind of like a roulette table?) I want it to stay lit up until I push the button again and then I want the process to repeat itself and I always want the light it stops on to be random.

And if that wasn't enough I need to be able to select which lights are used. I'm not going to need all 4 lights all the time so I'll need 4 little switches that I can turn on/off each corresponding to a different LED. So one time I can have all four LEDs in play and another time I have two LED's switched off so only two LED's will flash back and forth until one is randomly selected.

It's a lot I know, but can it be done? And would it be really difficult to do? Is their any such KIT that I can buy to do it or is there a site that explains how to build things like that you can point me to? I'm also not looking to spend a lot of money, this needs to be able to be done cheap. Would making something like this cost a lot? I'd appreciate any and all help with this, Thanks!

Re: Want something...

Many, many years ago doing this might have been a bit of a challenge. Not any more. Now you can do everything you want to do with a very cheap microcontroller.

Building the hardware is just a matter of connecting the LEDs and switches to some pins on the microcontroller (almost no thought required). The interesting bit is getting the hardware to perform the tricks you require. For that you'll need to write a program and you'll need some way of getting the program into the microcontroller. The former can be done with an assembler or compiler which is able to spit out machine code for your chip and the latter is done with a piece of hardware called a programmer. The development software is often free and a programmer can be very easy to make or very inexpensive to buy.

For this kind of application the choice of microcontroller is not really important. However, your choice will probably influence everything you do henceforth - choosing a microcontroller family is like choosing a religion! There are two types that are head-and-shoulders above the rest in popularity with hobbyists: Microchip's PIC and Atmel's AVR. Look for tutorials on the web. Right now's top hits for "PIC tutorial" and "AVR tutorial" are:

**broken link removed**

I don't know whether they are any good and I've no idea whether they will suit you, but there are plenty more where they came from ...

Starting out with microcontrollers can be a bit daunting, but if you stick with it you won't believe how many projects you'll be able to tackle with very little effort.

Have fun!


Re: Want something...

LOL I noticed your name David at the end, that's my dad's name and he's a smart guy too.

Thanks for the advice I'll look into those!

Added after 41 minutes:

Me again...
I was just wondering, how may LED's could you run on a triple A battery? Any ideas? Any idea how long the battery would last?


Re: Want something...

didibreakit said:
I was just wondering, how may LED's could you run on a triple A battery? Any ideas? Any idea how long the battery would last?
The simple answer is none! That's because a LED needs a certain minimum voltage before it will start to emit light and the required voltage is greater than the 1.5V produced by the AAA battery; you'll need at least a couple of batteries in series, but ...

Now a more complicated answer. You can use a circuit (called a DC-DC converter) that, when powered by the battery, produces an output at a higher voltage. About 3-4V would be enough to work with most LEDs (green, yellow and red at least). A DC-DC converter is not 100% efficient so some of the battery power is wasted in the voltage conversion process - let's say it's 80% efficient.

Now we have 80% of the battery capacity to power some LEDs. A fairly conservative guess for the initial capacity of an AAA battery is somewhere in the 1000 mAh range. Another way of putting that is to say the battery can supply 1000 milliamps for one hour. As a very conservative estimate, let's say a LED needs 10 mA to be bright enough. We can supply 800 mA for an hour (remember 20% of the capacity is lost in the converter) so we expect to supply 10 mA for 80 hours, that is the battery will last roughly 80 hours with one LED. Two LEDs would take 20 mA so the battery would last 40 hours in that case. You could power four LEDs (40 mA) for almost an entire day (20 hours) without replacing the battery.

By the way, battery capacity is not quite as simple as I've made it seem; if you left four 10 mA LEDs on continuously then you might get 20 hours of light, but if you only switched them on for a couple of hours per day you might get more than 20 hours light in total. Batteries tend to recover some of their capacity after a rest (the wonders of chemistry).

Modern LEDs are quite bright even when supplied with very little current so the figures I've just given really are on the conservative side. If your LEDs actually take 2 mA rather than the assumed 10 mA all you need to do is increase the estimated times by 5. Another way to get longer battery life is by flashing the LEDs using a repetitive on-off sequence with a low duty-cycle, i.e. a high peak current for a small amount of time and no current at all for the rest of the time. If the repetition is rate is high enough you would never know they were flashing.


P.S. Here's a little project for you - it demonstrates how to get 5V from a 1.5V battery:

**broken link removed**

Not open for further replies.

Part and Inventory Search

Welcome to