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.
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).
Available on Tindie: https://www.tindie.com/products/nEXT_EVO1/universal-ac-mains-dimmer-mpdmv41/