Chat freely about anything...

User avatar
By trackerj
#45229
GregryCM wrote:Hi Dachs,

The vehicle battery voltage has a range of about 9V to 16V. With all of the motors, solenoids, etc on that bus turning on and off, it is not a clean supply. When the loads turn on and off, voltage transients will occur.

The following circuit can be used to monitor the vehicle battery voltage with an ADC input. R1 and R2 divide the voltage from the 9V to 16V range to the 3.3V range of the ADC input. D1 and D2 clamp transients to the supply rails to limit the transient peaks to -0.6V and +3.9V. C1 provides a low pass filter and slows the transients. R3 limits the input current to the ADC input during a transient.

Vbatt ADC Input.JPG


If we are talking about ESP8266 Internal ADC, be careful, MAX ADC input range is about 1V depending on your VCC (more like a usual value of 0.978).
Last edited by trackerj on Mon Apr 11, 2016 3:22 am, edited 1 time in total.
User avatar
By Dachs
#45294 Thanks to everyone for your help. Yes, the ESP8266 ADC in is only ~1v, so I plan to stay just under that limit.

xtal wrote:If you don't know what you are doing, the ODB port is not the place to start, you could possibly damage your on board computer.....


Thank you for your concern. It's not that I don't know what I'm doing, in general. I am just very new to the microcontroller board world and calculating electrical current and resistance. However, I will only be accessing 2 pins in the OBD port, 12v and gnd.

GregryCM wrote:The vehicle battery voltage has a range of about 9V to 16V. With all of the motors, solenoids, etc on that bus turning on and off, it is not a clean supply. When the loads turn on and off, voltage transients will occur.

The following circuit can be used to monitor the vehicle battery voltage with an ADC input. ....


Thank you GregryCM, this look like exactly what I need. I will just need to change the resistors to something like R1 = 100k and R2 = 6.6k (3x2.2k in series?). I just need to pick up those capacitors and get up and running.

trackerj wrote:it might be a good idea to read my post about Internal ADC and Voltage Divider calculations


trackerj, reading your article is part of the reason I've gotten as far as I have. ;)
User avatar
By floripaolo
#76516
GregryCM wrote:Hi Dachs,

The vehicle battery voltage has a range of about 9V to 16V. With all of the motors, solenoids, etc on that bus turning on and off, it is not a clean supply. When the loads turn on and off, voltage transients will occur.

The following circuit can be used to monitor the vehicle battery voltage with an ADC input. R1 and R2 divide the voltage from the 9V to 16V range to the 3.3V range of the ADC input. D1 and D2 clamp transients to the supply rails to limit the transient peaks to -0.6V and +3.9V. C1 provides a low pass filter and slows the transients. R3 limits the input current to the ADC input during a transient.

Vbatt ADC Input.JPG



Hi
I've been looking for a voltage divider like this but i would need to adapt it for 1V ADC. I tried to calculate but I can't come up with your way to calculate resistances in this setup.
Thanks!