View previous topic :: View next topic |
Author |
Message |
pom
Joined: 25 Nov 2004 Posts: 30 Location: Germany
|
Dimension of voltage divider |
Posted: Mon Apr 30, 2007 7:32 am |
|
|
Hello guys,
I work with a PIC12F683 and try to measure a voltage. It's very important that the circuit needs low energy.
My problem: For the voltage divider I chose 220 ohm and 390 ohm. Unfortunately I cannot remember how to calculate the current with this constellation, but connecting the circuit to power supply there is a current of about 8 mA although none of the ICs is working.
So I think I have to re-dimension the voltage divider. This is very hard, because it is build of SMD 0805 and not that easy to solder. So I would like to ask you, which dimension is better for the divider? I have heard that it can get to big so that the PIC cannot measure any longer. What would you try?
Thank you for your help, Martina |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Apr 30, 2007 8:31 am |
|
|
Quote: | My problem: For the voltage divider I chose 220 ohm and 390 ohm. Unfortunately I cannot remember how to calculate the current with this constellation, but connecting the circuit to power supply there is a current of about 8 mA although none of the ICs is working. | I = V/R = 5V / (220 + 390 Ohm) = 8.2mA
Important is to keep the impedance below 10kOhm. If you are meassuring a voltage that is almost constant, like for example a power supply voltage, than you can cheat a bit and reduce power consumption a lot. Read this tip from SherpaDoug: http://www.ccsinfo.com/forum/viewtopic.php?t=30541 |
|
|
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
|
libor
Joined: 14 Dec 2004 Posts: 288 Location: Hungary
|
|
Posted: Mon Apr 30, 2007 8:51 am |
|
|
If you really want to have a very low current wasted (e.g. in battery powered applications) I suggest much higher R values at first. (be sure to count with the input impedance of the A/D converter, if you want to measure a slow moving signal (like battery voltage) you can use very high R values and add a capacitor to make it low impedance.
As a second option I suggest to connect the low side of the divider to one of the PIC's port and drive it low only during the measurement (some time before it of course), and leave it floating (driven high by the measured voltage) all other time. (some calibration is required because the PIC' pin will not drive the low side to absolute zero voltage) |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Mon Apr 30, 2007 9:15 am |
|
|
libor wrote: |
As a second option I suggest to connect the low side of the divider to one of the PIC's port and drive it low only during the measurement (some time before it of course), and leave it floating (driven high by the measured voltage) all other time. (some calibration is required because the PIC' pin will not drive the low side to absolute zero voltage) |
I would NOT recommend this without pointing out that the floating output will float to the voltage at the top of the divider. If the top voltage is greater then the PIC supply voltage this may cause problems. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
libor
Joined: 14 Dec 2004 Posts: 288 Location: Hungary
|
|
Posted: Mon Apr 30, 2007 10:09 am |
|
|
SherpaDoug wrote: | If the top voltage is greater then the PIC supply voltage this may cause problems. |
All ports have an internal clamping diode to GND and the supply rail. If you keep the current well below the limits it cannot cause problems.
Look at this Apllication Note: AN521 (I was also surprised to see that Microchip folks connect AC mains voltage right into a PIC's input pin thru a single series resistor) |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Mon Apr 30, 2007 10:27 am |
|
|
I love AN521. I have never used that technique in a salable product because I think other engineers doing a design review would have me committed to a rubber room...but I have used it in temporary fixtures.
For reasonable values the clamp diodes on the chip will provide protection. But on this BBS you can't be sure all the potential readers will the reasonable. Mr. pom was starting out with 220 & 390 ohm divider resistors which indicates to me that he is a novice. If he is using those resistors from a nominal 12V battery supply, at high battery voltage he could be dumping nearly 20mA into the clamp diode, which is the datasheet redline. I think that is just too close to trouble to be left floating about the internet for the unwary to read and copy. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
pom
Joined: 25 Nov 2004 Posts: 30 Location: Germany
|
|
Posted: Fri May 04, 2007 4:02 am |
|
|
Hello,
thanks for help. I just tried to use a divider of 390k and 220k in a temporary circuit. It was powered by a battery an seemed to work well. Unfortunately I couldn't change the voltage level and had to re-program the PIC several times to try how it reacts if battery voltage is above or below a fixed level.
So, it seems to be ok, but the battery powers the circuit nearly constant. What about an application with changing voltage level? In real I would like to measure the voltage level of a battery and of a solar cell. I guess it the solar cell changes voltage much quicker than a battery.
Can I take the suggestion of SherpaDoug of the other thread (link from ckielstra)? I hope that I will have the needed material tomorrow and can try it.
Best wishes, Martina (Ms. pom) |
|
|
|