Voltage Logger Does It The Right Way


The folks over at Adafruit have been busy designing an LED matrix wristwatch for a while now. The circuit works great, but since this watch is powered by a coin cell battery, they’d really like to get the power consumption as low as possible. This means they needed a test rig to measure the consumption of each firmware revision, but how exactly do you build a voltage logger that works with voltages and currents this small? It turned out to be a very interesting project, with plenty of info on how to build an accurate voltage logger for really small projects.

Adafruit’s TIMESQUARE watch is a small circuit board with an ATMega328p microcontroller and an 8×8 red LED matrix powered by a single coin battery. To test each revision of the firmware, the folks at Adafruit broke out their Arduino data logging shield to press the watch’s button once a minute (activating the display) and measuring the voltage of the battery.

The naive approach to logging the voltage on the watch would use a digital pin on the data logging shield to activate the watch and then read the voltage with an analog input pin. This won’t work correctly, though: the microcontroller on the watch is very good at getting the power it needs from anywhere, and connecting it directly to an Arduino would skew the results.

The alternative solution would be to use an optoisolator, but surprisingly the Adafrtuit lab didn’t have any in stock. There’s another way to actuate a button on the watch without any power, though: tri-state logic.

Instead of sending 5 Volts to the pin connected to the watch’s button, the data logging shield instead alternates between input and output. When the digital pin on the shield is an input, the watch sees an open circuit. When the digital pin is changed to an output, current flows from the watch to ground, just as it would without the data logging shield at all.

It’s a neat trick, and for anyone whose eyes glaze over the words. “tri-state output” and “high impedance state”, a perfect introduction to something a little more complex than blinking a LED with an Arduino.

6 thoughts on “Voltage Logger Does It The Right Way

  1. I’m not sure that I understand the point of the article.
    If you call yourself a ” lab “, maybe you need to invest in real instruments like … say … a voltage logger and a µamp meter ?
    Don’t get me wrong, hacking is nice and all, but if you design real products, you need to have some basics gears.
    At my job, we hack to serve a specific need for a specific product. Voltage/current loggers (whatever the sensitivity) are way too cheap to justify the dev costs of a homemade solution.

    Of course, my comment only concern the so called “pros”. For hobbists, the cheaper, the better.

  2. As I stated to read the article. I noted in the right side column was the
    EEVblog uCurrent – Precision nA Current Measurement Assistant. This plus a recording DVM meter would have done the trick…

  3. they use a method that will give a measurement at least 3% off of every other measurement they take, apposed to using grid power which is at irrelevant scale and gives workable numbers to base code optimization off of.

    It doesn’t really matter though, I’ll never use an arduino product just off principle..

    P.S. I think one of these people was an engineering major at M.I.T. ^^ Americans crack me up XD

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.