1

I have a ~12 V battery (automotive, so VERY noisy) that I would like to measure the voltage of on an Atmega. I'm wondering what would the most effective method to do that be? An ADC that is ~12 V tolerant but communicates on 5 V logic power? Some sort of optocoupler to isolate the 12 V signal, then resistors to drop down to 5 V?

tl;dr: Have 5 V microcontroller, how to sense 12 V voltage from vehicle without frying the microcontroller if overvoltages occur.

skvery
  • 736
  • 6
  • 17
TheAutomator
  • 177
  • 7
  • Possible duplicate of [Use BBB analog inputs with 0..5V or 0..10V](http://electronics.stackexchange.com/questions/288182/use-bbb-analog-inputs-with-0-5v-or-0-10v) – Voltage Spike Mar 07 '17 at 06:27
  • A voltage divider is different than I'm asking about. I understand how to use a voltage divider to get from 12V to 5V, but 1) that provides no electrical isolation and 2) that assumes a steady 12V, which automotive power is not. – TheAutomator Mar 07 '17 at 06:31
  • Ok, update your question with that info and I'll delete the comment and retract my vote. – Voltage Spike Mar 07 '17 at 06:34
  • A voltage divider is also applicable to AC. Please note that you will then have to design an RC filter for the A/D instead of just putting in a 100 nF capacitor. – skvery Mar 07 '17 at 09:34
  • Unless you cannot have the ADC ground at the same level as the car ground then you do not need isolation, just overvoltage protection. – TWiz Mar 07 '17 at 10:31

1 Answers1

1

You are quite correct that spikes over 100 V can appear on automotive supplies, mostly due to starting circuits.

A resistive voltage divider of say 12 V to 3 V should be sufficient if followed by a 3.3 V zener and a 1 nF capacitor to get rid of the overvoltages.

See the following example showing the basic idea after some comments above:

schematic

simulate this circuit – Schematic created using CircuitLab

skvery
  • 736
  • 6
  • 17
  • If you do not need to sense rapid changes in voltage (<1s) then I would also recommend using a large capacitance for smoothing, around 1uF. If you use an electrolytic you may still need a low ESR capacitor in there to supress the RF noise. – TWiz Mar 07 '17 at 10:27