Taggsladder 2 Posted August 31, 2015 Share Posted August 31, 2015 Hello I want to measure the battery voltage (ballpark measurement) in a car so I thought I do that with a voltage divider connected to a msp430 ADC pin, but I wanted to add overvoltage protection with a zener as in the schematics in the link below. I am using 100k / 10k in the voltage divider and a BZX79C2V7 zener. If I leave the zener disconnected I get the divider to work as expected in a linear fashion, but when I connect the zener I get the correct reading when the input voltage is 10V but if for example I double the input voltage to 20V I get a lower reading compared to when the zener is disconnected and the voltage divider is no longer linear. Measurements without zener: 10V in, 0.9V to mcu pin 15V in, 1.35V to mcu pin 20V in, 1.78V to mcu pin Measurements with zener: 10V in, 0.9V to mcu pin 15V in, 1.25V to mcu pin 20V in, 1.46V to mcu pin Why is this so? http://www.re-innovation.co.uk/web12/index.php/en/information/electronics-information/accurate-voltage-measurement Thanks Kind regards Andreas Quote Link to post Share on other sites
roadrunner84 466 Posted August 31, 2015 Share Posted August 31, 2015 Because the reverse current of a zener is not exactly zero, so there's a tiny current leaking through the zener causing it to act as a non-linear resistor in parallel with your second resistor. I don't think you can solve this problem using just passives. You could maybe use an opamp as an analog buffer, powering it from the same source as your controller will effectively clip your output voltage from the opamp to the maximum voltage allowed by your controller. Taggsladder 1 Quote Link to post Share on other sites
Taggsladder 2 Posted August 31, 2015 Author Share Posted August 31, 2015 Thanks for the reply! TBT, just the word opamp scares me a little, hehe. How comes the zener is used in the link and the title is "Accurate Voltage Measurement". Is there a way to calculate this offset in software or would it be to messy? I am not looking for a accurate reading, +- 0.5V in a 10-25V span would do fine. Best regards Quote Link to post Share on other sites
roadrunner84 466 Posted August 31, 2015 Share Posted August 31, 2015 Either try to define the behaviour of the zener and compensate for that in software, or - much simpler - make a table with a range of actual voltages and make a table that maps the ADC readout to voltages Quote Link to post Share on other sites
Taggsladder 2 Posted August 31, 2015 Author Share Posted August 31, 2015 I was thinking about some sort of lookup table as you say Thanks for the help, much appreciated. Have a nice day! Sent from my SM-G900F using Tapatalk Quote Link to post Share on other sites
terjeio 134 Posted August 31, 2015 Share Posted August 31, 2015 Reducing the resistor values is also a possibility (if low current consumption is not important), say by a factor of ten - this will reduce the impact of the leakage current. Quote Link to post Share on other sites
Taggsladder 2 Posted September 1, 2015 Author Share Posted September 1, 2015 Reducing the resistor values is also a possibility (if low current consumption is not important), say by a factor of ten - this will reduce the impact of the leakage current. I played around with that too but since the device will power from the cars battery I want as low consumption as possible. Quote Link to post Share on other sites
LIJsselstein 9 Posted December 19, 2015 Share Posted December 19, 2015 To reduce current consumption, you could add a high side switch to the voltage divider which is controlled using a digital i/o pin and switch it on just before taking a sample. Search for high side p-channel mosfet switch to find example circuits. There are also specialst one-stop-shop ic's for ths job, like the ITS4141N that uses logic control levels and works down to about 9V. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.