Controlling multiple LED lights from one switch - Page 1
Forum section: electronics / beginners

author: Mac102004
author_rank: Newbie
timestamp: November 15, 2019, 10:51:32 pm
content: 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.

author: mariush
author_rank: Super Contributor
timestamp: November 16, 2019, 01:35:00 am
content: 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 switchuse 3 npn transistors and some resistors to limit current going through transistors... this way you don't push 20-50mA through the slide switchSee 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)

author: Mac102004
author_rank: Newbie
timestamp: November 17, 2019, 01:35:44 am
content: Thanks, I think I'll look into setting it up with a microcontroller, since this was my first thought also.

author: not1xor1
author_rank: Frequent Contributor
timestamp: November 18, 2019, 06:39:10 am
content: Quote from: mariush on November 16, 2019, 01:35:00 amrelays 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...

author: mariush
author_rank: Super Contributor
timestamp: November 18, 2019, 10:57:51 am
content: 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.

author: mikerj
author_rank: Super Contributor
timestamp: November 18, 2019, 03:00:39 pm
content: Quote from: not1xor1 on November 18, 2019, 06:39:10 amThe could work, but by the time you add in the required switch debouncing circuitry a microcontroller is looking like a much simpler solution.

author: not1xor1
author_rank: Frequent Contributor
timestamp: November 18, 2019, 06:18:17 pm
content: Quote from: mikerj on November 18, 2019, 03:00:39 pmwell... the simplest solution would be to just use a step relay (Finder patented that 70 years ago)long time ago my grand mother had a light fixture that cycled through off-1-2-3 lamps... just a relay