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 -
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-V3.0 Coax cable extended
Troubleshooting • 19 Mar 2025, 21:00 • bocalexandru 21 Mar 2025, 12:05 -
Getting system time from the controller
Troubleshooting • 27 Feb 2025, 01:39 • dpcons 3 Mar 2025, 01:00 -
NODs stop responding, but ping works.
Troubleshooting • 8 Mar 2025, 19:47 • Marcin 8 Mar 2025, 19:47