Hi,
I'm trying to use an Adafruit M0 Proto board to dim an LED that I only have access to the 12V wire.
I'm using the circuit found in this thread PWM LEDs on high side in RV--need help! - #9 by stansrs
It works as expected with 5V driving the circuit but with 12V the LED is on high all the time.
If it matters I'm using a 2N2222 for the transistor and IFR4905 for the P-Channel MOSFET.
Any help would be appreciated, thanks!
Do you mean IRF4905?
"Driving"?
What's the voltage at G when it's supposed to be On and when it's supposed to be Off ?
We should really have a complete schematic of what you actually have, not a borrowed one.
It's not clear whether "It works as expected with 5V driving the circuit but with 12V" means the logic drive or power supply.
Sorry, yes I meant IRF4905.
The gate pin is 0V when off and 5V when on both for a 12V and 5V power supply.
I'll draw a circuit diagram for this, I was thinking I literally built the circuit based off this but I do have quite a few differences and obviously am misunderstanding part of this.
The 2N2222 base is connected to pin 10 through a 1k ohm resistor on a Feather M0 so 3.3V instead of 5V PWM output.
The load is a yellow LED with a 500 ohm variable resistor set to 500 ohms. The yellow LED is just for testing, this will be used to dim a 12V LED in a car.
Thanks for the help!
Your voltage results are not correct. Please remeasure them using the Source for the gate voltage reference. If it is 0 you should be off. If it is -5 to -12 it should be on. Check if you actually have the MOSFET the schematic shows. Please post a complete schematic with links to technical information on the hardware items.
As requested, your circuit drawn up and posted here.
Include whatever power supplies.......i.e. complete circuit
Sorry for the delay, finally got around to drawing the circuit diagram for this.
I'm using the following code in my arduino sketch
analogWrite(led_pin, 255);
delay(5000);
analogWrite(led_pin, 0);
delay(5000);
I'm using a power supply for a hard drive that has a 5V and 12V available. Using 5V for Vcc the LED flashes on and off. Using 12V for VCC the LED is on all the time.
Measurements with 5V LED on / off
2N2222
Collector: 0V / 5V
Base: 2.1V / 0V
IRF4905
Gate: 0V / 5V
Drain: 5V / 0V
Source: 5V
Measurements with 12V LED on / off
2N2222
Collector: 0V / 5V
Base: 2.1V / 0V
IRF4905
Gate: 0V / 5V
Drain: 5V / 0V
Source: 5V
I'm not understanding why the collector is reading 5V when using 12V for Vcc but I guess that's the cause.
Nothing wrong with the schematic. Perhaps you have the NPN transistor wired incorrectly.
If the above is true, the transistor is blown.
First things first, triple check that you have the transistor leads correctly identified.
Thank you LarryD and jremington!
I was using this datasheet for the transistor https://www.onsemi.com/pdf/datasheet/p2n2222a-d.pdf
Based on what you said I checked this datasheet https://cdn-shop.adafruit.com/datasheets/PN2222A.pdf and found the pinout is different.
Swapped the transistor around and it works!
If you don't mind could you explain why it would work on 5V but not 12V with the transistor reversed?
All bets are off when things are not connected properly.
The TO-92 package pinouts for both the transistors you linked to have the emitter and collector reversed. A transistor can operate this way, but not nearly properly. It exhibits a small forward gain, alpha which is near unity, as opposed to the forward gain beta exhibited in the normal configuration. It probably worked in your 5V configuration because your resistor values allowed it to just barely satisfy the Q1 drive by those means.
Likely, the reason it didn't work at 12V, is because of the larger reverse EB bias, which exceeded the reverse breakdown voltage of the EB junction, which is normally quite low.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.


