Microvolts to kilovolts in milliseconds with one I/O pin



Figure 1’s silly-simple voltage-to-time ADC is an exercise in dynamic range. Assuming that it is used with a 10-MHz counter/timer, its resolution is roughly 10 µV per count for inputs around 0 V and 100 mV per count at 1 kV, and it never really over-ranges. The simple trick that provides this multi-decade measurement span is the inherent logarithmic behavior of RC timing networks. 

Here’s how this one works.

Wow the engineering world with your unique design: Design Ideas Submission Guide

Figure 1 U1 works with R1, R2, and C1 to logarithmically digitize 0 kV to 1 kV inputs while tying up only one microcontroller I/O pin.

Between conversions, U1’s reset pin 4 is held active-low either by the connected GPIO pin, or by U1 itself.  Using a 555 in this self-resetting mode is unusual but is very handy here. This holds the C1 at zero or very near, since the Ron of pin 7’s open-drain FET is typically just 15ohms.

A conversion starts when the I/O pin is programmed for output and pulsed high, overriding U1 pin 3 (Out) and releasing the reset as sketched in Figure 2. The I/O pin is then immediately tri-stated and reprogrammed as input, gating an internal counter/timer peripheral for measurement of the conversion time T. 

Because U1’s pin 2 (Trigger) is held low, the end of reset also sets pin 3 high and releases pin 7, allowing C1 to begin to ramp positive. When it reaches the 2.048V (Threshold) voltage on pin 5, conversion will complete and the time T that was required to do so is the conversion result. Arrival of pin 5 at the threshold voltage drives pins 3 (Out) low, thereby both pin 4 (Reset) and GPIO, the latter being the “conversion complete” status bit to the microprocessor. Meanwhile, pin 7 is driven low to discharge C1. This process completes in about 12 µs, readying the converter for another cycle.

Figure 2 A single general-purpose tri-state I/O pin serves to both control and measure U1’s time-out. The pin is programmed for output and pulsed positive to start conversion, then tri-stated for timer input. Conversion time (T) is 10 ms for Vin = 0, decreasing to approximately 100 µs for Vin = 1 kV.

T versus Vin is given by the following equation:

T = C1(R1||R2)*Loge ((0.209Vin + 3.234) / (0.209Vin + 1.1919))
= 10.0ms*Loge ((0.209Vin + 3.234) / (0.209Vin + 1.1919))

This is plotted in Figure 3 for Vin = 10 mV to 1kV.

Figure 3 The conversion time (T) in milliseconds for Vin from 0.01 V to 1000 V.

To recover Vin from a T acquisition, do this:

Vin = (3.234 – 1.1919e(T/10.0ms))/(0.209(e(T/10.0ms) – 1))

Finally, here’s something in the nature of a reality check. 

You might be wondering why R1 is shown as a series connection of four 1M resistors instead of a single 4M component.  The answer is the somewhat obvious fact that 1 kV is some serious voltage and the somewhat less obvious fact that resistors, somewhat like capacitors, have voltage ratings. Resistors rated for 1 kV are not the usual breed of cat.

And speaking of cats, please remember the old story about what curiosity did to one unfortunate feline and consider that prudent and proper safety practices are literally vital when choosing to work with voltages of this magnitude.

Me–OW!

Stephen Woodward’s relationship with EDN’s DI column goes back quite a long way. Over 100 submissions have been accepted since his first contribution back in 1974.

 Related Content

<!–
googletag.cmd.push(function() { googletag.display(‘div-gpt-ad-native’); });
–>

The post Microvolts to kilovolts in milliseconds with one I/O pin appeared first on EDN.



Source link