CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Dimension of voltage divider

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
pom



Joined: 25 Nov 2004
Posts: 30
Location: Germany

View user's profile Send private message

Dimension of voltage divider
PostPosted: Mon Apr 30, 2007 7:32 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 30, 2007 8:31 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 30, 2007 8:34 am     Reply with quote

For the extremely lazy (like me...)

http://ourworld.compuserve.com/homepages/Bill_Bowden/r2.htm

John
libor



Joined: 14 Dec 2004
Posts: 288
Location: Hungary

View user's profile Send private message

PostPosted: Mon Apr 30, 2007 8:51 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 30, 2007 9:15 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 30, 2007 10:09 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 30, 2007 10:27 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri May 04, 2007 4:02 am     Reply with quote

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)
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group