Battery Charge Status Monitoring: Continuous Current Measurement
This circuit offers continuous monitoring of a battery charge status through the measurement of charge and discharge currents. By integrating the battery current over time, considering its direction, the net consumption is displayed. This process allows the calculation of stored charge without relying on the battery’s terminal voltage. The circuit incorporates a 0.4 mΩ series resistor through which the current flows in or out of the battery. The circuit draws power from the battery being tested.
To power the TLC271 operational amplifier functioning as a differential amplifier, a symmetrical supply is necessary. To achieve this, a diode pump circuit, driven by a 7555 CMOS timer IC operating as an astable multivibrator, generates a negative voltage. Positive and negative fixed voltage regulators are used to derive the ±5 V supplies for the opamp. The +5 V supply also powers the rest of the circuit, including the LCD panel.
Designing Current Sense Amplifier for Digital Processing
The current sense amplifier is meticulously crafted to generate a signal suitable for subsequent digital processing. It operates within a current range of +150 A to –150 A, causing a voltage drop across the shunt ranging from +60 mV to –60 mV. The amplifier’s gain is precisely calibrated, ensuring that ±150 A translates to a range of ±300 LSBs in the ten-bit ADC output of the microcontroller, which, with a 5.00 V reference voltage, corresponds to ±1.466 V. The desired gain of 24.43 is achieved using metal film resistors, guaranteeing accuracy. The LM336 voltage reference at the opamp output offsets the voltage by 2.5 V, half of the ADC’s reference voltage. Small errors in this voltage can be corrected by adjusting the opamp’s offset voltage.
Accurate Measurement of Battery Voltage
To measure the battery voltage, set at a nominal 12 V, a voltage divider connects it to the second ADC input. When there’s a 15 V battery voltage, the divider is configured to produce a 4.888 V output, equivalent to 1000 LSBs in the ADC output. The voltage divider, constructed with precision using metal film resistors, ensures accuracy in voltage measurement.
The measurement results are shown on a one-line LCD panel. The firmware running in the PIC16F873A microcontroller provides the following functions.
- Measurement of voltage and current at regular intervals.
- Integration of current values (respecting sign) over time to measure total net consumption.
- Storage of calculated net consumption values in internal EEPROM.
- Selectable display of current, voltage and net consumption.
Programming Logic for Precise Timing and User Interaction
The program is meticulously coded in assembler language and comprises four distinct loops with varying execution times: 45 ms, 225 ms, 1125 ms, and 72 s. Within the 45 ms loop, controlled by TMR0, the processor remains idle, ensuring precise overall timing. Every 225 ms, the button is polled to check if the user intends to cycle the display between current, voltage, and consumption readings. In the 1125 ms loop, voltage and current readings are taken. Post ADC conversion, the results are formatted for display. Current readings are accumulated, considering their signs. This loop is executed 64 times within 72 s, totaling 64 current readings summed to calculate the mean current. Averaging over 72 s with 1 LSB corresponding to 0.5 A, ensures precise measurement where 1 LSB equals 0.01 Ah in the final result.
Correction Factors and Prototype Construction
The program incorporates a correction factor (0.7) to address the discrepancy in stored charge during charging, acknowledging that not all current ends up as stored energy in the battery. In constructing the circuit prototype on a perforated stripboard, initial adjustments involve setting LCD contrast using P1 and configuring offset potentiometer P2. The latter adjustment is made in current display mode with no connected battery to compensate for offset errors in IC2 and the tolerance in the 2.5 V reference IC3.
Additional Information and EEPROM Initialization
It’s essential to note that the first six entries in the PIC’s EEPROM are set to zero during programming. This step is vital as the program reads these entries to initialize its consumption counter upon power-up. For those interested, the microcontroller’s software (hex file and source code) is freely available for download from the Elektor website .