PDA

View Full Version : How i ken read 7.2v with pic



jetpr
- 22nd February 2006, 01:34
I need help to divider the 7.2v to read with pic ..

+ 7.2v -----------R2 = ?k
|
| R1= ?k
---
-
Some Help or Idea
Thanks all for the Help..

Darrel Taylor
- 22nd February 2006, 09:27
This might help.

http://www.picbasic.co.uk/forum/showthread.php?t=541
<br>

Darrel Taylor
- 22nd February 2006, 10:59
<table><tr><td valign=top>That thread shows how to calculate the voltage once you know the resistor values. But, as I read the question again, apparently you are looking for the resistor values themselves.

First, determine the Maximum voltage that you will need to read. If you want to read 7.2 volts, then you should be prepared to read higher than that. Let's say 7.5 is the max (up to you though).

Vin = 7.5 <-- max Input to voltage divider
Vout = 5 <-- max Output voltage to pic

Using your best educated guess, choose a value for R1. Say, 2700 ohms.

R2 = R1/(1-(Vout/Vin))-R1
R2 = 2700/(1-(5/7.5))-2700
R2 = 5400 ohms

Use the closest Standard Value 5.6K

Then to do the reverse, just plug those resistor values into the formulas in the other thread.
http://www.picbasic.co.uk/forum/showthread.php?t=541</td><td valign=middle>http://www.darreltaylor.com/files/VoltageDividerNoVal.GIF</td></tr></table>
HTH,
&nbsp; Darrel

Melanie
- 22nd February 2006, 11:31
Actually, I'd like to add a little here... sure use the formulas as given, but for a PIC input I like to ensure that R2 is at least 10K (optimal for an ADC)... or even higher, otherwise the current flow through the Resistor chain is excessive, especially important if you are going to use it as a Battery Low indicator.

Darrel Taylor
- 22nd February 2006, 22:24
Interesting,

I was purposely trying to keep it Under 10K to stay within the "maximum recommended impedance for analog sources".

I can see the advantage with a battery application, but would you also need to increase ADC_SAMPLEUS?
Or is it OK as long as R1 stays below 10K?
<br>

NavMicroSystems
- 22nd February 2006, 22:49
Darrel,

I use this concept in many of my designs, and with "R1" being equal or below 10k I have never seen any problem at all.

Melanie
- 22nd February 2006, 23:06
For most PICs the recommended maximum input impedance is 10K... although it does vary (example 12F675 it's 2.5K). I've actually used the 12F675 with the same 10K input circuitry I use with a 16F876 and the same default 50uS settling time without problems. I don't use ADCIN but prefer to set and poll the GO/DONE bit for a completed conversion. Like with all things, it's a case of try it and see, and if it works for you - use it. For Battery-Low applications with Comparator Inputs, I've had 470K/220K R1/R2 combinations before now just to keep the current down.

Darrel Taylor
- 23rd February 2006, 00:30
Great, thanks you two!

Well, I've learned my 1 thing for today. I guess I can take the rest of the day off.

But before I do that, let's see if we can finish off jetpr's question.

Assuming now that R1 can always be 10K (or 2.5K), we can forget about the guessing part and just calculate R2 with the same formula.

Vin = 7.5 <-- max Input to voltage divider
Vout = 5 <-- max Output voltage to pic
R1 = 10000

R2 = R1/(1-(Vout/Vin))-R1
R2 = 10000/(1-(5/7.5))-10000
R2 = 20000 ohms

Hmmm, Nice round numbers too. :)

<br>

serandre
- 29th May 2006, 00:09
Hi,

I need to read a car battery, it ranges from 10v to 14.8v. In my circuit i have used a zener 10v to drop the voltage to 0-4.8v.

Should i modify it to use voltage divider (10K/5K) instead ?

Sorry eletronic is just a hobby to me, just learning :-)

mister_e
- 29th May 2006, 13:50
You should use the voltage divider with simple resistor... also add a 10-100nF at the PIC a/d input to smooth the results. It's amazing how much noise you can remove. Also, doing multiple reading then average them to avoid odd results it's just a better practice in, at least, car application.

Acetronics2
- 18th June 2006, 09:44
Hi,

I need to read a car battery, ...i have used a zener 10v to drop the voltage to 0-4.8v.

Should i modify it to use voltage divider (10K/5K) instead ?

Sorry eletronic is just a hobby to me, just learning :-)

Hi, Serandre

Your Zener idea is not so bad ... but zener voltage is not stable with temp .!!! so, your measurement will be somewhat false ( in a car temp is not so constant ...).

There would be a simple solution : use a cheap TL431 trimmable "zener" instead of the diode. see TL431 datasheet for that.

http://pdf1.alldatasheet.com/datasheet-pdf/view/5774/MOTOROLA/TL431.html

Alain