Author Topic: Controlling multiple LED lights from one switch  (Read 1046 times)

0 Members and 1 Guest are viewing this topic.

Offline Mac102004Topic starter

  • Newbie
  • Posts: 2
  • Country: ca
Controlling multiple LED lights from one switch
« on: November 15, 2019, 10:51:32 pm »
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.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5135
  • Country: ro
  • .
Re: Controlling multiple LED lights from one switch
« Reply #1 on: November 16, 2019, 01:35:00 am »
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)


« Last Edit: November 16, 2019, 01:43:11 am by mariush »
 

Offline Mac102004Topic starter

  • Newbie
  • Posts: 2
  • Country: ca
Re: Controlling multiple LED lights from one switch
« Reply #2 on: November 17, 2019, 01:35:44 am »
Thanks, I think I'll look into setting it up with a microcontroller, since this was my first thought also.
 

Offline not1xor1

  • Frequent Contributor
  • **
  • Posts: 716
  • Country: it
Re: Controlling multiple LED lights from one switch
« Reply #3 on: November 18, 2019, 06:39:10 am »
The obvious answer would be a 8 pin microcontroller, 3 transistors and 3 small relays.

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...
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5135
  • Country: ro
  • .
Re: Controlling multiple LED lights from one switch
« Reply #4 on: November 18, 2019, 10:57:51 am »
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. 
« Last Edit: November 18, 2019, 10:59:26 am by mariush »
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3322
  • Country: gb
Re: Controlling multiple LED lights from one switch
« Reply #5 on: November 18, 2019, 03:00:39 pm »
The obvious answer would be a 8 pin microcontroller, 3 transistors and 3 small relays.

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...

The could work, but by the time you add in the required switch debouncing circuitry a microcontroller is looking like a much simpler solution.
 

Offline not1xor1

  • Frequent Contributor
  • **
  • Posts: 716
  • Country: it
Re: Controlling multiple LED lights from one switch
« Reply #6 on: November 18, 2019, 06:18:17 pm »
The obvious answer would be a 8 pin microcontroller, 3 transistors and 3 small relays.

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...

The could work, but by the time you add in the required switch debouncing circuitry a microcontroller is looking like a much simpler solution.

well... the simplest solution would be to just use a step relay (Finder patented that 70 years ago)  ;D
long time ago my grand mother had a light fixture that cycled through off-1-2-3 lamps... just a relay
« Last Edit: November 18, 2019, 06:21:00 pm by not1xor1 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf