4
\$\begingroup\$

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...

enter image description here

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

EDIT LED Datasheet: http://www.advancedphotonix.com/ap_products/pdfs/PDI-E832.pdf

\$\endgroup\$
  • 3
    \$\begingroup\$ online schematic editor & circuit simulator: circuitlab.com \$\endgroup\$ – spearson Apr 18 '12 at 1:04
  • \$\begingroup\$ Odd, a red and an infrared LED in anti-parallel... \$\endgroup\$ – stevenvh Apr 18 '12 at 18:37
  • \$\begingroup\$ 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. \$\endgroup\$ – NickHalden Apr 18 '12 at 23:28
7
\$\begingroup\$

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:

enter image description here

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.

enter image description here

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.

enter image description here

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.

enter image description here

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.

\$\endgroup\$
  • \$\begingroup\$ @clabacchio I thought I did... \$\endgroup\$ – W5VO Apr 18 '12 at 15:14
  • \$\begingroup\$ I'll try to edit and you can roll back if you don't like it :) \$\endgroup\$ – clabacchio Apr 18 '12 at 15:22
  • \$\begingroup\$ This works, but is a long way from the two LEDs in antiparallel... \$\endgroup\$ – stevenvh Apr 18 '12 at 16:22
  • \$\begingroup\$ @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. \$\endgroup\$ – W5VO Apr 18 '12 at 18:21
  • \$\begingroup\$ Actually there's a 0% chance xP \$\endgroup\$ – NickHalden Apr 18 '12 at 23:30
3
\$\begingroup\$

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

enter image description here

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\$.

\$\endgroup\$
  • \$\begingroup\$ 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. \$\endgroup\$ – NickHalden Apr 18 '12 at 18:23
  • \$\begingroup\$ @JGord - calculation added to my answer. \$\endgroup\$ – stevenvh Apr 18 '12 at 18:34
  • \$\begingroup\$ 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). \$\endgroup\$ – supercat Apr 18 '12 at 19:20
  • \$\begingroup\$ @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. \$\endgroup\$ – stevenvh Apr 19 '12 at 6:19
  • \$\begingroup\$ 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. \$\endgroup\$ – supercat Apr 19 '12 at 15:24
2
\$\begingroup\$

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

enter image description here

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.

\$\endgroup\$
  • \$\begingroup\$ Are you sure about this ... ? \$\endgroup\$ – MikeJ-UK Apr 18 '12 at 8:49
  • \$\begingroup\$ @MikeJ-UK right...wait... \$\endgroup\$ – clabacchio Apr 18 '12 at 8:59
  • \$\begingroup\$ @stevenvh yes, it was because I wanted to discard the circuit, but I settled for this solution; though, it has static current through the resistors. \$\endgroup\$ – clabacchio Apr 18 '12 at 9:12
  • \$\begingroup\$ That's better :) \$\endgroup\$ – MikeJ-UK Apr 18 '12 at 9:22
  • \$\begingroup\$ The static current is indeed bad. If M2 is on and your LEDs are 2V you'll have 6mA through R2, and only 3mA through the LED. If your LEDs are 2.5V they won't see any current at all! \$\endgroup\$ – stevenvh Apr 18 '12 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.