Can anyone explain the connection of the voltage divider in this image, why it's connected to A0? I put a red circle on the section that i don't understand. Circuit image


The voltage divider reduces the battery voltage by a factor of \$\frac{R2}{R2+R3} = \frac{1000}{2500} = 0.40\$. This puts it in a range that allows the Arduino to measure it. 0 to 12.6 V (minus the diode drop) becomes 0 to 4.8 V, which can be measured by the ADC, which accepts 0 to 5 V.

  • \$\begingroup\$ Is the resistors R2 and R3 considered as the load between the positive and negative terminals of the battery, so no short circuit?! \$\endgroup\$ – Salman Mohamed Feb 9 '19 at 12:55
  • \$\begingroup\$ Why would there be a short circuit? The current through the resistors will be about \$\frac{12\text{ V}}{2500\Omega} = 4.8\text{ mA}\$. \$\endgroup\$ – Dave Tweed Feb 9 '19 at 12:57
  • \$\begingroup\$ Thanks for this clarity. Another question, for what is this diode and how much the voltage drop on it? \$\endgroup\$ – Salman Mohamed Feb 9 '19 at 12:59
  • \$\begingroup\$ Two things: First, without the diode, the range of the battery voltage would slightly exceed the range of the ADC. And second, it somewhat protects the Arduino from short-term voltage sags caused by the motors, allowing it to run from the energy stored in its Vin capacitors. Adding additional capacitance between Vin and ground would help in this regard. \$\endgroup\$ – Dave Tweed Feb 9 '19 at 13:02
  • \$\begingroup\$ This diode is 1N4001 which operate to 1A, means it limits the current? \$\endgroup\$ – Salman Mohamed Feb 9 '19 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.