Comparator-less voltage level detection

Thread Starter

cmartinez

Joined Jan 17, 2007
8,257
If you divide 20 volts down to 1 volt using 190K and 10K resistors then that meets your 10k source resistance requirement. Only 100uA is drawn from your 20 volt source.

Placing a cap from the A/D input to ground also helps at higher value source resistances.
Maybe I should add that maximum external voltage will be 5.10V. That is, after reaching 4.85V, the source will keep rising until it reaches 5.10V tops. I won't raise anymore after that. So a resistor divider of the magnitude you've proposed is too much of a stretch.

Let me add some numbers here.... if I want to be able to measure 4.85V with a margin of error of ±0.01V, then I'd need more than just an 8-bit resolution ADC ... on the other hand, I could perfectly live with an arrangement that could detect anything between 4.85V and 5.00V ... so that's a 0.15V working margin for you ... maybe there's a simpler way of accomplishing what I want under that last consideration ... but I can't see which ...
 

RichardO

Joined May 4, 2013
2,270
Maybe I should add that maximum external voltage will be 5.10V. That is, after reaching 4.85V, the source will keep rising until it reaches 5.10V tops. I won't raise anymore after that. So a resistor divider of the magnitude you've proposed is too much of a stretch.

Let me add some numbers here.... if I want to be able to measure 4.85V with a margin of error of ±0.01V, then I'd need more than just an 8-bit resolution ADC ... on the other hand, I could perfectly live with an arrangement that could detect anything between 4.85V and 5.00V ... so that's a 0.15V working margin for you ... maybe there's a simpler way of accomplishing what I want under that last consideration ... but I can't see which ...
Now you are changing the requirements on me. ;) In your first post you said up to 20 volts...

Use 40K and 10K to divide 5 volts down to 1 volt. Still only 100ua load on the source.

One count of the A/D with a 3.3 volt reference is about +/- 3.3mV. Dividing by 5 at the input bumps this up to +/- 15.5mV. This is much less than your 0.15 volt working margin. Of course, this assumes the 3.3 volts and divider resistors are exact values...
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,257
Now you are changing the requirements on me. ;) In your first post you said up to 20 volts...
yeah ... sorry about that ... those top 20V are shunted down by a 5.1V zener, because they're generated by a high-impedance source (about 600 ohms) and that was the easiest way to do it.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,257
One count of the A/D with a 3.3 volt reference is about +/- 3.3mV. Dividing by 5 at the input bumps this up to +/- 15.5mV. This is much less than your 0.15 volt working margin. Of course, this assumes the 3.3 volts and divider resistors are exact values...
I'm beginning to like that idea ... plus, it's easily testable and measureable ... I'm going to ponder it for a while ... many thanks!
 

RichardO

Joined May 4, 2013
2,270
yeah ... sorry about that ... those top 20V are shunted down by a 5.1V zener, because they're generated by a high-impedance source (about 600 ohms) and that was the easiest way to do it.
I'm beginning to like that idea ... plus, it's easily testable and measureable ... I'm going to ponder it for a while ... many thanks!
If you divide down just enough so that the 20 volts does not exceed the 3.3 volt power supply you should be able to save the zener diode -- say, 60K and 10K in the divider. The clamp diodes on the PIC inputs are *very* robust and very little current would be injected into the input. Be warned that if the A/D input voltage goes above 3.3 volts you run the risk if pulling the power supply above the regulated 3.3 volts.

Have fun. :D
 
Top