How to wire for battery level measure?
-
I dont understand how to wire if I want to measure battery level at A0 pin.. I have 1MΩ (R1) and 470KΩ (R2) resistor. But how do I connect this?
-
@msebbe put the two resistors in series between Vcc (Vin) and Gnd and connect the middle ( Vout) to the A0 pin. If you connect the 1 MOhm (R2) to ground, the voltage on the A0 pin is then two third (2/3) times Vcc. This is called a voltage divider.
-
@AWI said:
@msebbe put the two resistors in series between Vcc (Vin) and Gnd and connect the middle ( Vout) to the A0 pin. If you connect the 1 MOhm (R2) to ground, the voltage on the A0 pin is then two third (2/3) times Vcc. This is called a voltage divider.
1M to grund? In example from mysensors picture says 1M to vcc.
Also, could I wire so both resistors meet at A0 or how do you do it?
-
Vin = Vbat
Vout = A0
R1= 1M
R2 = 470k
-
-
Ok, thank you guys, will try this tomorrow when I have a whole day free
-
@AWI said:
resistors in series between Vcc (Vin) and Gnd and con
Trying to figure out the same thing. Did I understand correctly that I could solder 1M Resistor from VCC to A0 and 470k Resistor from GND to A0 ?
-
@Cliff-Karlsson You could do just that. The voltage on the A0 pin will be around 1/3th of Vcc. If you swap the resistors 2/3th of Vcc.
Suggested Topics
-
Day 1 - Status report
Announcements • 23 Mar 2014, 22:45 • hek 24 Mar 2014, 20:12 -
Forum Search not working?
Troubleshooting • 4 Oct 2023, 23:33 • Gibber 2 Sept 2024, 20:28 -
Raspberry Pi 5: invalid GPIO 9
Troubleshooting • 27 Aug 2024, 13:20 • igo 27 Aug 2024, 13:20 -
Echo request is not set
Troubleshooting • 12 Aug 2024, 15:36 • kamilb85 3 Sept 2024, 08:58 -
Compiling Sensor code using BME280 and ESP8266
Troubleshooting • 26 Feb 2025, 00:32 • dpcons 26 Feb 2025, 06:22 -
JSN SR04T - Temperature Influencing Readings
Troubleshooting • 6 Sept 2019, 07:51 • Timbergetter 8 days ago