- Pull up resistor on the gate of a PMOS
- Posted by Tomás Ó hÉilidhe on May 11th, 2008
I have a tri-colour LED which consists internally of two LED's that
have a common cathode. The device has 3 pins (two anodes and one
cathode).
Using one microcontroller pin, I want to light the LED either red,
green or off. The microcontroller's pin states are intended to be as
follows:
High = Light Red
Low = Light Green
Set as input = Light Nothing
First thing I'll do is put a 200 ohm resistor on the cathode of the
device, and this resistor will lead directly to ground.
Taking the signal coming from the microcontroller pin, I'll split it
into two branches:
* The first branch will go directly to the Red anode.
* The second branch will go to the gate of a PMOS transistor. The
source of the PMOS will be connected to Vcc, and the drain will go to
the Green anode.
The idea is: When the microcontroller pin is high, the Green will
light on its own. When the microcontroller pin is low, the Red will
light on its own.
Now I think I'll have a problem when I set the micrcontroller pin to
high impedence, reason being that I don't know if the PMOS transistor
will be turned on. Assuming that the PMOS transistor *would* be turned
on, I could put a pull-up resistor on the gate of the PMOS transistor.
I would want this pull-up resistor to have as high a value as possible
because I don't want much current flowing from Vcc thru the pull-up
resistor into the Red anode. The problem though is that I don't want
the resistor value to be *too* high because then it might not do its
job of pulling up the voltage at the PMOS's gate.
So I have two questions:
1) What would be a suitable PMOS transistor to use? My Vcc is 5 V and
the current I want to pass is about 20 mA. (Also, I don't need one of
those 4-pin transistors because my source will always be connected to
Vcc).
2) Do I need a pull-up resistor, and if so what value should I choose
for it? Remember I'd like it as high as possible so that it allows
negligible current to flow into the Red anode.
I know it might sound like I'm just firing out questions and expecting
answers but the thing is I don't know how else to get these answers
other than by asking people who have experience.
My microcontroller is the PIC16F684. If you need to know the impedence
or whatever of the pins then let me know and I'll check the datasheet.
(By the way, my original design used a PNP bi-polar transistor instead
of a PMOS transistor, but the problem with this was that a non-
negligible current was flowing from Vcc, to the emitter, to the base
and into the Red anode, and thus the Red was lighting up dimly.)
- Posted by Arlet Ottens on May 11th, 2008
Tomás Ó hÉilidhe wrote:
The red LED will pull the voltage down to its forward voltage (check
value for Vf in the datasheet). This will probably turn on your p-FET.
- Posted by linnix on May 11th, 2008
You are using the wrong uC. You need our multi-level uC. The I/O
pins can be set to 1/4 VCC, 1/2 VCC or 3/4 VCC. An advanced version
can drive 1/8 VCC, 3/8 VCC, etc. They are less than $1 each, at high
enough volume.
- Posted by Jim Granville on May 11th, 2008
linnix wrote:
What drive level is that at ?
Sounds like an LCD driver, which would be slow into a
Power MOSFET gate Cap ?
-jg
- Posted by linnix on May 11th, 2008
On May 11, 1:55 pm, Jim Granville <no.s...@designtools.maps.co.nz>
wrote:
Depends on the customer's budget. We can go as high as 100mA if
necessary.
You don't need MOSFET, drive LEDs directly.
When there is a will (money), there is a way.
- Posted by Tomás Ó hÉilidhe on May 12th, 2008
On May 11, 5:57*pm, Arlet Ottens <usene...@c-scape.nl> wrote:
Could you please explain this to me? I've looked over my circuit and I
can't see any way in which the Red anode's voltage could turn on the
PMOS.
When current is flowing thru the Red LED, there'll be about 2 V across
the LED about 3 V across the 200 ohm resistor.
When current is flowing thru the Green LED, the 0 V from the uc will
turn on the PMOS which will allow 5 V onto the Green anode, and thus
there should be about 2 V across the LED and 3 V across the 200 ohm
resistor.
Do I misunderstand something?
- Posted by Arlet Ottens on May 12th, 2008
Tomás Ó hÉilidhe wrote:
If you turn off both LEDs, there will be a small current through the
pull-up resistor, the 200 Ohm resistor, and the red LED.
For example, if your pull-up resistor is 100k, the current will be about
3/100k = 30uA. The voltage drop across your 200 Ohm resistor is then
reduced to only 200R*30uA = 6mV, and your gate voltage approximately
equal to Vf = 2V. This may be sufficient to turn it on enough to make
the green LED light up.
- Posted by Jim Granville on May 12th, 2008
Tomás Ó hÉilidhe wrote:
Yes. How many states did you describe in your original operation,
and how many have you covered above ?
Cover all the states in your analysis, and you will see what Arlet
refers to.
-jg
- Posted by Tomás Ó hÉilidhe on May 12th, 2008
On May 12, 10:43*am, Arlet Ottens <usene...@c-scape.nl> wrote:
Oh I see now, thanks for that.
I think I've got two options in that scenario:
1) Decrease the value of the pull-up resistor so that less voltage is
dropped across it. The only problem with this though is that the Red
LED might light dimly at all times because of the increased current.
2) Choose a PMOS transistor that needs a very low gate voltage to turn
on.
How would you go about it?
- Posted by Arlet Ottens on May 12th, 2008
Tomás Ó hÉilidhe wrote:
Yes, any pull-up low enough to turn off the green LED will turn on the
red one.
This might work, but it still needs to turn on reliably, for a range of
devices and temperatures.
My 2 favourite solutions are a) pick a controller with more pins, or b)
use one or more 74HC595 devices to create additional outputs.
- Posted by Spehro Pefhany on May 12th, 2008
On Mon, 12 May 2008 21:59:16 +0200, Arlet Ottens <usenet+5@c-scape.nl>
wrote:
This solution works for LEDs that do not have a common:
http://electronicdesign.com/Articles...ArticleID=1683
This solution works for bipolar LEDs (two leads):
http://www.edn.com/contents/images/112201di.pdf
For your 3-lead LED with common cathode, there's a simple circuit
along the lines of the above that uses four parts (a dual optoisolator
and three resistors).
Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
speff@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
- Posted by Jim Granville on May 12th, 2008
Tomás Ó hÉilidhe wrote:
Do you mean higher gate threshold voltage ?
A high threshold PMOS part, would be turned on by the Port LOW, but
not (fully) turned on by a Red Led voltage above that.
Green LEDS commonly have higher Vf, so you could swap R/G here to
get more margin. (then, the Green Led Vf is trying to turn on the PMOS
driving the Red Led )
-jg