EmbeddedRelated.com
Forums

Pull up resistor on the gate of a PMOS

Started by Unknown May 11, 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.)
Tom�s � h�ilidhe wrote:

> 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. >
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.
> My microcontroller is the PIC16F684.
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.
linnix wrote:

>>My microcontroller is the PIC16F684. > > > 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.
What drive level is that at ? Sounds like an LCD driver, which would be slow into a Power MOSFET gate Cap ? -jg
On May 11, 1:55 pm, Jim Granville <no.s...@designtools.maps.co.nz>
wrote:
> linnix wrote: > >>My microcontroller is the PIC16F684. > > > 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. > > What drive level is that at ?
Depends on the customer's budget. We can go as high as 100mA if necessary.
> Sounds like an LCD driver, which would be slow into a > Power MOSFET gate Cap ?
You don't need MOSFET, drive LEDs directly. When there is a will (money), there is a way.
> > -jg
On May 11, 5:57=A0pm, Arlet Ottens <usene...@c-scape.nl> wrote:

> > 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. > > 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
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?
Tom&#4294967295;s &#4294967295; h&#4294967295;ilidhe wrote:
> On May 11, 5:57 pm, Arlet Ottens <usene...@c-scape.nl> wrote: > >>> 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. >> 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 > > > 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.
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.
Tom&#4294967295;s &#4294967295; h&#4294967295;ilidhe wrote:
> On May 11, 5:57 pm, Arlet Ottens <usene...@c-scape.nl> wrote: > > >>>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. >> >>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 > > > > 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?
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
On May 12, 10:43=A0am, Arlet Ottens <usene...@c-scape.nl> 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 =3D 30uA. The voltage drop across your 200 Ohm resistor is then > reduced to only 200R*30uA =3D 6mV, and your gate voltage approximately > equal to Vf =3D 2V. This may be sufficient to turn it on enough to make > the green LED light up.
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?
Tom&#4294967295;s &#4294967295; h&#4294967295;ilidhe wrote:
> On May 12, 10:43 am, Arlet Ottens <usene...@c-scape.nl> 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. > > > 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.
Yes, any pull-up low enough to turn off the green LED will turn on the red one.
> 2) Choose a PMOS transistor that needs a very low gate voltage to turn > on.
This might work, but it still needs to turn on reliably, for a range of devices and temperatures.
> How would you go about it?
My 2 favourite solutions are a) pick a controller with more pins, or b) use one or more 74HC595 devices to create additional outputs.