1

I want to measure 12v. Car battery with arduino. Three questions:

  1. Is the R1 and R2 the best values? The car battery can go from +10v. To +15v.
  2. How and what can I use to save power between the measure reads? Like a transistor to switch on and off or something like.
  3. Must I add something to protect arduino pin from car battery overvoltage?

I have this:

———————————————— +10v. To 15v. Car battery
         |
         |
    Something here to switch off and save power? 
         |
         |
         R1 = 150kOmh
         |
         |——————————- to analog arduino pin to read voltage 
         |
         |
         R2 = 470kOmh
         |
         |
——————————————————- GND negative battery 

Solved!

———————————————— +10v. To 18v. Car battery
         |
         |
         R1 = 36kOmh
         |
         |———————————————- to analog arduino pin to read voltage 
         |            |
         |            |
         R2 = 10kOmh  5.1v Zener diode to protect arduino pin
         |            |
         |            |
—————————————————————————— GND negative battery and arduino 
  • The divider value is too high, which will affect the accuracy. A few kOhms is ok. – Long Pham Apr 09 '18 at 16:41
  • 1
    if you want protection, maybe you should add a 5V zener diode – Long Pham Apr 09 '18 at 16:42
  • A few KOhms of resistance won't drain much your battery – Long Pham Apr 09 '18 at 16:43
  • How is the Arduino itself powered? – Claudio Avi Chami Apr 09 '18 at 16:45
  • @LongPham - like a 10kOhm and 36kOhm? To get 18v max read? I know It will not drain much battery, but the system will be 24 hours on, and I would like the minimun consumption. – Victor Anonops Apr 09 '18 at 17:07
  • @ClaudioAviChami - with DC-DC converter 12v to 5v from the same 12v car battery which I want to measure. – Victor Anonops Apr 09 '18 at 17:09
  • @LongPham - you are right, with 10k and 36k resistors It will drain like 0,3mA , right? It´s ok for me! :) thanks! – Victor Anonops Apr 09 '18 at 17:44
  • 1
    you can connect R2 to a GPIO instead of GND. To save power, you `inputMode(x, INPUT_PULLUP); digitalWrite(x, HIGH)` and to read you use `inputMode(x, OUTPUT); digitalWrite(x, LOW)`, which connects the divider to the GND with a low-impedance path, whereas the INPUT_PULLUP mode throws it behind dozens of more kohms... – dandavis Apr 09 '18 at 20:46
  • related to your first diagram with a hypothetical high-side switch: [Measure battery voltage](https://electronics.stackexchange.com/a/39429/7036) – Nick Alexeev Apr 09 '18 at 23:26
  • R1 and R2 seem to be the wrong way round in the first diagram. – RoyC Sep 02 '18 at 09:03

2 Answers2

1

to Q2. To save power, before you switch off something using transistors. Do these two first 1. write proper code to save power eg use very low cpu clock, make mcu sleep etc 2. choose low quiescent current LDO because a cheap L7805 has 2-3mA quiescent current.

J.Z
  • 11
  • 1
1

You can use the divider resistor values as shown in your first diagram but you will need to put a 0.1uF capacitor across R2. The input to the A-D shows up largely as a capacitive load which can introduce inaccuracies if you have large resistors and no charge storage at the input.

This will slow down your reading response to fast changes but in this application that will probably not matter.

RoyC
  • 8,418
  • 6
  • 25
  • 40