I've been working on testing high side switching on an N channel mosfet, and for some reason I am getting the opposite results from what I expect.
Here is a video showing what it is doing:
https://youtu.be/KNvU-U5Ud_UHere is the schematic of what I put together.
I have pulled this apart and redone it multiple times, and I don't think I got it put together wrong. Can anyone see anything I did wrong?
It appears to be inverting properly. What were you expecting?
Note that, at startup, the NMOS is a follower, i.e. the gate charges up to about +12V, and the source follows about Vgs(th) below, maybe 9-10V. You won't see this visually (it's a tiny difference in LED brightness) but you can show it with a multimeter or scope. After pressing the switch (and waiting for the LED to fully charge the capacitor -- the first time it's cycled, this will take some milliseconds; not nearly long enough to see visually, but easily checked on the scope), it should saturate properly (source to 12V), until the cap charge leaks away (which could take seconds to hours, or even days with good components?).
If you wanted noninverting operation, try +5V to the 1k base resistor, and switch from base to GND (shunting base current)?
Tim
What I was looking for was to have it off until a 5V signal is applied to the base of the NPN, if that's what you mean by non-inverting. My assumption was that this circuit should pull the gate of the mosfet to a high enough level to keep the mosfet closed until the NPN is activated, pulling the gate to ground. Apparently I had that backwards.
Anyway, I tried what you suggested, and that somewhat works, at least in terms of making it normally off, but it is not ideal that it powers up the LED when the circuit is powered up. I do see it visually, and it lasts about a quarter of a second.
Is there some way to bootstrap an N channel mosfet that keeps that initial surge from hitting the LED, or at least makes it fast enough that the LED is not lit, or do I need to rethink using P channel mosfets, or some other method?
Thanks
I'm not sure I understand what you're trying to do. If you want the LED to turn on when you push the button, it seems the mosfet should be a P-channel, not an N-channel. You push the button, the NPN turns on, grounding the gate, which turns on the P-channel. The way you have it now, pressing the button grounds the gate, which turns off the N-channel, as shown in your video.
What do you want to happen when you release the button? Do you want the LED to stay on?
I want the light to turn on when the button is pressed. I have N channel mosfets here, but I have no P channel ones, which is why I was using them. I will have to use some different circuit if that delay can't be gotten rid of prior to shutting the light off though, so I guess I'll be buying some P channel mosfets.
I guess I still don't understand what you're trying to do. Is the LED the only thing you're driving with the mosfet, or is there additional circuitry that will be powered from it? And do you want the LED to stay on after the button is released? If so, how will you turn the power off?
I think N-channel mosfets work well as low-side switches. Perhaps you could switch the LED's cathode-to-ground connection. But then you might need a PNP bipolar to keep it on after the button is released.
Here's a circuit with low-side switching which is maintained ON by the processor's GPIO pin. But you would have the LED instead of the processor, so I don't know how you keep the power on.
Your bootstrap circuit looks very similar to this one (at 6:28):
https://youtu.be/zcQV_ZpK1W8?t=6m28sThe difference is that the load is a bulb instead of an LED+resistor.
As the video beginning at that point explains, the capacitor charges up through the load. When the load is an incandescent bulb you don't see it "turn on" during this charging phase. When the load is an LED, however, the charging current is very obvious as modern LEDs are very visible with only a few milliamps of current.
Maybe you can provide an alternate charging path for the capacitor at start up... perhaps another transistor between the top of the load and ground which is turned on only at power-up.
Ok, I understand what you're doing. Ledtester is right, and the video shows how it all works. I think all you have to do is change your original circuit to have the NPN base tied to 5V through a resistor, so the NPN will be normally on (and the mosfet normally off), and have the pushbutton switch just ground the base when you push it, which will turn on the mosfet.
And as Ledtester points out, the LED may glow a bit while the capacitor is charging up. It might be interesting to see how small a capacitor would still work.
The end circuit will be going into my 1969 thunderbird to repair the sequential turn signals, which are LEDs, so likely will go on instantly. Given that they are tail lights and I don't particularly want anyone behind me thinking I'm pressing the brakes every time I signal, a short flash when the circuit is powered up won't do, and I can't use them as a low side switch due to the chassis being ground.
Anyway, I've ordered some p channel mosfets, and they should do the trick.It will just be a little longer before I can drive the car again.
I've never used mosfets before other than in circuits others made, so this is a learning experience. I would normally use transistors, as I have hundreds of them, many suitable for switching. Ultimately though, I'm planning on converting this all to surface mount parts and making the board as small as possible so it can be hidden in the trunk. Because of that, I want to keep the heat to a minimum, which mosfets should work better than transistors at.
I hadn't seen that. Thanks. Valuable information for the future. Cougars unlimited is who sells the turn signal sequencer for about $140. If you look at the two they make you'll understand why I decided to make my own.