Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Mosfet to ground or mosfet from +v?

Status
Not open for further replies.

bh00

New Member
Hi,

I'm trying to build a board for a little RGB lighting controller, specifically a 'Big Clive' one. However I think this works by supplying constant +V power to the LEDs and pulling their negative leads low via N channel mosfets to turn them on. However, I need to be able to source current to the LED's positive legs as I'm using some all-in-one LEDs which are common ground.

Can anyone tell me how I would change this around from the circuit he's posted on his site, and what changes would be needed to the circuit layout and parts list. I'm not sure quite if the controller pulls the output pins on it low to turn on the mosfets or if it puts them high - I haven't quite worked that out.

So if someone could explain to me how to turn it from pulling negative to turn on to providing positive to turn on, that would be great.

Thanks
 
Led

When a MOSFET is being used a switch, you can connect it in series to the LED across the positive end OR the negative end (in the same way it doesn't matter which side the switch is on for a light bulb. The only catch is that a MOSFET has certain voltage requirements to operate correctly.

ORIGINALLY:
+V-----LED-----(D)NMOS(S)---GND

WHAT YOU WANT:
+V-----(D)NMOS(S)-----LED---GND

(only source/drain terminals of MOSFET shown, the gate terminal on the transistor is now shown)

Unlike a normal mechanical switch where it will operate correctly no matter how you stick it into the circuit, the MOSFET to operate the way you want it to, it has certain voltage requirements.

1. Drain-source voltage has to be maintained above a certain level. You have to examine the circuit and make sure this is true. But this should not be a problem since (assuming it was working in the original circuit, the voltages across the source-drain are the same regardless of the order the components are flipped in).

2. The much bigger problem: The gate voltage turns the MOSFET on and off. The MOSFET turns on when the gate-source voltage exceeds a threshold. Notice, I said the gate-source voltage and not the gate voltage. The gate-source voltage was referenced to GND in the original circuit because the source was connected to ground. So it the gate was at 5V, the gate-source voltage would be at 5V. But the way you want it, the source voltage is no longer at ground, it might be at say, 1V. This means that if you apply 5V to the gate, the gate-source voltage will now be 5V-1V = 4V, which may not be enough to turn the MOSFET on.

Both points 1 and 2 may not be of consequence in your particular situation. If the voltage drop across the LED just happens to be very small, the source voltage might be close enough to GND to allow you to drive the gate through normal means (a driver referenced to GND, instead of a driver referenced to a floating voltage...it get's complicated here).

NOTE: THis may or may not work directly in the circuit on the website you are referring to, since I am not sure how the circuit is built.
 
Last edited:
Pmos

Forget actually using my first post. Treat it as a learning thing as to what problems might arise if you reversed the LED and MOSFET: simply reversing the LED and MOSFET would raise the required gate voltage to turn the transistor on beyond what you can supply.

Here is a drop-in solution for you that would work in your provided circuit:

Alternatively, you could just use PMOS transistor instead of an NMOS in the above way I just mentioned. PMOS transistors are more expensive, harder to find, and less efficient than NMOS, but your project is low current and low power so it may be best if the gate voltage required is too high to turn the MOSFET on.

You would drive the gate to GND to turn it on (opposite of the NMOS). ANd you would drive the gate to +V to turn it off. Just make sure that you can drive the voltage high enough to turn it off. It is basically the opposite of the NMOS (attach the source +V and the drain to the LED, flipped around from the NMOS version).

+V-----(S)PMOS(D)-----LED---GND

This is the exact opposite of the original circuit in case you didn't notice. +V and GND have been flipped around, and the MOSFET has changed from NMOS to PMOS to compensate. Since the PMOS is being used, the voltage requirements are still within the same (easy to supply) voltage range as the original NMOS circuit, except that the voltages to turn the MOSFET on and off are now the opposite of what they used to be.

This is probably easier to do since you can drop it directly into the schematic on the website...the one thing though is that the original controller pulls high/low to turn on/off, whereas now it will pull high/low to turn off/on. You can deal with that right?
 
Last edited:
OK That helps a bit I think.

So, if my V+ to the LEDs is 5v (I'm not sure if it counts as low power by the way, I want to run 20 LEDs off each channel probably, so I'm guessing thats about 400ma a channel. Would be nice to add more without worrying about loading though). I'm only going to run 5v because each LED will have its own resistor and if they're all in parallel then thats only 3.6v needed max. The microcontrollers output pins is going to be 5v or 0v. If I find the uC is outputting '0' to turn on the LED rather than a '1' then I might be able to just use some NOT gates. (I might try and contact the guy who made that circuit just to ask him)..

What type of MOSFETS would I need? Usual N-Channel? He suggests "VNP20N07, PIP3105, STP36NF06L" so will those do?

Thanks for your help - it's very useful!
 
NMOS means N-channel. PMOS means P-channel. Why bother with a NOT gate? Just tell your controller to turn an LED off when you want it on and vice versa.

(I was constantly editting my post so there might be new stuff in there after you posted your response. I also have a 2nd post above of a drop-in solution, I don't know if you got to that one before you posted.).
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top