Using a INA219 to measure voltage and current

A very short tutorial (for my IoT students) explaining how to use the INA219 device to measure voltage and current in a circuit.

As with most of my projects, a Wemos D1 Mini is used to provide the control/sensing interface (rather than risking the GPIO pins on a Raspberry Pi).

The tutorial explains how to sense the voltage on the Wemos 3V3 and 5V pins (and the current flowing through a 330 ohm resistor acting as a 'light' load), and then goes on to connect a solar panel to the experiment.

Tutorial guide

6 Likes

Nice Dave, I have had 2 of these laying around waiting for inspiration!

Well now you have it.

Actually, the INA219 will eventually be used on the 'Weather Station' project to sense and report the voltage of the solar panel.

1 Like

Hi! I a have a question. I found this contrib for ina219 https://flows.nodered.org/node/node-red-contrib-easybotics-ina219-sensor . Do you thing that is compatible with raspberry pi 4? I'm new in and i don't have any practise with this. I tried your tutorial it was working with Wemos but I'm not sure about wiring and programming into rpi.

I haven't a clue as I've never used the I2C pins on a Raspberry Pi.

Here's a link that seems to explain what you need to do.


And here's a photo of the Pi-2 and 3 pinout (I suspect the RPi-4 is the same).
RP2_Pinout
1 Like