Author Topic: Voltage Divider Not Behaving  (Read 5173 times)

0 Members and 1 Guest are viewing this topic.

Offline yanir

  • Regular Contributor
  • *
  • Posts: 216
  • Country: us
Voltage Divider Not Behaving
« on: September 27, 2011, 06:20:46 pm »
Hi, I'm am driving a 8x2 Character LCD with backlight using one of pic24 parts (pic24fv32ka). Everything works except for the backlight. When I power the backlight directly (it's just an 3V green led on the lcd board) it works. But when I try to power it from the microcontroller it doesn't. The voltage coming out of the pin is 3.24 (should be 3.3, not sure why it's 3.24) And I pass that pins output to a voltage divider (r1 = 10000K, r2 = 100000K). With 3.3V as input you should get 3.0V output from the divider. I get around 2.45V, which is too low to turn on the LED.  Even with a 3.24 input the output would be 2.94.

Why would I get such strange output from the divider?

Notes: The output pin on the micro is set for open drain.
My voltage regulator fixed at 3.3V.
I have powered it from a pickit3 and from it's normal power supply with the same results.

Any insight would be appreciated.

Yanir
 

Online ejeffrey

  • Super Contributor
  • ***
  • Posts: 2689
  • Country: us
Re: Voltage Divider Not Behaving
« Reply #1 on: September 27, 2011, 06:47:48 pm »
Voltage dividers only work when driving a high impedance load.  The LED draws current, dragging the voltage down.  Instead, you need a current limiting resistor.
 

alm

  • Guest
Re: Voltage Divider Not Behaving
« Reply #2 on: September 27, 2011, 06:54:55 pm »
Two issues: when using a voltage divider, the impedance of the divider should be much lower than the load impedance. This makes them impractical for low impedance loads, as ejeffrey writes.

The other issue is that you should keep the current constant for an LED, not the voltage. The forward voltage drop will vary with temperature and between samples of the LED, and due to the exponential relation between current and voltage, this will have huge effects on the current that will be flowing.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 16270
  • Country: gb
  • 0999
Re: Voltage Divider Not Behaving
« Reply #3 on: September 27, 2011, 07:03:08 pm »
I agree with all of the above. Another thing: the output impedance is equal to the equivalent of the two resistors in the divider connected in parallel.
 

Offline deephaven

  • Frequent Contributor
  • **
  • Posts: 792
  • Country: gb
  • Civilization is just one big bootstrap
    • Deephaven Ltd
Re: Voltage Divider Not Behaving
« Reply #4 on: September 27, 2011, 07:13:21 pm »
You don't need a voltage divider, just a series resistor to limit the current flowing through the LED. Something like 100 ohms would give you 10 mA. You commented on the output being not quite 3.3V, this is normal IC specs, you will never get exact voltages out of a micro. If you look at the specs in the data sheet it will show you what voltages to expect.
 

Offline yanir

  • Regular Contributor
  • *
  • Posts: 216
  • Country: us
Re: Voltage Divider Not Behaving
« Reply #5 on: September 27, 2011, 08:16:43 pm »
Thanks for all the quick responses. I am experimenting with the limiting resistor. I don't have any small value surface mount resistors here to replace the 10K. I already removed the 100K. It doesn't turn on with the 10K in place.
Without the resistor it drags the voltage down to 2.7 from 3.2 out of the micro. I also noticed that there is a 5 ohm resistor in series with the led on the lcd.

I do have a 510ohm, 487ohm, and a 1K in 0603 package. I might throw those on there to give it a try.

 

Offline yanir

  • Regular Contributor
  • *
  • Posts: 216
  • Country: us
Re: Voltage Divider Not Behaving
« Reply #6 on: September 27, 2011, 08:34:05 pm »
Update: I did have an 82Ohm resistor from a different project (only 2!) and It works. Thanks for your help.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 16270
  • Country: gb
  • 0999
Re: Voltage Divider Not Behaving
« Reply #7 on: September 27, 2011, 11:13:14 pm »
Is it bright enough though?

You may need to reduce the resistance.

If the green LED's forward voltage is 3V, the current will only be 3.66mA which won't produce much light.

What's the forward voltage specified on the datasheet?

You may have to reduce it to 33R or even 15R for full brightness.
 

Offline yanir

  • Regular Contributor
  • *
  • Posts: 216
  • Country: us
Voltage Divider Not Behaving
« Reply #8 on: September 28, 2011, 01:39:01 am »
It is a bit dim. The data sheet for the LCD doesn't state forward voltage. I'll email the manufacturer.

An area of confusion for me is the difference between resistance and impedance. It is my understanding impedance is resistance on an ac signal. Also, If the led is a low impedance device, why does it it drop the voltage at the point between the anode and the resistor?

Thanks in advance, this has always confused me.
 

Offline deephaven

  • Frequent Contributor
  • **
  • Posts: 792
  • Country: gb
  • Civilization is just one big bootstrap
    • Deephaven Ltd
Re: Voltage Divider Not Behaving
« Reply #9 on: September 28, 2011, 07:42:01 am »
At DC impedance and resistance is the same thing. At AC, the impedance is nominally the same as resistance for a resistor. Impedance gets more complicated at AC when you have inductance and/or capacitance involved becaus it now has 'complex' components to it.

The led is low impedance (or resistance) but it isn't zero, so when it starts to conduct it will exhibit a low but finite impedance. It will obey ohms low, i.e. V = I X R where V is the volt drop across the led, I is the current passing through it, and R is the effective impedance of the led in that state.
 

Online ejeffrey

  • Super Contributor
  • ***
  • Posts: 2689
  • Country: us
Re: Voltage Divider Not Behaving
« Reply #10 on: September 28, 2011, 09:16:33 am »
It is a bit dim. The data sheet for the LCD doesn't state forward voltage. I'll email the manufacturer.

No need, the forward voltage doesn't change much with current.  Measure it with your 82 ohm resistor in place, and use that.  The important thing from the data sheet is the operating current.  The resistor you want is then given by the formula: (3.3 V - Vf) / Io.

One thing: you say the output of your micro is set to open drain? Are you sure?  If so, you would normally connect the LED from 3.3V to the open drain pin, and then light the LED by pulling the output pin low.  That doesn't sound like what you are doing.
 

Offline yanir

  • Regular Contributor
  • *
  • Posts: 216
  • Country: us
Re: Voltage Divider Not Behaving
« Reply #11 on: September 28, 2011, 02:34:22 pm »
One thing: you say the output of your micro is set to open drain? Are you sure?  If so, you would normally connect the LED from 3.3V to the open drain pin, and then light the LED by pulling the output pin low.  That doesn't sound like what you are doing.

I have the micro pin connected to the resistor which is connected to the led. I set the pin high and low to turn the back light on and off. It was my understanding that open drain allows me to source the most current from the pin. Am I misusing the pin?

No need, the forward voltage doesn't change much with current.  Measure it with your 82 ohm resistor in place, and use that.  The important thing from the data sheet is the operating current.  The resistor you want is then given by the formula: (3.3 V - Vf) / Io.

So I measured 2.7V across the LED, giving me (3.3-2.7)/0.02A = 30 Ohm. I'll test that out. Thanks!
« Last Edit: September 28, 2011, 05:59:38 pm by yanir »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 16270
  • Country: gb
  • 0999
Re: Voltage Divider Not Behaving
« Reply #12 on: September 29, 2011, 04:39:44 pm »
You may be able to just omit the resistor as the internal resistance of the microcontroller's IO pin might be enough to limit the current through the LED. Look at the MCU data, if the IO pins voltage is 3V or less when the output current is 10mA you should be pretty safe.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf