DIY Power Meter Project with INA226 and ATtiny85
Build a DIY power meter using INA226 and ATtiny85 for accurate measurements.
Description
The DIY Power Meter project utilizes the INA226 high-side power monitoring chip, paired with an ATtiny85 microcontroller, to measure voltage, current, and power, displaying the results on a 128x32 OLED screen. The INA226 communicates via an I2C interface and is programmed with a calibration factor based on the shunt resistance and current register LSB. The project is designed to handle a maximum current of 500mA using a 0.16ohm shunt resistor, which can be adjusted to a 0.2ohm resistor, reducing the full-scale current range to 409mA with a resolution of 12.5uA. The shunt resistor dissipates only 33mW at maximum current, making 1/4 watt resistors suitable for the setup.
The PowerMeter.ino sketch configures the shunt resistance and maximum design current, automatically calculating the calibration factor. The project can be prototyped on a breadboard using an Arduino Uno, employing the Wire library for INA226 and OLED communication, and the u8g2lib library for the OLED display. For the ATtiny85 version, the Adafruit-TinyWireM and Tiny4kOLED libraries are used. The power meter is independently powered by a 3V CR2032 cell, with power switching options including manual switches or DC switched jacks. The low-side n-channel MOSFET switch configuration is tested but introduces voltage drop issues, making manual switching a more reliable option until a suitable DC switched jack is found.
DXZone Technical Profile: INA226 | ATtiny85 | OLED Display | Power Meter