SoftBattery         Measuring voltages using PC and a tiny circuit



 3D Graphics

Canvas Commander







Here is how to make 3 voltage meters using a PC, resistors, capacitors and an IC. The following circuit is powered and read by a serial port. SeriCon, a universal PC interface program can pulsate the output pins RTS/DTR manually or auotmatically and can measure other pulses at the input pins CTS/DSR/RLSD. You can easily customize the outputs and inputs by dialog boxes to do the following works and save the specifications into a file. If you don't want to read the SeriCon manual now, try this file: vMeter.scs

Right after the file loaded (by menus or double-clicking), SeriCon starts pulsating DTR with RTS kept low. The period is 2 seconds consisting of the two 1 second high and low level durations. The input pin CTS level is low during the latter half period, since DTR is low like RTS and the circuit is not powered. When the new period starts, the circuit gets powered by the high level of DTR, and CTS becomes high. CTS falls when the capacitor is charged enough for the [+] input to the comparator IC to be higher than the [-] input connected to Vi the voltage to measure.

The high level duration of CTS is tranformed by an exponential function, which corresponds to the transient voltage effect characteristized by RC = 100 ms ( = 100kOhm * 1 uF ):

[V+][1-exp(-tH/RC)] = Vi
where V+ is the high level voltage of DTR and tH is the measured high level duration of CTS. The display format of CTS input pulse count and the durations (or the transformed values) can be also customized to have suitable number expressions and additional texts for names and units.

Although the quantities also can be included in the display or excluded, the pulse count is included in the voltage meter application, since the increment indicates that the meter is working: You should adjust the variable resistor for the zero Vi to see the count increasing before measuring the real Vi, and should see it also increasing during the measurement.

The display window becomes white when CTS is high, so that it shines longer for higher Vi. But, emphasizing once again, be sure to see the CTS pulse "alive" during the measurement, by seeing the count increasing, not only by the window color flickering between gray and white since you cannot recognize very short white colors for very low Vi.

High Vi is not suitable, since it makes tH comparable to the first half period of DTR so that the capacitor gets charged much and discharges insufficiently during the second half period, which leads to large fluctuations in tH. The screenshot above shows the result for a mobile phone battery, with V+ set 10V. If V+ of DTR is measured by other instrument and inserted into the dialog box popped up by the [Bit]->[Cts] menu replacing 10, the result can be more believable.

Generally, one comparator IC have 4 comparators, so that it is sufficient to make 3 meters, ustilizing the other input pins DSR and RLSD, with 2 more sets of resistors and capacitors added to the circuit.

SeriCon is a shareware without evaluation period limits but with function limits. Just reset the pulse count by the Cts button or restart the Dtr automation each time they stop due to the limitations (30 counts and 60 pulsations), unless you don't purchase the full license. Do you need a GUI terminal to your microcontroller project, instead of old text terminal programs? SeriCon will satisfy you also in such serial communications (RxD, TxD).

Copyright(C) 2009