# Antiparallel LED Driving Circuit

So I've got a pretty simple circuit that doesn't seem to be behaving as expected. I am unfortunately on a computer with no schematic drawing software so I scrapped together a schematic in mspaint...

But yeah as I'm hoping you can tell, it is 2 anti-parallel LEDs being driving by 2 MOSFETs. When I connect that open wire to +5V, the NMOS should turn on and the PMOS should turn off. Turning off the PMOS should have the resistor on the right pulling one side of the LEDs to ground while having the NMOS turn on should pull the other towards +5V. Now, the LEDs have slightly different Vfs but I only wanted to use one voltage source so I made the resistors have different values. The NMOS I'm using is a fairchild 2N7000, and the PMOS I'm using is a BS250, not sure who makes it.

When I bring the Gates to +5V, for some reason neither of the LEDs turn on.

Any reason this circuit wouldn't work as I expected? Thanks

• online schematic editor & circuit simulator: circuitlab.com – spearson Apr 18 '12 at 1:04
• Odd, a red and an infrared LED in anti-parallel... – stevenvh Apr 18 '12 at 18:37
• It's not that odd. The part is designed for pulse oximetry applications in which red and IR LEDs are basically required. It has to do with the absorption spectrum of oxygenated and deoxygenated hemoglobin. – NickHalden Apr 18 '12 at 23:28

The problem is that you won't be able to turn on the NFET in your configuration. If your positive supply is 5V and your gate is 5V, then the NFET will always be in saturation. You need a large gate-source voltage for FETS to work like switches. Pulling the input of the FETs to 0V probably lights one of the LEDs, because the gate-source voltage of the PFET is 5V.

If these are two separate LEDs, then the easiest way to solve this is to separate the two circuits, and make one LED driven with the PFET, and the other LED driven with the NFET (see schematic below). This allows the best efficiency with the least number of parts.

This solution will work if you have separate LEDs:

If it is an anti-parallel diode, there are still a few options. If the device driving the pin can source and sink the current needed, then you could use the two FETs to act as the opposing side of an H-bridge, as shown below.

If you have an extra pin that can drive the current needed, you could just hook the LED with resistor across two pins, and this would probably give you the simplest board design.

If you're not hooked on the idea of using discrete FETs, then you could consider a dual inverter chip, which would be cheap and easy to use, such as this part.

If you need to drive both LEDs to the same current (e.g. 20mA) then you will probably need a H-bridge to give you the flexibility of adding separate load resistors for each diode.

A rule of thumb for MOSFETs is that when you want them to work like switches, you need to connect the source to ground (NFET) or VDD (PFET). Otherwise, the transistor will start to turn itself off as the source voltage rises.

• @clabacchio I thought I did... – W5VO Apr 18 '12 at 15:14
• I'll try to edit and you can roll back if you don't like it :) – clabacchio Apr 18 '12 at 15:22
• This works, but is a long way from the two LEDs in antiparallel... – stevenvh Apr 18 '12 at 16:22
• @stevenvh But there's a very good chance that it is in fact two LEDs, and not a two-terminal anti-parallel set of LEDs. – W5VO Apr 18 '12 at 18:21
• Actually there's a 0% chance xP – NickHalden Apr 18 '12 at 23:30

W5VO is right, the N-MOSFET doesn't turn on because $V_{GS}$ is too low; the gate may be at +5V, the source is nowhere near ground. Minimum changes will be to have P-MOSFETs both left and right, and drive one with the other's inverted drive signal. You'll need an extra MOSFET to invert the signal.

clabacchio's solution

is better, but like he says, has a bad static current through the resistors. If the LED voltage is 2V and M2 is on, the node R1/R2 will be at +2V. Current through R2 is then 2V/330$\Omega$ = 6mA. Current through R1 is 3V/330$\Omega$ = 9mA, so the LED current will only be 3mA, or half the current through R2. For higher LED voltages this gets even worse, and at a LED voltage of 2.5V there won't be any LED current at all.
Decreasing the resistors' values will increase the LED current, but the current through R2 will increase accordingly. This circuit will always have a low efficiency.

$\eta = \dfrac{(V_+ - 2 \cdot V_{LED}) \cdot V_{LED}}{(V_+ - V_{LED}) \cdot V_+}$

That's for LED voltages lower than $V_+$/2. For higher LED voltages the LED won't light at all and $\eta$ will be zero. For $V_+$ = 5V and $V_{LED}$ = 2V this gives

$\eta = \dfrac{(5V - 2 \cdot 2V) \cdot 2V}{(5V - 2V) \cdot 5V} = 13\% !$

This is near the 15% efficiency of OP's circuit.

The solution is to switch off the current through R2 when M2 is on, and that's what an H-bridge does. Replace R2 by another n-MOSFET, and R1 by a P-MOSFET, and place a resistor in series with the LEDs (they can share it, only one is needed).
Of course this will double the number of MOSFETs, and you'll need an extra one to create a complement driving voltage. But it's the only solution to avoid the current losses.

edit (after LED datasheet was added)
The LEDs have rather different forward voltages, so I would suggest to give each LED its own series resistor (not share it, like I first suggested).
Values: we'll ignore the voltage drop across the MOSFETs, so the 660nm will leave 5V - 1.8V = 3.2V for the resistor. At 20mA this gives 160$\Omega$.
Same for the 905nm LED (isn't that infrared???): 5V - 1.2V = 3.8V. At 20mA this gives 190$\Omega$.

• Ok so I'm going to have to use the H-bridge because I don't actually have separate LEDs. It's a chip with the two in anti-parallel as shown above. I added the datasheet for the LED chip, what resistors would you recommend... I was thinking they should be in about a 1:2.5 ratio. – NickHalden Apr 18 '12 at 18:23
• @JGord - calculation added to my answer. – stevenvh Apr 18 '12 at 18:34
• Depending upon VDD, one may be able to improve the efficiency of the above circuit by adding some extra diodes (light-emitting or not) in series with the resistors, and then reducing those resistors' values. For example, if one has a VDD of 5 volts, and the LEDs all have a forward drop of 1.7 volts and target current of 20mA, and one has some ordinary diodes with a drop of 0.7 volts, one could replace each 330ohm resistor with an LED and an ordinary diode in series with a 47ohm resistor. No waste current when an LED is on, and 2mA when off (float the control signal for that scenario). – supercat Apr 18 '12 at 19:20
• @supercat - If I understand you correctly you want to replace the resistor by a diode in series with a smaller resistor to reduce the current. That doesn't help. The total current and voltage drop will remain the same, and so will dissipated power. The loss in the resistor is rather high because of its low value. But that's required because when the other LED is on this resistor will have to make sure that there's enough current through that LED as well. – stevenvh Apr 19 '12 at 6:19
• Replacing a resistor with a series combination of resistor and diode will improve efficiency, particularly at higher VDD values, because when the LED pulling low, the voltage across the low-side network will be reduced relative to that across the high-side network. The current through a diode-resistor combination will vary much more with voltage than would the current through a resistor alone. – supercat Apr 19 '12 at 15:24

As W5WO pointed, a solution can be a circuit like this:

Vdd is 5V, not 1V :) And the editor lacks the model for the BS250

This circuit should work, though it will have a static current on the two resistors (you may consider bigger ones). One of those will be overwhelmed by the respective transistor if its $r_{DS}$ is low enough. But it's a sub-optimal solution.

Remember that nMOS work better for pulling down, while pMOS are better as pull-ups. This because you need always a threshold voltage between gate and source.

If you have separate LEDs, it's better to use separate circuits.