# Using a INA219 to measure voltage and current

**URL:** <https://discourse.nodered.org/t/using-a-ina219-to-measure-voltage-and-current/16407>\
**Category:** Share Your Projects\
**Created:** [7 October 2019 08:04 UTC](https://discourse.nodered.org/t/using-a-ina219-to-measure-voltage-and-current/16407 "2019-10-07T08:04:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [7 October 2019 08:04 UTC](https://discourse.nodered.org/t/using-a-ina219-to-measure-voltage-and-current/16407/1 "2019-10-07T08:04:59Z")

</div>

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](http://resources-area.co.uk/node-red-flows/voltage_and_current_sensors.pdf)

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [7 October 2019 08:48 UTC](https://discourse.nodered.org/t/using-a-ina219-to-measure-voltage-and-current/16407/2 "2019-10-07T08:48:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [7 October 2019 08:48 UTC](https://discourse.nodered.org/t/using-a-ina219-to-measure-voltage-and-current/16407/3 "2019-10-07T08:48:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ERR410\_GONE](https://avatars.discourse-cdn.com/v4/letter/e/dec6dc/32.png) [@ERR410\_GONE](https://discourse.nodered.org/u/ERR410_GONE)\
**Post date:** [21 May 2020 13:02 UTC](https://discourse.nodered.org/t/using-a-ina219-to-measure-voltage-and-current/16407/4 "2020-05-21T13:02:37Z")

</div>

Hi! I a have a question. I found this contrib for ina219 [https://flows.nodered.org/node/node-red-contrib-easybotics-ina219-sensor](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.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [21 May 2020 14:47 UTC](https://discourse.nodered.org/t/using-a-ina219-to-measure-voltage-and-current/16407/5 "2020-05-21T14:47:46Z")

</div>

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.

> **[Enable I2C Interface on the Raspberry Pi - Raspberry Pi Spy](https://www.raspberrypi-spy.co.uk/2014/11/enabling-the-i2c-interface-on-the-raspberry-pi/)**
>
> The Raspberry Pi I2C (Inter-Integrated Circuit) bus can be enabled to allow a range of compatible sensors, screens and devices to be connected. This post shows how you can easily enable the I2C interface using a number of different methods.

  
And here's a photo of the Pi-2 and 3 pinout (I suspect the RPi-4 is the same).  
 ![RP2_Pinout](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/7/071ea15c161306ce517466c2f2dd4b08e2ae7592.jpeg)
