| Electronics > Beginners |
| Controlling multiple LED lights from one switch |
| (1/2) > >> |
| Mac102004:
Newbie here, maybe this is simple but I've searched online and my head is spinning. I have 3 LED lights (12VDC work lights) that I want to be able to control with one, existing switch. I would like to use the existing switch as a trigger, then have it power on light A with first cycle of the switch, then lights A and B with second cycle, then lights A, B, and C with 3rd cycle. If this makes sense? I got the idea from a little flashlight I have pressing the button toggles through the 3 modes of the flashlight (high, low, strobe in that case). This application is on a small tractor however. I need what ever the solution is to be relatively compact, and robust. Am I dreaming here or is this possible to do? Thanks. |
| mariush:
The obvious answer would be a 8 pin microcontroller, 3 transistors and 3 small relays. The microcontroller waits and counts how many times you pushed button, and every 4th press it resets to nothing. Depending on value in memory, output some signal through 3 output pins, which turns on the transistor, which then turns on the relay closing connection and powering the light. A cheaper alternative (as in no programmer for the micro required, no programming etc) would be a basic slide switch along with a on/off switch for whole circuit (you default for at least one lamp turned on using the slide switch use 3 npn transistors and some resistors to limit current going through transistors... this way you don't push 20-50mA through the slide switch See tutorial on how to use a transistor to power something bigger like a relay (in the video it's a solenoid, basically same thing different shape) |
| Mac102004:
Thanks, I think I'll look into setting it up with a microcontroller, since this was my first thought also. |
| not1xor1:
--- Quote from: mariush on November 16, 2019, 01:35:00 am ---The obvious answer would be a 8 pin microcontroller, 3 transistors and 3 small relays. --- End quote --- relays for 12 VDC leds? Currently microcontrollers might be cheaper, but what about just a 4017 and a few 1N4148 diodes plus power mosfets? One might even use just BJTs or logic gates... |
| mariush:
My mind was going at latching relays, where you can simply send a pulse of energy for let's say 100ms to lock the relay to a position. You reset the relay by sending a pulse in the opposite direction. So 4 pins on a micro would be enough to turn on or off three lights just by setting one pin as input and one as output. Because microcontroller outputs typically are low current (ex 15..50mA per pin), it may make sense to use 3 small npn transistors instead of connecting the pins directly to the microcontroller. The idea is that you could have the microcontroller on a isolated box, powered by a CR2032 battery (or 2 AAA batteries or whatever) and the relays can be 12v (powered from the 12v input) , and the whole assembly can be easily removed from the car/bike/whatever - you only have the DC input and the 3 DC outputs to the lamps in the back of the box. Plain cheaper relays could be used, but those 3 npn transistors would then constantly suck maybe 1-2 mA of current in total from the battery, which would shorten battery lifetime. Yeah, you could use simple npn transistors or darlingtons but you'd have to keep pumping a bit of current in the transistors to keep them on, so that would waste battery if battery powered. Also, you'd get some voltage drop on the transistor, so heat will be produced. |
| Navigation |
| Message Index |
| Next page |