walkman

Well Known Member
I want to use a transistor to switch an LED on and off that I'm dimming with a PWM dimmer.

I'll be using the +12v output of a toggle switch to drive the logic.

First question, will a regular PNP work or do or do I need a MOFSET or something.

I have 4 options total. Two regarding where the LED does, and two regarding where the PWM input vs logic switching input goes.

I'm using the LED's from MPJA with the dropping resistor built in. Does the LED (load) go on the collector or emitter side of the transistor?

Second, I can wire the +12v output side of the toggle switch to the base, and the PWM output to the collector, and use the toggle switch output to essentially switch the PWM output through. Or, I can wire the +12v toggle switch output to the collector, and the PWM output to the base. This option leaves the transistor "working" all the time, constantly switching the collector to emitter on and off with varying duty cycle based on dimmer position, except that most of the time the collector will be at 0.

Input solicited from those more electronic than I.

(Vern? :D)
 
I want to use a transistor to switch an LED on and off that I'm dimming with a PWM dimmer.

I'll be using the +12v output of a toggle switch to drive the logic.

First question, will a regular PNP work or do or do I need a MOFSET or something.

I have 4 options total. Two regarding where the LED does, and two regarding where the PWM input vs logic switching input goes.

I'm using the LED's from MPJA with the dropping resistor built in. Does the LED (load) go on the collector or emitter side of the transistor?

Second, I can wire the +12v output side of the toggle switch to the base, and the PWM output to the collector, and use the toggle switch output to essentially switch the PWM output through. Or, I can wire the +12v toggle switch output to the collector, and the PWM output to the base. This option leaves the transistor "working" all the time,t constantly switching the collector to emitter on and off with varying duty cycle based on dimmer position, except that most of the time the collector will be at 0.

Input solicited from those more electronic than I.

(Vern? :D)


You need two components: 5.6 KOhm resistor and a 2N4401 NPN transistor, or similar from the 'shack. Feed you switched 12V signal into one end of the resistor, connect the other end of the resistor to the transistor Base pin. Connect the transistor Emitter pin to ground and the Collector pin to your LED lamp assembly.

The LED lamp polarity is important. You want the cathode pointing towards the transistor and the anode (+) connected to the PWM dimmer. If it doesn't work, reverse the connection.

Most transistors have the pin sequence as EBC (emitter base collector) when you are looking at is face on with pins down.

You could also use a MakerPlane lamp controller (IL-4A or IL-6A) but that may be overkill. The schematic illustrates the technique described above. http://54.204.241.138/redmine/attachments/download/79/IL-4A_Schematic.pdf

Good luck.
 
Here are two easy methods. One uses pretty much any common NPN transistor, like a 2N2222A, 2N4401, whatever you have (as long as it will handle the LED current). The other uses a MOSFET -- I like the 2N7000; its gate is good for +/- 20V and it will handle around 200 mA max. You can use a series resistor on the gate, but it's optional and really only becomes useful in the event of the MOSFET blowing in some failure modes.

LED_Enable_Disable2.png

R1 & R3 represent the built-in resistors, or whatever current limiting resistor you choose to use with a discrete LED. R2 can be any value that will result in the transistor being saturated -- I like something in the 1K to 4.7K range, but 5.6K would probably be fine too. It's not rocket science, we're using the transistor as a switch.

R4 & R5 are optional. If you plan to switch either +12 or ground to the base/gate, you don't need it. If you plan to just switch +12 to turn the LED on or let it float, you'll want a pull-down resistor.

If you're just driving one LED, or more than one in series, your choice of transistors is almost limitless since the current will be in the 5-30 mA range.
 
Last edited:
Revisiting this topic as I'm going to breadboard it up this weekend if I have a chance.

This is for an annunciator panel. 6 LEDs for various things.

I want to clarify that I have one PWM (probably a 555 based device) and I will have one or up to 6 LEDs. I want them all at the same brightness and I don't want brightness to change as LEDs come on or off.

I'm concerned that having the PWM input to the LED "upstream" of the transistor will mean that as more LEDs come on, the brightness will change. I would have thought that using the signal from the PWM to switch the transistor, and the +12v coming from the input (or not) would prevent this.

Am I wrong?