Hi, welcome to an arduino tutorial from robojax my name is ahmad shamshiri
in this tutorial i'm going to show you how we can measure up to 100 ampere
using this shunt resistor of 50 ampere or 100
ampere 75 millivolts on the lcd screen with arduino
as you can see 60 ampere is taken by the load
and we are reading 60 ampere approximately six tempered with five
percent error
you can get the code for this by clicking on the link below the video in
the description which will take you to www.robojax.com/learn/arduino
let's get started with this
i have separate video explaining this chant resistor fully
and how this works and i have a complete video about that make sure to watch that
video because in this video i'm not going through that
so that is required please watch that if after watching that also make sure to
get the code and watch the video of
introduction to this lcd and make sure that you're able to
display a text on this and download the library once you use
this separately and succeeded and once you use this the video
introduction to this and where we're able to display the
current then come to this otherwise
in this video one you will get a lot of error and issues. there are many ways to measure
current with arduino uh including the different type of
sensors made for this purpose and i have a lot
of videos related to those i try to put the link below this video in the
description but this one we are using this shunt
resistor that is sold separately and this has 75 millivolts rating
and we are going to use analog read of arduino
to read that voltage and do the calculation to display the current or
get the current for other purpose that you want
this shunt resistor is sold for different current rating of up to 500A.
for this shunt resistor there are two versions sold this is
a hundred ampere 75 millivolts and as you can see this is 0.5%
tolerance version and this is the this is a 50 ampere 75 millivolts
same thing but this is smaller and it has plastic so in one on the one
hand this is better because you can install and
attach it to something and this is already insulated
by the smaller connector and 100 ampere because it's twice as much the current
then there is no such thing but it has huge
nuts and you have to have proper wiring for this
the positive goes to the load and comes here and passes
through this shunt resistor to the negative terminal so this is in series
with the load and we will be getting two terminal here
the ground is from the side where the battery is connected
and this side will be automatically positive because the positive goes here
and comes here so this point is positive with respect to this point and
we are going to connect it to arduino to read it
or you can connect it the other way and put the shunt resistor
at that positive terminal and the negative on this side
in this case the positive comes on this side because the battery terminal is
here so this point is positive with respect to this point and
this is now negative so we will be connecting this to arduino
to read it. but anything below 10 ampere this is not
a good choice you will get a lot of error.
Wiring Explained
now let me explain the wiring i'm using electronic load as my load as
the power is connected to my electronic load i'll be
connecting it like this my load is here i will put this
in series between the negative terminal and the load if you want you can also do
it this way i'm doing it this way this is the
electronic load Rigol dl3031 and these are the two terminals
that from the circuit will be connected in
here and we will see the voltage here and the current
as you saw this is this has been connected to electronic load this is
coming from negative of power supply coming
and passing from here and this goes to the
negative terminal of my electronic load. from these two points i've taken these
two wires the side that is connected to the
negative terminal of power supply is my negative
and this side is automatically positive that black wire is connected to this
point to ground and the red from this side
this is a positive this has been connected to A0.
for LCD screen we have four wires here the wires for this lcd have been labeled as
ground will be connected to ground vcc
SDA and scl. ground is connected using black wire to ground off arduino
the second wire is vcc this has been connected to
five volts of arduino this gray is sda it has been connected to A5
and the last one is a purple that is scl it has been connected to this pin
A4 you can also connect it to sda and SCL
at this point and if you're using multiple devices
put a wire from here you can in parallel you can connect
up to 128 different devices. you have to have
very thick cable to handle the current but you have to have very thick cable
to handle the current i'm using a very short
cable here after this point i have very thick cable you see two of them are
connected here in parallel to to handle this and actually for my power
supply this is the cable that i'm using and if you see and compare it with this
you know that this is a very thick cable.
Code Explained
now let me explain the code. we have defined here the constant
integer in pin that is where we read the analog
pin the voltage from the shunt shunt current
is the amount of shunt resistor that you have either you have
to enter here for 50 or 100 or whatever value you have
as you can see this is 100 and i've entered hundred and if you
have 50 just enter 50 that's the value
75 millivolts is entered as 75 do not worry about 0.075 in terms of
millivolts and the correction factor with this
setting that i have 2 is here because of the reference
voltage and this line you have to download
and include it i've explained that you need to watch that video separately i'm
not going to explain it this is for arduino library
this is for liquid crystal library and in this line we enter the i square c
address for the module. for this, this has an address i have
separate video explaining that but for this you can run I2C scanner
scanner you need to run i square c scanner i
will provide you this code just upload it
and once you upload it open the serial monitor
and it will print the address for you. as you can see it shows
0x mean hexadecimal and 2 6 and
that's why i entered here 0x26 and then 16 is number of
characters 2 is number of lines and if you're using 2004 it will work as
well fine just put 20 and then put 4 here
iteration is 30 iteration we are measuring
out of 30 measurement if you want to increase the accuracy perhaps go to 50
but it will be slower voltage reference this is used
internally by arduino 1.1 volts and we have bumped it
in terms of millivolts so 1100 and bit resolution is 10
depending on your module if you have arduino Due and MKR it will be 12 so
enter here 12.
and then debug true is for the debug purpose inside the loop
this is just printing lcd display and put
get current this will send the current
to this point on the lcd
otherwise we send lcd we send 0 0 that's why we are getting that 0 0
when there is no current
Demonstration
and now here is the demonstration as you can see currently it is 50 ampere let me
change the current to 40 ampere
the current is shown here 40 and now we are reading 40 ampere here
with a little fluctuation or variation which is normal for this type of
shunt resistor. Let's go to 30 ampere
now i just put it at 30 and we are reading
about 30 ampere current here
and let's go for 20
and here the current is now 20 ampere and
we are reading 20 ampere on the lcd .let's go to 10 ampere
and lower current we will get slowly a little error
but below 10 is not measurable now pay attention here
because if i go if you want to measure less than 10 ampere then there are very
good sensors for that purpose you can get it
very tiny and you can measure it i have separate video photos the link is below
the video in the description.
let's go
five ampere still still acceptable but perhaps below this
we will get errors
let's go to empire and this is where we get errors
so anything that you want to do measure the current
above 5 ampere and preferably 10 to 50 ampere and there is a hundred ampere
version of it
Demonstration with 100A shunt resistor
and here now i'm connecting the 100 ampere
shunt and changing the code to 100 make sure this is hundred
upload the code and here is a demonstration with hundred ampere 75
millivolts shunt i have to make sure that i have a
surface here that is non-conductive. connected right now the current is zero
as you can see let me go 20 ampere
and turn it on so with 100 amperes we are reading
this value let's go 30 ampere so still
acceptable let's go 40 ampere
right now 40 ampere is being drawn electronic load and
let's go 50 ampere now electronic load is taking 50 ampere
and this is our reading let's go 60 ampere and
right now this is the maximum that i can test with
60 ampere current is being drawn and this is now displaying it
and if you go even 100 perfectly it will display it.
Subtitle corrected and typed on May 21, 2020 in Ajax, Ontario, Canda
I did my part to help you learn. I have spent days on this projects to make it available to you.
You can simply click on Subscribe and thumb up 👍the video
and say simple "thank you" in the comment section below this video.
If you want to donate money, I have PayPal acount link below this video. Thank you.
I would like to thank my Patrons from Patreon.com
thanks for watching this was how to use the shunt resistor with
arduino to measure dc current. if you like this video and learn something
please thumb up 👍 as this will help my video in the search algorithm of youtube.
if you have comment or question post it at the comment section below i try to
answer and reply. if you want to get updates of my
upcoming videos make sure to subscribe.
Extra Clips
i'm going to show you how we can measure any dc voltage with arduino
as you can see now it is 12 volts and we are reading
12 volts and serial monitor i'm going to explain
how to calculate different resistors to measure any voltage
also demonstrate 12 volts 24 volts 36 volts and 50
volts hi welcome to another unit tutorial from robojax in this video we
are going to see how we can use this allegro acs-712 current sensor
to measure the current and display the current on
the 1602 or on this 2004 with four line display module