# Batwatch using ATtiny13V microcontroller

Contents

#### Overview

Batwatch is a simple monitor for a solar panel battery charger, using an Atmel ATtiny13V. It periodically measures the charge current and battery voltage, and shows them by blinking two LEDs. I built this circuit into the plug of a VW solar charger panel that is used to prevent a discharge of the battery when a car is not used for some time. A modern car contains a large amount of electronics, and a quiescent current of 40-50mA (about 1Ah per day!) is considered “normal”.

#### Solar Panel

I got the solar panel on eBay. These panels seem to be delivered with new VW cars in the USA. You attach the panel against the windshield with suction pads, and plug it into the cigarate lighter. The maximum power is specified as 170mA at 18.8V, but you need very bright direct sunlight, probably somewhere near the equator, to achieve that.
This is what the solar panel looks like (click to enlarge):

#### Hardware

Because I wanted to keep an eye on the battery condition and charge current without opening the car, I devised a circuit that shows the voltage and current visually, by blinking a red and green LED. The charge current is determined by measuring the voltage drop over a 10 ohm series resistor. Two A/D inputs are used to measure the voltage before and after the resistor, which is the battery voltage.
When you look closely at the photo of the circuit, you may notice that it actually contains two 10 ohm resistors. That is because I first used a 5 ohm series resistor, but the voltage drop turned out to be too small to get reliable current readings. The internal resistance of the solar panel is pretty high anyway, so the additional 5 ohm does not cause a significant charge current reduction.
To keep the power consumption low, I used the low-power voltage regulator LP2950CZ instead of a plain 78L05. The duty-cycle of the (low-power) LEDs is rather low, so the avarage total power consumption is about 1mA. The internal BOD circuit is enabled and set to a voltage of 4.3V.
Here are pictures of the outside and inside of the 12V cigarette lighter plug (click to enlarge):

For more detail: Batwatch using ATtiny13V microcontroller

### Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.