LED Control Circuit

DIYLite

Newly Enlightened
Joined
Aug 1, 2004
Messages
70
Hi All,

How is possible that a D.I.Y. 3*LED flashlight can use a circuitry able to select between 1, 2 or all 3 LEDs to be lit-up by press a single switch button? Is there such a circuit diagram available online? /ubbthreads/images/graemlins/confused.gif

Thanks!
 

billw

Enlightened
Joined
Nov 2, 2002
Messages
295
Location
SF Bay Area
Sure. A small microcontroller can do that with no problem.
Schematics with small microcontrollers are pretty boring.
Power, bypass cap, pushbutton, pullup resistor, three current limitting resistors and three leds...

Something like a Color Kinetics Sauce, only with three
white LEDs instead of the different colors.
 

djpark

Enlightened
Joined
Nov 5, 2003
Messages
445
Location
SJ, Malaysia
[ QUOTE ]
DIYLite said:
Hi All,

How is possible that a D.I.Y. 3*LED flashlight can use a circuitry able to select between 1, 2 or all 3 LEDs to be lit-up by press a single switch button? Is there such a circuit diagram available online? /ubbthreads/images/graemlins/confused.gif

Thanks!

[/ QUOTE ]

I have on eright here in CPF.

pager-light-circuit.jpg


This is what I did for H&M Contest 2004 Class4 and it runs with a PIC.

Many AVR experts here provably would have better ideas, but I use PIC because that's what I have. As long as you have the control over the program, what you can do is limited by just your imagination only. (Well, almost, there are many limitations!)

But you will need to decide what you want and how you want -- led type, brightness, color, host, power supply and so forth.

For example, turning on 1, 2 or 3 leds to control the brightness is heritage from a mechanical switch. It would be better to control the brightness with PWM. Instead you may want to have 2 different color led sets to toggle between in addition to the brightness control.

If you just want to control a small light with less than 100mA current, a PIC can handle with direct digital output upto 100mA with each pin sourcing 20-25mA. If you want to control higher current, you can add an FET to do that.

If you want current regulation, you can add a transistor to the FET circuit as UK Owl did, or you can use a LDO regulator as Doug_S did.

Now you see, there are really too many options to choose from.

If you state what you are trying to do, I can supply a pre-programmed PIC for you -- PIC12F675, 8pin 150mm SOIC size.

-- dj
 

DIYLite

Newly Enlightened
Joined
Aug 1, 2004
Messages
70
Wow nice re-born pager light! /ubbthreads/images/graemlins/buttrock.gif
I should have dig for more previous "treasure" postings buried in the forum!
OK, I come about the idea after I have bought my dad a handy LED flashlight. He told me how useful is my small gift to his shipyard job and I also start to learn more about his working environment at night. Then I started to imagine a LED flashlight that can do more than just 1 simple output-level (can be "glaring" bright at times). As a simple newbie here I thought of making a 3-5 LEDs flashlight able to select/lit-up +1 LED after every push-button selection... But after seen yours, I think your creation is much ideal & DIY should be fun, I will like to learn more on that!

100mA on each 5mm LED won't cook it??? /ubbthreads/images/graemlins/confused.gif how long can they last under such high current?
How can I get more details of your circuit?

/ubbthreads/images/graemlins/thanks.gif
THANKS!

PS:
Maybe I will be going to KL-city sometime in late Oct'04, not sure whether can I get to meet u then?
 

djpark

Enlightened
Joined
Nov 5, 2003
Messages
445
Location
SJ, Malaysia
These leds from ISP are designed to run at 100mA and if heat dissipation is better (such as 8mm size) it can go to 150mA, but I used to drive it to 180mA.

The circuit is very simple, use digital output as PWM source to drive FET to switch on and off the led. All you need is to get a light host with a bit of space to put an FET and a small PIC in it. The important thing is the software in the PIC.

Are you from MY or neighbouring country? If so, you may want to check out MY-CPF.

-- dj
 

DIYLite

Newly Enlightened
Joined
Aug 1, 2004
Messages
70
Tried to visit your link, but...

Sorry, an error occurred. If you are unsure on how to use a feature, or don't know why you got this error message, try looking through the help files for more information.

The error returned was:
You do not have permission to view this board

I m from down south of MY --> SG
Cheers! :)
 

UK Owl

Enlightened
Joined
Feb 15, 2003
Messages
250
Location
Wales, UK
You could do this with a 5400 / 7400 (TTL) or 4000 (CMOS) series logic chip counter and line driver, but your circuit would be quite large and cumbersome and 'off state' current could run into a couple of milli-amps, your best bet would be with a PIC.

You will probably get better results by varying the current to three LED's connected in parallel, as efficiency of LED's can drop as current is increased.

e.g. connect 3 LED's in parallel.

connect this in series with a FET and a feedback resistor e.g. 1 ohm.

use a D-A output on the PIC to drive the gate of the FET and and an A-D input on the PIC to measure the voltage across the feedback resistor (i.e LED current).

The program in the PIC would need to operate as such...

a) one press set an internal counter value for low beam

b) next press set counter value for mid level beam etc..

c) increment D-A output each processor cycle until feedback measured reaches internal counter value (decrease if counter value exceeded).

d) if the internal counter reaches a set value (i.e. FET is turned on fully) and no increase in current is measured - drive a second output that drives a 'LOW Battery' warning.


Hope this is of help, and sorry but I am not able to produce the Hex code needed for the PIC, but if you ask nicely I am sure one of the members here would be able to help you out.
 
Top