If You Need A Measurement Tool Just Build A Measurement Tool

[Darlan Johnson] was working on a wearable project and needed a way to measure the change in voltage and current over time. 

Most measurement tools are designed to take snapshots of a system’s state in a very small window of time, but there are few common ones designed to observe and log longer periods. It’s an interesting point, for example, many power supply related failures such as resets occur sporadically. Longer timescale measuring devices could pick these up.

[Darlan] had a ton of Feathers and shields lying around, and combined them into the needed instrument. An INA219 current sensor records the measurements. They are then displayed on a TFT and logged to an SD card. Everything is bundled into a neat 3D printed case along with a battery for wireless operation. A set of barrel connectors provide the breakout to split the wires for the current measurement.

It’s a neatly done hack and we can see it as a nice addition to any hacker’s measurement drawer.

14 thoughts on “If You Need A Measurement Tool Just Build A Measurement Tool

  1. its still logging snapshots in a very short window of time, its just doing a bunch of them in succession, sample rate and inherent inductance or capacitance of the measuring device means you may or may not catch what you are trying to catch

  2. I’ve been building similar things, that are like a mix between an oscilloscope and a datalogger. They’re really useful for some specific tasks, and it’s nice being able to hit a button to start/stop recording or when I see a voltage spike on the screen and hit a button to put a mark in the datalog to make it easier to find later. For me the primary problem has been just how incredibly slow the refresh rate is on arduino tft screens. It’s easy to log four channels at 100kHz, but it’s hard to plot four channels at five Hz. If anyone has ideas about better hardware to do real-time X/Y scatter plots I’d love to know about it. This project’s use of a Cortex may help speed up SPI a little, but I’m thinking I may need to move to something with video hardware. I’m currently using adafruit’s tft library, while filling arrays with measurements, then using drawline() to plot the adc vs time.

    1. You might be interested in my project here: https://hackaday.io/project/165236-windows-system-performance-display

      Not because it shows system performance metrics, but because the ILI9341 uses a little hardware trick to show a smooth horizontal scrolling graph with very little draw times. The STM32 only draws two lines for each refresh, as such the TFT is capable of updating the whole screen at well over 30fps. It’s so fast I had to artificially slow it down with delays so the graph didn’t fly past too quickly.

    2. My audio switching uses a 48MHz Cortex M0. It uses DMA to sample 4 audio channel at 38400, compute average, max amplitude to VU dsplay. fft with summing on 2 channels, plotting to LCD in real time and still with CPU cycles left over for each block of data. The plotting is done in bitmap in RAM and SPI with DMA refresh to LCD. If not for the LCD blurry at high frame rates, I could easily do 30PS.

      The secret sauce is tight bare metal code and full use of DMA whenever possible, monochrome LCD (less data). e.g. DMA circular buffer for ADC, DMA for clearing btmap buffer, DMA SPI. With the except of FFT, it is all my code and no frameworks.

  3. Nice project! The INA219 is a great chip to get started, but many applications quickly run into its limits (12-bit, ~2000 Hz, 20 typical µA leakage).

    A bunch of very expensive (10,000+ USD) gear exists, including the awesome Keysight CX3300 family. I created Joulescope as a more affordable, easy-to-use alternative. At $799, its still not for everyone, but easily worth it when you need to optimize the energy consumption and battery life of a target device. It measures voltage and current from nA to 10 A at 2 MHz sample rate, and is specifically designed to keep your target working under all conditions with fast autoranged to prevent brown-out.

    Check it out:
    https://www.joulescope.com/

    disclaimer: I am the creator of Joulescope

Leave a Reply

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