throughout the electrolyte, the voltage gradually drops.
The Battery Marvel monitors this process, and alerts you if
the battery does not properly dissipate surface charge.
DESIGN AND THEORY
The schematic in Figure 2 shows the Battery Marvel is
based around an eight-bit PIC12F617 (U2). The eight-pin
PIC includes 2,048 14-bit words ( 3.5K bytes) of Flash
memory, 128 bytes of RAM, and a 10-bit A/D converter.
U2 is pre-programmed with software written entirely in
Diode D1 provides reverse polarity protection in case
the Battery Marvel’s power and ground wires are
accidentally connected “backwards.” U1 — an LM78L05
linear voltage regulator — provides a stable, regulated +5V
supply for U2, the temperature sensor, and the LED. This
regulated supply also serves as a stable voltage reference
for the U2’s 10-bit A/D converter.
R1 and R2 form a simple voltage divider which scales
the battery voltage down (minus the 0.7V drop across
D1) into a 0-5V range, suitable for the A/D converter.
A typical fully charged battery voltage is 12.65V for a
healthy battery which results in a scaled analog input
of ( 12. 65 – 0.7) x (10K / (10K+47K)) = 2.096V at U2’s
AN0 pin. J1 is a standard Microchip in-circuit serial
programming (ICSP) connector, used for programming U2
“in place” on the PCB. It is not used for this project, since
U2 is pre-programmed.
D2 and D3 form a very low cost ambient temperature
sensor. The forward voltage drop across a silicon diode
changes by roughly - 2. 2 mV per degree C. Here, two
silicon diodes are connected in series to multiply this
effect. Since our PIC has a 10-bit A/D converter with an
analog input range of 0-5V, we calculate a best-case
resolution of 5V/1024 = 4. 8 mV. Our sensor won’t win
any awards for high accuracy, but it does report
temperature within a few degrees and that’s good enough
for this application.
General-purpose NPN transistor Q1 drives P1, a
piezoelectric transducer. In my initial prototype design,
Q1 and R6 were not included and the piezo was instead
driven directly from U2. We decided that P1 wasn’t loud
enough, so we added Q1 and R6 to ensure that the
Battery Marvel could be heard over a vehicle’s engine.
The revised design generates a sound pressure level (SPL)
of about 100 dB at one meter, which is extremely loud.
The Battery Marvel’s embedded software measures
the battery voltage many times per second. It normalizes
each voltage measurement, adjusts for ambient
temperature, and takes different actions depending on the
current operating state of the vehicle. See Table 1.
If any problems are discovered, the Battery Marvel
issues an audible alert and updates the LED color as
Monitor vehicle charging
system, charging voltage, and
surface charge dissipation
The software also performs many other functions such
as diagnostics, calibration, optical data transmission,
maintenance of historical and log data in Flash memory,
and tracking the operating state of the vehicle.
1. Begin by inserting/soldering the 1/8W resistors, R1-
R8. It is important to make sure these parts lie fully
flat against the PCB, as the piezo needs to mount
over the top of them. The resistors are delicate —
be careful not to overheat them when soldering.
2. Insert and solder diodes D1-D3. Observe the
markings carefully, lining up the band on each
diode with the mark on the PCB. The band on D1
goes toward the right, while the bands on D2 and
D3 go toward the left. Make sure D2 and D3 lie
fully flat against the PCB, since the piezo will be
mounted over the top of them, as well.
3. Next, insert and solder bypass capacitors C1 and
C3. These may be inserted in either direction.
4. Insert and solder U2 (the PIC12F617). The notch
on the case should be toward the left.
5. Insert electrolytic capacitor C2. The negative lead
goes toward the bottom of the PCB.
6. Now, insert and solder Q1, the 2N3904 NPN
transistor. The flat side should be toward the left
when the board is viewed from above. Q1 and U1
look almost identical, so check carefully!
7. Next, insert and solder U1, the LM78L05 voltage
regulator, with the flat side toward the left.
8. Insert and solder the piezo transducer, P1. The PCB
is designed so that it can be inserted in any
9. Insert LED1 with the flat side of the case toward
the left. The top surface of the LED should be the
same height as the piezo. If the LED is mounted
too close to the PCB, the light output will be
significantly reduced after it is installed in the case.
10. DO NOT power up the board yet, as there is a
specific calibration procedure described in the
The first time the Battery Marvel is powered up with
10V DC or more, it will attempt to calibrate itself. If you
want to test it before calibrating, you can use a 9V
transistor battery. It won’t attempt to calibrate itself when
powered by only 9V DC.
The accuracy of the calibration reference is critical to
the proper operation of the Battery Marvel. If you don’t
November 2011 37