Current + voltage sensor INA219 with TinkerPie
Measure how much power a motor or solar panel uses.
| Type | Smart sensors (I2C) |
|---|---|
| Connect to | SENSOR port · 0x40 |
| Gives | V and mA |
| Simulator | Yes: a control appears under the simulated board |
How it works
The INA219 measures the small voltage across a tiny resistor (a shunt, 0.1 Ω) placed in the power wire. From that it works out the current, and it also measures the voltage, so you can calculate power (watts = volts × amps).
How to wire it
Plug into any SENSOR 1-4 port (SDA, SCL, 3.3 V, GND). Each type has a fixed I2C address, so different types can share the bus.
Code
In blocks: Accessories category in TinkerPie Studio. As code:
// JavaScript
sensors.powerVoltage()
sensors.powerCurrent()
// Arduino C++
sensors::powerVoltage()
sensors::powerCurrent() Good to know
- Measures up to 26 V and about ±3.2 A with the standard shunt.
- Uses I2C (address 0x40).
- Put it in the positive wire, between the supply and the device you measure.
Similar modules
- Light meter BH1750
- Temperature + humidity AHT20
- Temperature + humidity SHT31
- Motion sensor MPU6050
- Colour sensor TCS34725
- IR thermometer MLX90614
- Real-time clock DS3231
- 4-channel ADC ADS1115
More projects to try
Questions
Can I try the Current + voltage sensor INA219 without buying one?
Yes. In TinkerPie Studio the simulator shows a control for it under the board, so you can test your program before you build it.
What can I learn with the INA219?
How much power a motor uses at different speeds, how much a solar panel makes during the day, or how long a battery will last.