Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Battery Tester with a PIC 16F818 Cicuit Question

Status
Not open for further replies.

dmarciano

New Member
I am starting to learn how to use the PIC16F818 and I would like to build a battery tester. I figured this would be a relatively easy project that I can use. Powering the PIC itself I understand. What I'm not sure will work is the A/D converter.

The batteries I have to test have 9V when fully charged (Measured with Multimeter). However, from what I understand, only a maximum voltage can be applied to any of the PIC pins. I was planning on hooking up the test points to a voltage divider so if a fully charged 9V battery is tested, only 4.5V are applied to the A/D converter of the PIC. Then I would compensate for this difference of 4.5 from the reference voltage of 5V from within the code Then depending on the actually voltage of the test battery certain LEDs would light up. Would this be viable way of doing this circuit?

I can attach a picture of the circuit I drew out if it would help. Any feedback would be appreciated.
 
dmarciano said:
I am starting to learn how to use the PIC16F818 and I would like to build a battery tester. I figured this would be a relatively easy project that I can use. Powering the PIC itself I understand. What I'm not sure will work is the A/D converter.

The batteries I have to test have 9V when fully charged (Measured with Multimeter). However, from what I understand, only a maximum voltage can be applied to any of the PIC pins. I was planning on hooking up the test points to a voltage divider so if a fully charged 9V battery is tested, only 4.5V are applied to the A/D converter of the PIC. Then I would compensate for this difference of 4.5 from the reference voltage of 5V from within the code Then depending on the actually voltage of the test battery certain LEDs would light up. Would this be viable way of doing this circuit?

I can attach a picture of the circuit I drew out if it would help. Any feedback would be appreciated.


That is exactly the correct way to do it. You scale the external voltage be be measured, to stay within the safe maximum electrical specification of the PIC. Then you use a factor in the program to account for that scaling factor, using simple math.

Good luck

Lefty
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top