# Voltage Divider for a Particular Range

#1

I am putting together a device to measure a voltage from a 12V charging unit and batter. The idea is to take this measurement and transmit it to a “base station” for logging. For the initial trial I am using a Teensy. They are 5V tolerant but will cap the reading once the analogue input goes above 3.3V.

It was suggested that I could increase the resolution of the reading but taking a smaller sample. i.e. since the system I am building is not really interested in the full range i.e. 0-12V but more like 8V-14V, it should be possible to test for this using a voltage divider.

I have modeled this in Fastad and seems like I might have what was meant. I thought I would throw it to the forum for confirmation that this is the correct approach. In the end, this does not have to be super accurate. But do not want the analog signal to go above the 3.3V

http://tinyurl.com/yb64x2k4

#2

Hey @Steve_Mayze, I am by no means any authority on the subject, but I didn’t want to see this go too long without a response so I can just give my input that it looks like the right approach to me.

Also, I love how clean and professional your schematic looks with the reference notes and everything, very nice.

#3

Hi @Steve_Mayze, that circuit is not going to get you what you want. It is still just a voltage divider with the Teensy measuring the drop across the 30k resistor. The voltage across that resistor will range from 0 - 3.3V for an input of 0 - 15.4V so it won’t improve the resolution.

I would suggest you use a 7.5V - 8.2V zener diode in series with a voltage divider, then there is no current flowing through the divider until you reach the zener voltage. With a 8.2V zener diode choose values for the two resistors in the divider such that 15V - 8.2V gives you 3.3V. You just need to watch that the divider values are such that the zener’s minimum current requirements are met at low voltages, around 8.5V - 9V. Until the required minimum current is flowing through the zener you won’t get a linear output voltage so choose a zener with a low minimum current. You should be able to get a linear output above about 9V. Or use a 7.5V zener for a linear output from about 8V.

Hope that helps.

Edit: For example, if you use 14.8V as an upper limit, 14.8V - 8.2V = 6.6V and if your divider divides that by 2 (ie. both resistors are equal) then the output would be 3.3V for an input of 14.8V. You can vary the resistors to obtain whatever upper voltage limit you want.

#4

Kudos goes to @hedrickbt for the annotations. I took inspiration from some of his work - Just some of the “cross pollination” that goes on in CE.

#5

Thanks @1.21Gigawatts. That does help! also the span of 6.6V enable the use of equal resistors is a neat idea. Before your edit, I was starting with a value of 30K and working back from that. I will need to research a bit more about the Zeners before I finalise on the specific values of everthing, but this is a great start.

#6

Hi @Steve_Mayze, was just having another think about your application. Without more information I can only throw suggestions at you but they may help. You don’t mention the capacity of the battery you are monitoring or if you need continuous monitoring, etc. The reason I said you would need to use a zener with a low minimum zener current was based on the assumption of continuous monitoring and therefore needing a relatively high impedance / low current drain. But if you can periodically sample the battery voltage then the current drain becomes less critical and suitable zeners become easier to find. By adding a small MOSFET to the circuit you could periodically turn on the MOSFET to connect to the battery for a few msec, sample the voltage and disconnect.

#7

That’s an interesting idea, @1.21Gigawatts

So you’re saying “measure the zener drop” and then "measure the divider portion? Kind of like a differential measurement?

One thing I had mentioned to Steve on a call is that the range could be increased with an instrumentation amp, because it’d be measuring a common mode voltage. for instance, if there was an 8V zener at the bottom of the divider, you could measure across the resistors above because the 8V common mode should be taken care of by the CMRR of an in-amp.

#8

Thanks @1.21Gigawatts, the actual use case will be continuous monitoring. Draining the system just for the purpose of data collection was and is a concern.
The actual charging system itself is for an 80kW solar unit charging a 12V battery that supplies an electric fence. Before exploring the other aspects of monitoring the fence operation (which is the real requirement), I figured a simpler proof of concept would be looking at the battery.

#9

This is what I had in mind.

V2 would be a digital output from your MCU to control the MOSFET. With an input voltage of 15V this circuit draws around 75ua varying slightly according to the zener diode used. Turning off the MOSFET reduces the current to the leakage current of the MOSFET which should be 1ua or less. A suitable zener diode would be something like the MMSZ4694T1G. And any low power MOSFET with a Vgs > 15V and as low reverse leakage current as possible. The following is a plot of the simulation of this circuit using a zener and MOSFET that I happened to have models for. As you can see it becomes fairly linear at about 8V with an output voltage of about 195mV. At an input of 14.75V the ouput is 3.3V.

#10

Wow! I understood what you were meaning but it would have taken me a while to come up with something like this. I can understand the purpose of Q1 in terms of perhaps limiting the current requried from the MCU. But the relationship between M1, R3 and Q1 is not clear for me. Before I launch into any “how does it work” questions, I would rather like to model this to see if I can work it out.

Thanks.

#11

Of course the simplest solution would be the following but it spreads the resolution over the entire input range. I had a quick look at the Teensy and appears to have 13 bit resolution and a PGA, is it really worth trying to compress the input range to improve resolution?

This circuit has an output of 3.3V for an input of about 14.8V and draws about 775na at 15V.

Note: In this case the capacitor is important due to the large difference between the impedance of the Teensy’s ADC input and the impedance of the resistor divider.

#12

It is an important point about the resolution and if it is really warranted in this case. To be honest, for this particular case, I don’t think so but it was an avenue I wanted to explore as it might be useful to understand.

The simple circuit you have there is basically what I am working with at the moment on the board I have. Except that I have 100k and 39k. This means that the reading is capped at 12V.

#13

Hi @ChrisGammell hopefully my posts above explain what I was suggesting. By rearranging the circuit and putting the divider at the bottom the measurement can be taken with reference to ground. I didn’t suggest using any amplifiers as I didn’t know if Steve wanted to venture down that road. I also didn’t know if there were any other power supply voltages available for powering the amplifiers. But I think the simplest circuit is probably the best approach.

#14

Definitely! I kept imagining the zener at the bottom of the stack. That was a great looking circuit!

#15

Hi

I’ve recently done the same project but for the esp8266. The 1v 1024 bit resolution required an offset. I’ve used a zenner 9.1 to offset and opa741 in voltage follower configuration. I needed a second divider for the esp which was done the same way only I used tl071. You need to clamp in and out since from the charge controllers there are spikes to 19v and up. So I’ve added one more zenner on the output. So if you are using mosfeta need more than 15vgs.

#16

Hi…i am a new user here. As per my knowledge with 8.2V zener diode choose values for the two resistors in the divider such that 15V - 8.2V gives you 3.3V. You just need to watch that the divider values are such that the zener’s minimum current requirements are met at low voltages, around 8.5V - 9V.

pcb assembly

#17

An interesting but seldom-addressed topic here is that of tolerance analysis and calibration.

It’s definitely true that in the first-order understanding of this process, shifting and scaling your actual range of interest (12V plus or minus a few volts) to maximize your ADC’s full-scale range (0-3.3V) will give you the best resolution.

What’s sometimes lost is that (especially for “DC” measurements) accuracy is not limited at all by resolution, but by the analog front-end doing all that shifting and scaling. AFEs like these can easily introduce orders of magnitude more gain/offset error than whatever quantization error they remove. Even a simple voltage divider made of two .1% resistors can introduce up to .2% error at the ADC pin. That’s one part in 500; quite a lot when compared to a 13-bit ADC where an LSB is 1 part in 8000. And there are worse sources of DC error than just the resistors here.

As your AFEs grow in complexity, so will the DC error they introduce. Calibration after assembly can address these issues, but that’s another topic. The difference between this kind of error analysis at DC and AC is another topic still.

My general advice for improving performance here is to do nearly the opposite thing you’re doing. Keep your AFE as simple as you possibly can, so that your ADC is measuring as close to the real truth as possible. Maximizing full scale range won’t help anything if the hardware to do it gives you 4% error at the ADC input. Remember you’re not interested in measuring the voltage at the ADC accurately, you’re just interested in what that measurement can tell you about the battery voltage.