Another cheap gadget: battery capacity meter

Recently, I’ve been browsing ebay for random electronics, and I’ve found a cheap ($4.33) battery capacity meter. Since it was below my $5 “I wont impulse-buy it, I’ll think about it”, i immediately ordered it.

It came today, packed in bubble wrap, and contained a (micro) USB powered meter and a 5W 7.5Ohm load/resistor (measured 7.8Ohm at room temperature). On the left side are four terminals, outer two for the resistor and inner two for connecting the battery. In the middle is 4-digit 7-segment display, cutoff voltage adjustment buttons and three display leds, and on the right side is a micro USB connector, suppling power to the circuit. The microcontroller is probably hidden under the LED display.

The meter is rated for 1.5-12V with a maximum load of 3.1A, so I’ve decided to try it out with a 18650 battery which should power a current of about 0.5A through the provided load. I’v also connected the load and the USB power connector. After powering on it showed the voltage of about 3.79V on the LED display.

Voltage display
Voltage display

Using the (+) and (-) keys, you can adjust the cutoff voltage – this is the voltage when the battery is considered “empty”. Usually, most lithium cells have extra protection circuits, which cut off the power, when the cell voltage is too low, to prevent over-discharging – so you have to consider that when setting the voltage limit.

Setting cutoff voltage
Setting cutoff voltage

Pressing OK starts the discharge process. The display loops between capacity (Ah), current (A) and voltage (V), and shows the current values.

Display while discharging
Display while discharging

I’ve verified the values with my multimeter – the voltage was the same on both meters in all three digits, and the current differed only slightly with the last digit (<1mA difference compared to my multimeter).

Warning:  the resistor gets HOT (>100°C). I’ll probably replace it with something larger or add some heatsinks to it.

I’ve tweaked the cutoff voltage (so I could see what happens when it’s finished measuring), and the display started flashing rapidly and stayed in the capacity display mode.

Finished measuring
Finished measuring

The meter also shows a few error codes, if you mess something up (set up cutoff voltage below the current battery voltage, etc.):

Err1: the battery voltage higher than 15V
Err2: the battery voltage is lower than the stop voltage
Err3: the battery is unable to withstand the load discharge current
Err4: the current is too large (current is more than 3.1A)

Considering the price, the accuracy (within reason of course, my multimeter hasn’t been calibrated in sime time too), and the overinflation of battery capacities in the specifications (eBay sellers, I’m looking at you!), I consider it a nice gadget to have, to test your purchases, before relying on the written spec (eg. “20000mAh” 18650 cell)

Copying a file increasing in size

This is a quick hack, for when I used udpxrec (part of udpxy) to record an IPTV stream to an mpeg file, but instead of saving it to a network share (to watch it with some delay on my OpenElec box), i saved it to a local drive (by mistake). So here was a file, gradually increasing in size, which i wanted on my network drive (to start watching before the actual show/recording is finished). cp of course wont work, since it stops when it detects the end of file (does not detect new data being added, and wait for it), so you need to use something else.

When you think of a file with data being appended at the end, the first thought is “tail -f” (-f = follow and print the data being appended). Since tail only prints the last few lines (or bytes), you need to set it to output from the beginning with the “-c +0” (output bytes starting at the zero-th byte). I also pipe it through pv to follow the progress and copy rate.

So the command is:

tail -f -c +0 /path/source.mpg | pv > /destinationpath/destination.mpg

 

Playing with a cheap ($10) logic analyzer

A long time ago I ordered (eBay) and recieved a very cheap logic analyzer (it came out to be a Saleae clone). I havent really played with it enough, but I decided to test it.

It connects to PC via mini(!)-USB cable, and has 8 (+2 gnd) pins on the opposite end. The label marks it as a 24MHz 8 channel analyzer. I’ve connected it to a USB->RS232 adapter (from an old mini/nano Arduino kit).

Logic connection

I expected it needed some weird Chinese software, but it worked with original software from Saleae (which is nice).

Logic1
Screenshot with data already captured

Capturing data is also very easy – the only two options are sample rate and data capture duration.

Data capture options
Data capture options

After the capture timer is over, the program shows logical levels on a time graph (first screenshot) – it does not seem to autodetect the protocol used. After selecting the protocol and protocol options (mainly the correct pin/s) it also decodes the actual data (“test123” in this case).

Supported protocol decoders
Supported protocol decoders
Async serial options
Async serial options

As it can be seen on the first screenshot, it correctly decoded the data sent via the RS232 adapter.

For $10, it’s a great toy. It probably has some timing/sync issues, and the casing isn’t that great, but for that little money, who cares!