I am trying to work with this LED module I have and I am having some trouble figuring out an alternative to using a diode.
The LED module requires 12V power to activate the RED leds, and 12V power to active the yellow LEDs. Obviously a GND wire is required.
There is also a wire to dim the LEDs. The dimmer wire needs 12V+ power as well.
On my project I would like a SPDT switch to control the bright/dim mode.
Right now I have my circuit as seen in the attached picture. Things like resistors are missing, but it gives you the general idea of how I am trying to operate the LED module.
The diode prevents the dimmer wire from being activated in "bright" mode (no reverse flow), but in dim mode, the voltage drop across the diode isn't ideal as the available voltage for red / yellow LEDs will drop.
I figure there is probably some way of using transistors as some kind of logic gate to achieve this, but I can't seem to come up with something. Any help would be appreciated! Thank you
You haven't provided a link to specs on that light...
But wouldn't it make sense to connect the lower (as drawn) contact of the switch to +12v directly and remove the diode entirely? So the switch is acting as SPST instead of SPDT, switching the dimmer wire?
Why would the DIMMER option be any different than the High Side driver issues you already solved with the the other 2 pins? You just wire the SWITCH the way you would have attached it to an arduino pin giving the gate pin 5 or GND.
In the online circuit builder it didn't have an accurate representation of the switch I am using. I should have been more clear. On Digikey it is a SPDT switch... but technically it is On-Off-On
Although it doesn't flash. It just has the four modes:
Red (Bright)
Red (Dim)
Amber (Bright)
Amber (Dim)
It is controlled as I described in the original post. 12V+ to each wire. This is why I am using P channel mosfets as a high side switch for the red / amber power.
pwillard:
Why would the DIMMER option be any different than the High Side driver issues you already solved with the the other 2 pins? You just wire the SWITCH the way you would have attached it to an arduino pin giving the gate pin 5 or GND.
I could do that but I am running out of I/Os on the Arduino. There are a bunch of other devices not pictured on the circuit (to cut down on cluttering the schematic). I thought maybe this would be something that could be switched without using up more I/Os.
Thanks Grumpy_Mike. I haven't used them before but I will look into it It would open up a lot of possibilities.
For the sake of the challenge though... does anything come to mind using transistors? I've been trying to figure out some combination to get this logic sorted out and now it's just bothering me that I can't figure it out.
doublec4:
The diode prevents the dimmer wire from being activated in "bright" mode (no reverse flow), but in dim mode, the voltage drop across the diode isn't ideal as the available voltage for red / yellow LEDs will drop.
Use a power schottky, you won't really notice a 0.4V drop!
Your MOSFETs are all wrong though. You seem to be trying to drive 12V high-side p-channel MOSFETs
direct from 5V logic, which cannot work. Level shifting is required for high-side switching unless the switched
circuit is also 5V like the Arduino.
MarkT:
Use a power schottky, you won't really notice a 0.4V drop!
Your MOSFETs are all wrong though. You seem to be trying to drive 12V high-side p-channel MOSFETs
direct from 5V logic, which cannot work. Level shifting is required for high-side switching unless the switched
circuit is also 5V like the Arduino.