Maker Pro
Maker Pro

Small RGB led cycle

solidshark91493

Mar 10, 2014
49
Joined
Mar 10, 2014
Messages
49
Hi, I signed up here just so I could ask this question and hopefully I can get some awesome info.
Im looking to make a small (SMALL) circuit for say.. 5 Common anode RGB led's.
It has to be very compact pcb wise. Because I need to fit it inside the base of a wood project im doing. But I need to be able to power it with batteries (aaa ? ) And all I want it to do is have two modes. Four led's light up and fade through all the colors, and with another button press the 5th one comes on and does the same by itself.
I think that should be easy enough, I have the rgb led's I just need a circuit.

Any idea? I dont want a micro processor. Just a little circuit.

Thanks!
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
It's kinda difficult to do all you want with a simple circuit. You could probably have it display random colours by using a combination of various low frequency oscillators to drive each colour.
 

kpatz

Feb 24, 2014
334
Joined
Feb 24, 2014
Messages
334
The best way is with a microcontroller. They are different than microprocessors as in they're self contained, very few supporting components are needed. For a basic one all you'd need is the chip, a power source, and (ideally) a decoupling capacitor across the power leads. Maybe a pull-up resistor for the button if the part doesn't provide one built-in. They contain built-in flash program storage and a small amount of data RAM.

Are the 5 LEDs going to display together (same colors at the same time) or are they independent? You mention the 5th one being separate but the other 4 will all be displaying the same colors/brightnesses at the same time? You'll need 6 MCU outputs (R,G,B for the first group and R,G,B for the 5th), one input for a button (you could use the reset pin for that), and then two power pins, V+ and ground. A 14-pin entry-level PIC would work well for this.

If you need each of the LEDs to be independently colored from one another, you'll need more outputs. For 5 RGB LEDs you'd need 15 outputs, or do a 3x5 multiplex with 8 outputs.
 

solidshark91493

Mar 10, 2014
49
Joined
Mar 10, 2014
Messages
49
I meant I dont want a micro controller, not processor. My bad, And something like this image is all I want.
Untitled.png


I cant afford a micro controller, So Im looking for a cheap small circuit with like a IC chip controlling it. Made on perfboard or something.

I just thought, All I need is a circuit to make the leds change color. I could put a three way switch on the anodes and switch which side on when I want. 1 way does the four lights, 2nd side does the 1 light, and middle does both?
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Are we talking about the same thing? A microcontroller (a bare chip) would set you back a couple of dollars.

The programming device would cost you another $5 and the software is free (I'm thinking arduino environment on a bare ATMega8.

If you went a clone Arduino Pro Mini, you could get one of them for under $10.

edit: I've just looked again and the bare chips seem to cost more than the Arduino Pro mini clones. Go the clone board (It's the size of a wide 28 pin chip (kinda))
 
Last edited:

solidshark91493

Mar 10, 2014
49
Joined
Mar 10, 2014
Messages
49
So what would I need then exactly.. I need to power the lights and I need to fit this device in a tiny space and I have a tight budget.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Define the "tiny space" and your budget.
 

kpatz

Feb 24, 2014
334
Joined
Feb 24, 2014
Messages
334
You could create three low-frequency triangle wave oscillators with a few transistors or op-amp ICs and set them to different frequencies so they ramp the colors up and down independently, but once you've done that you will have more parts on the board (and probably higher cost) than if you used a simple microcontroller. Also, at low frequencies the oscillators would need electrolytic capacitors which can take up some space on a tight board. And the frequency tolerance would be pretty loose so your color patterns may vary due to temperature, battery strength, etc.

You could get by with a 6 pin micro such as this one: http://www.mouser.com/ProductDetail...T-I-OT/?qs=sGAEpiMZZMvcAs5GUBtMdZFPb%2bXhvaGu
It's only 50 cents in single quantities. And in its surface-mount package it's tiny. If you are using perfboard, you'd need the 8 pin PDIP version.

It has 3 general purpose I/Os, a reset pin (which can be used for a button input), a power (Vdd) pin and ground. It would be ideal for your application.

If you want the micro to be able to switch between the 4 LED cluster and the single, you could use an 8 pin micro to gain 2 additional I/O pins to select the common cathode of the LED(s) you want to drive. Doing it that way a single button could toggle between the 4 LED cluster, the single LED, both, and off. The off mode could put the micro to sleep so it draws almost no power from the batteries, and it would wake up next time you hit the button to turn it on.

How bright do you need the LEDs to be? If you want to drive the 4 LED cluster at max brightness, you'll need to use transistors to power them since the micro's I/O pin can only source or sink 20-25 mA max. So plan on at least 3, and possibly 5 transistors (if you use the 8-pin part to control the common cathodes). You'll also need current limiting resistors for each LED color.

If you have a board etched and use SMT parts the circuit can be very small. That may be outside your budget, so if it is, perfboard would be necessary, which would make the circuit bigger.
 
Last edited:

solidshark91493

Mar 10, 2014
49
Joined
Mar 10, 2014
Messages
49
Define the "tiny space" and your budget.

A small wooden base maybe an inch or two thick. And like 6 inches by 4 inches. (not 100%)

And as cheap as possible.



You could create three low-frequency triangle wave oscillators with a few transistors or op-amp ICs and set them to different frequencies so they ramp the colors up and down independently, but once you've done that you will have more parts on the board (and probably higher cost) than if you used a simple microcontroller. Also, at low frequencies the oscillators would need electrolytic capacitors which can take up some space on a tight board. And the frequency tolerance would be pretty loose so your color patterns may vary due to temperature, battery strength, etc.

You could get by with a 6 pin micro such as this one: http://www.mouser.com/ProductDetail...T-I-OT/?qs=sGAEpiMZZMvcAs5GUBtMdZFPb%2bXhvaGu
It's only 50 cents in single quantities. And in its surface-mount package it's tiny. If you are using perfboard, you'd need the 8 pin PDIP version.

It has 3 general purpose I/Os, a reset pin (which can be used for a button input), a power (Vdd) pin and ground. It would be ideal for your application.

If you want the micro to be able to switch between the 4 LED cluster and the single, you could use an 8 pin micro to gain 2 additional I/O pins to select the common cathode of the LED(s) you want to drive. Doing it that way a single button could toggle between the 4 LED cluster, the single LED, both, and off. The off mode could put the micro to sleep so it draws almost no power from the batteries, and it would wake up next time you hit the button to turn it on.

How bright do you need the LEDs to be? If you want to drive the 4 LED cluster at max brightness, you'll need to use transistors to power them since the micro's I/O pin can only source or sink 20-25 mA max. So plan on at least 3, and possibly 5 transistors (if you use the 8-pin part to control the common cathodes). You'll also need current limiting resistors for each LED color.

If you have a board etched and use SMT parts the circuit can be very small. That may be outside your budget, so if it is, perfboard would be necessary, which would make the circuit bigger.

I dont need it to be MICRO, just small. And if I can find a decent cheap micro controller that I can get, then that might work. I want the lights to be bright. But I dont want to fry them.
I dont have etching solution or anything like that, I was gonna get a tiny perfboard or a pre etched board from radioshack.
I planned on wiring the lights into the stand, and have all the electronics and batteries in the base. And Im not a genius when it comes to circuits and electronic parts. So Id really need help wiring it up. as I dont really get wiring diagrams yet. .-.

Hope im not asking too much..

Heres the specs on the led's I have
Untitled-1.png
 
Last edited:

kpatz

Feb 24, 2014
334
Joined
Feb 24, 2014
Messages
334
6" x 4" x 1" thick is plenty of space for a small board and some AAA or AA batteries to power the thing. The circuit should fit a perfboard and be small enough to fit in your enclosure.

There are a couple "fading LEDs" circuits here: http://www.bowdenshobbycircuits.info/fade_led.htm

One uses a PIC micro and the other uses two op-amps (you'd need six total, or three dual op-amp ICs, or one quad and one dual for your three color LEDs, since you'd need to duplicate the circuit for each of the three colors). If you go the op-amp route, you can use slightly different resistor values in the feedback loop to give each color a slightly different cycle rate. Give each LED its own set of current limiting resistors, then tie the anodes together on the common ones and keep the anode separate on the 5th, and use switches to select which ones are on or not. If you go the op-amp route, I'd use at least a 6V power source (4 AAs), or a 9V battery (won't last as long).

Going the PIC route makes the circuit itself simpler, and allow more precise control over the colors/cycles, but you'd have to write (or find) code to program it. If you use 3 AAs you won't need a voltage regulator, since most PICs can run from ~2.5 - 5.5 volts. I'd drive each of the cathodes with an NPN transistor or N-channel MOSFET and wire the anodes with switches as above. Alternately, use PNPs on the anodes and use the PIC to control which LEDs are lit.
 
Last edited:

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Look up PICAXE. These are microcontrollers that have a bootloader so they can be programmed via a serial port on a PC (or USB to serial converter) and they are programmed in a BASIC like language. Good for beginners. The cost a little more, but do not require a programmer, which will set you back about $35 to $50. A PICAXE is a raw chip, you would have to put it on a protoboard or PCB.

Or, Arduino, which is a little more expensive but is already on a PCB. These are also programmed via a USB port, so they require no programmer at all.


Bob
 

solidshark91493

Mar 10, 2014
49
Joined
Mar 10, 2014
Messages
49
>.> Both of the previous answers are a bit too giberish for me xD
uhm. I cant afford 30+ dollars on it as I already have to purchase the rest of the supplies for the project itself.
And the thing is I dont understand diagrams, More of a "This goes here, that goes there, heres where you need to put them together" kind of thing.. Kinda like legos. xD
The pic? idea seems doable. I just need to figure out the resistors, amps, switches.. etc and throw it on perfboard. But a tiny microcontroller would be fine I just cant afford a expensive one.

I wish there were a easier way of understanding a circuit, like how to hook them up and stuff. And I have no idea how to code. :/ which makes this a very daunting project. Ive made a 4x4x4 led cube but i got a pre made code.
 
Last edited:

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
An analog circuit would be very complex, probably containing at least 10 chips.

A microcontroller can be had for < $1, but you need to have a programmer, and be able to program it.

A microntroller board (Arduino) will cost you about $20, and you still have to program it.

There is no easy solution for someone with your skills.

Bob
 

solidshark91493

Mar 10, 2014
49
Joined
Mar 10, 2014
Messages
49
An analog circuit would be very complex, probably containing at least 10 chips.

A microcontroller can be had for < $1, but you need to have a programmer, and be able to program it.

A microntroller board (Arduino) will cost you about $20, and you still have to program it.

There is no easy solution for someone with your skills.

Bob

Seemed a bit harsh. But ok, I have a arduino uno. I just dont want to use it as im giving this to someone. :|
I was thinking maybe one of these?
http://www.adafruit.com/products/1086#Learn
I would need some help coding it unfortunately. Doesnt seem like it would take a lot. Short code I would think. And to help me wire it up. (again, lego style :p )

25 bucks is a bit much but if its what I need then its what I need.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Cheap Arduino option: here.

You can probably program that with your UNO, so no need for another programmer, but if you like... here. (you need to wire that correctly to the device -- 6 wires, but it can burn bootloaders)

edit: the pro mini doesn't have the programmer built in, so it's cheaper and a little smaller. I believe the clones use resonators rather than crystals (to save a few cents) but I've not found that to be a problem
 
Last edited:

solidshark91493

Mar 10, 2014
49
Joined
Mar 10, 2014
Messages
49
Cheap Arduino option: here.

You can probably program that with your UNO, so no need for another programmer, but if you like... here. (you need to wire that correctly to the device -- 6 wires, but it can burn bootloaders)

edit: the pro mini doesn't have the programmer built in, so it's cheaper and a little smaller. I believe the clones use resonators rather than crystals (to save a few cents) but I've not found that to be a problem

Ok wait. what. :/ You lost me a little. Talk slow xD. Do I need this one? :| It would be cool to use it if I can. I dont need it to do anything super difficult I would think..
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Ok wait. what. :/ You lost me a little. Talk slow xD

Have you programmed your arduino uno before?

Have you written any programs from scratch?

Have you ever burnt a bootloader (you don't need to, just asking if you have)?

This device is pretty much the same as a uno, but it is programmed in a slightly different manner (look up USB ISP programming).
 

solidshark91493

Mar 10, 2014
49
Joined
Mar 10, 2014
Messages
49
I have programmed my uno by usb cable. No I havent learned how to make programs.
No I havent burnt a bootloader >.>
 
Top