I add one more led as a load and now we
will see that current is increasing so
with the power
welcome back to miliohm.com in this
video we will learn how to use INA219
current sensor and we will
try to make an DIY wattmeter so this
is the INA219 current
sensor this sensor used a shunt
resistor to sense the current that
flowed through it, besides current
the sensor can sense voltage too, hm
interesting
this sensor interfaced with another
device like arduino using I2C
communication so there are SCL and SDA
and we can change the address of this I2C devices it means that we
can connect more than one of the sensors to an arduino on the backside we can see
it's short specification of this sensor
and here's the more complete feature
so let's solder the sensor
now let's connect the sensor to arduino, take a look at wiring diagram
connect the sensor to arduino just like the diagram
and then we add and LED as a load and we will read how much current drawn by this LED
just like another sensor we have the download library at first we can download
manually or we can download using library manager just search for INA219
and download the library now open the
example sketch from the library open the
file named get current upload the sketch
and now we can read bus voltage, shunt
voltage, load voltage, current and even
power
you can also make this sensor more
accurate you can do this by set the
sensor range to smaller value wait
before we continue this video please
subscribe and turn on the notification
to make us more excited to make another
video there is two option first you can
set the maximum voltage to 32 volt
and maximum current to 1 amp just
uncomment this line or you can set the
maximum voltage to 16 volt and 400 mili ampere maximum current this
will make the sensor a way more accurate
you can use this if your project need to
sense a small load and need more
accuracy
now we will try to make a wattmatter
by display the voltage, current and
power to an OLED display now we connect the OLED display to arduino like
this writing diagram
you can copy the sketch from my blog
link in the description copy the entire
code of DIY wattmatter arduino code you can paste the code in your
Arduino IDE and now just upload the code
and this is the result
so this is the end of the tutorial on
how to use the INA219 current
sensor don't forget to subscribe like
and share this video to your friends see
you in another video bye
 
