Those who read my previous entry will know that I built a perf-board version of the swim watch, that it broke after about 20 lengths of swimming, but I was generally happy with the performance at that stage.

However, it was far too big, used far too big a battery (in size rather than capacity), and needed a few more adjustments. Therefore it was “back to the drawing board” with the watch being tested on breadboard again.

Hardware

Battery

The first thing I wanted to improve was the battery and the battery life of the device. I previously used a battery out of an old phone, which was great for testing, but huge compared to what I wanted in the final design.

However, battery’s aren’t my strong point and I’m still unsure what’s the best battery to use.

To try and shrink things down as much as possible, I’ve initially decided to use a rechargeable coin battery. To test things out, I ordered a 3V 65mA coin battery (available here), mainly because it’s small and cheap. However, it quickly became clear that the battery couldn’t supply enough current to drive my circuit (really noticeable on the display which wouldn’t go to full brightness).

Therefore I bought a Lithium Polymere battery which has a capacity of 330mAh and can apparently supply up to 200mA, which should be more than enough for my circuit.

I’m still waiting for this battery to arrive, but until then, I’m using the old phone battery from the version 2.0.

Battery Charger

I also needed a way to charge the battery. Although I’m still trying to think of a way to charge the device once it’s waterproof, at this stage I’m simply using the RasPi to charge the battery (5v to charge, but need to be careful as I’m also using the RasPi to program the device, and those lines need 3.3v).

Initially, I used the MAX1555 to try and charge the battery. However, when I purchased the device, I didn’t realise that the current it supplies is much higher than expected (~200mA), which is far to high for my 65mA battery.

I then found this page with some useful information on charging small coin batteries. I then ordered a MCP73832T-2DCI/OT as the charge current can be programmed with an external resistor, giving me greater control over the charging circuit.

However, while I wait for that to arrive, the MAX1555 seems to work quite well on the old battery phone, which has a capacity of 1100mAh.

A few other things I’ve changed is remove the external crystal from the atmega as soon I’ll be using an external RTC to accurately count time (watch this space for more details soon). I’ve also added an extra button to switch the device on and off.

The new circuit diagram, including the charging block is shown below.

Swim Watch 2.0 Circuit Diagram

Swim Watch 2.0 Circuit Diagram

Software

Battery Level

If I’m going to use such a small battery in the design (or in fact any battery), then it’s important to know the current charge level of the battery.

I’m not too sure what’s the best way of doing this.

What I’ve done at this stage is use the ADC to measure the internal bang-gap voltage of the AVR using the battery level as the voltage reference. There’s some good information on this forum post. It seems that you can use the internal voltage reference, but it’s not very reliable.

In fact, I found the values almost useless and pretty unstable. Also, after further reading online, it seems that there are much better methods of doing this, which I’ll be looking at in the next version.

As you can see below, the battery voltage is showing about 4.062V, when in fact it’s around 3.6. I know that the readings can be calibrated, but I’m still not sure how to use the obtained value to give me the current capacity of the battery, so don’t think I’ll look into that more.

Inaccurate battery voltage reading

Inaccurate battery voltage reading

Power Off

As mentioned above, I’ve added another button for switching the device on and off.

I’ve created a very simple function that powers down the AVR and the OLED display. However, this was just a simple test of the AVR’s “power-down” mode and I’ll be looking into improving the efficiency of device in a later version.

Also, I have no way of measuring the current draw of the device, so I’m unsure of the difference in current draw between the device being on and off.

Coming up…

In the next version I hope to have my new LiPo battery connected, along with the new battery charger, and maybe even the battery charge monitor.

Advertisements