Go Down

Topic: Voltage Divider (Read 4269 times)previous topic - next topic

SagarDev

#15
Sep 14, 2015, 04:48 pm
Shakespeare's pen is an Electronics Engineer's Soldering Iron...

aarg

#16
Sep 15, 2015, 01:15 pm
For a simple battery go/nogo battery tester, it will work. But rather than measuring current, it will just draw a nominal current to test the batteries internal resistance more thoroughly.

If you just need to know if the battery is good or not, this will work.
... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

dwightthinker

#17
Sep 15, 2015, 08:47 pm
First, using 1% resistors will not get you to 12 bits of accuracy.
12 bits is 0.024%.
As has been mentioned, It will draw 8.26 ma. It would be
be a heavy load for a 9 volt battery. As the only load, it would do
an alkaline battery in in less than a month.
Dwight

Wawa

#18
Sep 15, 2015, 10:22 pm
As the only load, it would do an alkaline battery in in less than a month.
Make that two days.
Leo..

dwightthinker

#19
Sep 15, 2015, 10:42 pm
Make that two days.
Leo..
9V alkalines are rated at 400 -500 mah.

Wawa

#20
Sep 15, 2015, 10:46 pm
9V alkalines are rated at 400 -500 mah.
400 / 8.26 = 48hours = two days

dwightthinker

#21
Sep 15, 2015, 10:55 pm
400 / 8.26 = 48hours = two days
Dwight

aarg

#22
Sep 15, 2015, 11:21 pm
If the (mostly silent) OP just wants a battery tester, then the current consumption is a moot point.
... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

polymorph

#23
Sep 15, 2015, 11:32 pm
Until the OP tells us what they are trying to accomplish, this is all moot.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8

SagarDev

#24
Sep 16, 2015, 09:41 am
Okay. I shall use 10K resistors at each terminal. What should be my code to measure the battery voltage and current?
Shakespeare's pen is an Electronics Engineer's Soldering Iron...

Wawa

#25
Sep 16, 2015, 10:08 am
If you have a 10k resistor, a 100k resistor, and a 100n cap, then try this sketch.
It uses the more accurate 1.1volt Aref.
Leo..
Code: [Select]
`/*displays the voltage of a 9V batteryworks with 3.3volt and 5volt Arduinosuses the internal 1.1volt reference10k resistor from A1 to ground, and 100k resistor from A1 to +batt 100n capacitor from A1 to ground for stable readings*/float Aref = 1.075; // change this to the actual Aref voltage of ---YOUR--- Arduino (1.000 - 1.200), or adjust to get accurate voltage readingunsigned int total;float voltage; // converted to voltvoid setup() {  analogReference(INTERNAL); // use the internal ~1.1volt reference, change (INTERNAL) to (INTERNAL1V1) for a Mega  Serial.begin(9600); // ---set serial monitor to this value---}void loop() {  analogRead(A1); // one unused reading  for (int x = 0; x < 11; x++) { // 11 analogue readings and 1/11 voltage divider = no additional maths    total = total + analogRead(A1); // add each value  }  voltage = total * Aref / 1024; // convert readings to volt  // print to serial monitor  Serial.print("The battery is ");  Serial.print(voltage);  Serial.println(" volt");  total = 0; // reset value  delay(1000); // readout delay}`

SagarDev

#26
Sep 18, 2015, 03:12 pm
Do you have a sketch without Aref(a simpler one)?
Shakespeare's pen is an Electronics Engineer's Soldering Iron...

aarg

#27
Sep 18, 2015, 05:07 pm
Are you ever going to tell us exactly what this device is supposed to do? Not just how the circuit operates, but its purpose?
... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

SagarDev

#28
Sep 18, 2015, 05:31 pm
The purpose of this is to measure voltage and current from a 9V battery and the percentage of power remaining in the battery.
Shakespeare's pen is an Electronics Engineer's Soldering Iron...

dwightthinker

#29
Sep 18, 2015, 08:00 pm
This measures current and voltage with 12-bit accuracy.
Leo..
If you read the specs carefully, you'll see that it talks about resolution.
The only mention of accuracy was the current sense resistor.
To get the accuracy it would still be needed to be calibrated over some
temperature range.
Dwight

Go Up