Embedded Computing
  • About
  • Blog
  • Hardware
    • Which Platform?
    • Controller Platforms >
      • Adafruit Platform
      • Arduino Plaform
      • BBC micro:bit
      • Espressif Platform
      • iLabs Platform
      • Raspberry Pi Platform (MCU)
      • Seeed Platform
      • Silicon Labs Platform
      • Teensy Plaform
    • Computer Platforms >
      • BeagleBone Platform
      • Raspberry Pi Platform (SBC)
      • UDOO Platform
    • Peripherals >
      • Shields
      • Grove System
      • Sensors
      • Actuators
    • Displays >
      • E-Paper Displays
      • Reflective Displays
      • TFT Displays
      • LCD Displays
    • Legacy Platforms >
      • chipKIT Plaform
      • 4D Systems Platform
      • Intel Platform
      • LaunchPad Plaform
      • BoosterPacks for LaunchPads
      • LightBlue Bean
      • Maple Plaform
      • Mediatek Platform
      • Microsoft Azure IoT DevKit
      • Particle Platform
  • Software
    • Exploring RTOS with Galaxia >
      • Event Library
      • Semaphore Library
      • Mailbox Library
      • Timer Library
      • Clock Library
      • SWI Library
      • Task Library
    • Ultra-Low Power with EnergyTrace >
      • Ultra-Low Power with MSP430
      • Ultra-Low Power with Energia MT and Galaxia
    • Using Integers Instead of Reals
    • Going Python?
  • IoT
    • IoT Platforms: Which Hardware? >
      • Matter with Silicon Labs MG24
    • IoT Services: Which Solution? >
      • Recommended IoT Solutions
      • Platform-Specific IoT Solutions
      • Other IoT Solutions
      • Not tested IoT Solutions
      • Notification Solutions
    • Get Date and Time from Internet with NTP
    • Fast and Easy WiFi Connection with QR-Code
  • Tools
    • How to Start?
    • Reference >
      • Asking for Help
      • Boards Pins Maps
      • Ruler
      • Boards and Plugs
      • I²C Logic Level Converter
      • Standards for Connectors
    • Training >
      • Texas Instruments Workshops
      • Embedded Systems: Shape The World — MOOC edX UTAustinX UT.6.02x
      • Embedded Systems - Shape The World: Microcontroller Input/Output — MOOC edX UTAustinX UT.6.10x
      • Embedded Systems - Shape The World: Multi-Threaded Interfacing — MOOC edX UTAustinX UT.6.20x
      • Real-Time Bluetooth Networks: Shape the World — MOOC edX UTAustinX UT.RTBN.12.01x
      • Systems Thinking with Texas Instruments Robotics System Learning Kit
    • Books >
      • Getting Started with the MSP430 LaunchPad
      • Getting Started with Arduino
      • Arduino Cookbook
    • IDE >
      • The Battle of IDEs
      • More Options
      • Assessing the Next Generation of IDEs
      • Tools for Documentation
    • Equipment >
      • Saleae Logic Analyser
      • Rigol DS1102E Oscilloscope
      • XDS110 Debug Probe with EnergyTrace​
      • Segger J-Link Programmer-Debugger
      • Nordic Power Profiler Kit II
  • Projects
    • Libraries >
      • Master I²C Software Library
      • Date and Time Library
      • highView Library Suite
      • Others Libraries
    • smartDevices >
      • I²C smartColours Smart Sensor
      • I²C smartRFID Smart Sensor
      • I²C smartLED Display
      • I²C smartControls Smart Device
      • I²C smartWiFi Smart Device
      • I²C smartBLE Smart Device
      • I²C smartNode Smart Device
    • IoT Projects >
      • Remote E-Paper Weather and Message Board
      • Typie-Walkie with LoRa and E-Paper Screen
      • Typie-Walkie with E-Paper Screen
      • Remote e-Paper Pictures Panel
      • Remote e-Paper Messages Panel
      • Industrial IoT Project
      • Remote Contactless Temperature Monitor
      • Using Node-RED for IIoT
      • Low Power Home Network Weather Monitoring
      • Updated Low Power Home Network Weather Monitoring
      • Weather and Security Station with Blynk
      • SensorTag to Blynk Using Node-RED
      • Pervasive Reporting
    • AI Projects >
      • Colour Recognition with Neural Network
    • Other Projects >
      • Air Quality Monitoring
      • Driving a Large E-Paper Display with a Compact Xiao RP2040
      • Low-Power E-Paper Weather Station
      • Portable Particulate​ Matter Monitor
      • FRAM-based E-Paper Screen Controller
      • General Purpose 3.5" Screen
      • Colour Recognition with Neural Network
      • A Low Power Weather Station
      • Digital Volt-Amp-Watt Meter
      • Mobile Measurement with LCD Display
      • Screen with SRAM for GUI
      • Volt-Amp-Watt-Meter for Grove
      • Multi-Touch Project with CapTIvate

I²C Voltage-Current-Power INA219 Sensor

Lower power consumption is the next frontier, but how to measure it? Using many sensors and actuators may easily overload a voltage regulator. 

The INA219 is an all-included voltage-current-power sensor. It uses the I²C bus.

I built this Volt-Amp-Watt-meter with a MSP430G2553 and Energia.
Picture
Current is calculated using a shunt, in my case, a 0.1Ω 1% resistor.

The INA219 does all the calculations for the power itself, by multiplying voltage by current internally. ​
Picture
The only remaining operations concern the scaling.
Code Editor

    
The package is a SO-8 with a 0.05" or 1.27mm pitch between pins. 

A basic support makes it easy to use with a standard 0.1" prototype board.
Picture

Library

An INA219 object is declared and initialised by begin(). 
Code Editor

    
Acquisition and retrieval are separated.

Acquisition for all values is done by get(), while there are as many functions as measures, with mV(), mA() and mW().
Code Editor

    

Two Applications

I designed two applications.

The first is a V-A-W-metre displayed on a terminal windows connected through serial/USB to the LaunchPad. Minimum and maximum are monitored for each of the three measures.

The push button selects between V-A-W and mV-mA-mW, resets the minima and maxima, and exits.

This application comes with the library and requires only

Binary sketch size:  6312 bytes (of a 16384 byte maximum)
Estimated SRAM used: 232 bytes

Picture
The second application I've explored uses a 128x64 high-contrast white-on-black OLED screen.

The push button selects between V-A-W and mV-mA-mW, resets the minima and maxima, and changes the decimal separator between point and coma. 

I built two versions:
  • one self-contained on a box, the Digital Volt-Amp-Watt Meter ;
  • another for the Grove system, the Volt-Amp-Watt-Meter for Grove.

Picture

Picture
Picture
Picture
Picture
The different screens, from left to right: splash screen, measures in mV-mA-mW, measures in V-A-W with point and comma as decimal separator.
Picture
Picture
Picture
Picture
Selecting the function with the push button, from left to right: ./m. change of units, =0 reset, ., decimal separator, __ cancel.

Links and Download

  • Texas Instruments INA219 page
  • Thread at 43oh forum
Powered by Create your own unique website with customizable templates.