Measuring 50A to 200A using Allegro ACS770 Current Sensor with Robojax Arduino Library

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hi, welcome to an Arduino tutorial from Robojax. my name is Ahmad Shamshiri I'm presenting this tutorial from Canada. and this tutorial are going to learn how we can use this Allegro current sensor ACS 770 they are available in a range of from 50 to 200 ampere. I'm going to test it with 50 amperes this is a serial monitor and this is my load electronic load that is taking 50 amperes 50 ampere the minimum is 50 which I am using now this B means in bi-directional which means you can use it for easy or DC pulse width modulation signal these are the current that I've tested I started when you look at it from the top like this .and now let me show you the wiring I provided the link for the library download it as a zip file now I set it to 30 you can get the code for this by clicking at the link below the video in the description which will take you to www.robojax.com/learn/arduino let's get started with this. Allegro has introduced a lot of Hall Effect current sensors this is one of the famous one that is currently on production ACS770 this is offered in 50 ampere the minimum is 50 which I'm using now 50 100 and / 150 and 200 ampere this is offered like this very simple we have three pins and these two big terminals for connection to the load and series which I'm going to show you in order to make the code very clean I've written library for all Alegro current sensors once you download this library it will work for almost every other Hal effect sensor of Allegro which are analog so this is analog grow ACS seven seven zero AC DC current sensor many people later on will post comment and ask can this work with AC? Can and thus work with DC? yes it will work for AC if you get the B version that it has be bi-directional if you get U unidirectional it will work only with DC this module needs power five volts and ground and entire internal circuitry will have a Hall effect sensor which will measure the current and with five volts and current passes through this it outputs a voltage proportional to the current so you will do the calculation from the voltage so this voltage will represent amount of current that passes and you will use it either displayed on a screen or take action based on the current that you read on the serial monitor or in your program. this is a 50 amp per version this demon bi-directional which means you can use it for AC or DC as you see U then it will be unidirectional but and this is 100 ampere bi-directional and so forth on data sheet which I'm going to review next I'm using now unidirectional which is measuring only DC. this PCB that I've used here if not necessary, you connect it directly to measure the current when you are measuring a DC current for example for a possible modulation signal those that turn on and off the frequency of pulse modulation would might affect the results for that reason you need to create a low-pass filter with a resistor and capacitor in order to get better results which I'm going to show you but if you just measure sample DC current then this is a best option just connected directly and it just needs a sample capacitor between ground and VCC because if the line is long and it might introduce some noise for the system other than that it will just work fine if the wire is very short or it is very closer. Here on aliexpress if you search for ACS770 you will find a lot of options here $2.53 dollars fifty three cents Canadian with some shipping which you receive it in sixty days and also some sellers are selling it and PCB version this is absolute disasters like for 50 ampere, 50 this is not acceptable on the PCB this will not work do not waste your money on this or this one you see they are selling the 50A and connector cannot handle 50 amp a purpose for that reason get this one and use your own (wiring) they've also used here if you see there is an op-amp here they put an op-amp which amplifies the current it and gives you the Unity gain without changing the input and output but for Arduino purpose you do need it because Arduino has very high input impedance and it doesn't need current amplification and here this is the unity gain op-amp that they use here and here the use 130 ohm and 220 Pico farad which is not critical and here on eBay they're selling it like that this could be better because they've wide enough pcb path here and you can connect your big cable but that cable can break this PCB so it's up to you but this is another option that you can get the sold for six seventeen dollars sixty two cents us this is the official development board from Alegro. if you buy it from digi-key this is sold for forty seven dollars sixty five cents Canadian but it is properly prepared and their data sheet I will provide you the link for this as well. Datasheet viewed the further data sheet for Allegro is CS seven seven zero with the CB when the current passes through the device there is a hundred micro ohm resistance in between effect to measure but still there is a resistance through the path the operating voltage can be between four point five to five volts this is available in PFF package PSF package or PSS package like this currently I have this one in my hand. and here we have these three pens and then the current enters it can be AC or DC that the one that I'm testing is the unidirectional which means DC so it will measure only one way and here is the suggested schematic. VCC will be connected to 5 volts ground this ground between VCC and ground put 0.1uF 1 micro farad capacitor to eliminate noise I'm going to test it and show you that it will work without it but for reliability purpose add that capacitor and here that V out is the output that I'm measuring the current using Arduino this voltage is proportional to the current . so I will be connecting this pin to analog zero but for filtering purpose you see RF filter resistor and filter capacitor CF will need it here. you will use a 4.7 or kilo ohm resistor this is 5 kilo ohm this is calculated value so you will get 4.7 kilo ohm and here this capacitor will be 4.7 nano Farad so the output comes through the resistor with a capacitor to the ground and from this point this is the output where you connected to A0 (Arduino) to read it in case of your want to implement this one for many application it will work but you have to change it if you are measuring higher frequency current. These are the models that are available and all of these after this point all of them are the same but here 50B bidirectional 50U if the unidirectional which have been mentioned here when it's when it says bi-directional these are for AC as well and DC but unidirectional is just for DC as you can see for bi-directional they put plus and minus but for your direction it's just 50 and this is the sensitivity for every ampere it generates or outputs 40 millivolts of 40 millivolts per ampere. so these are volts per milli ampere and they have 100 150 and then 200 ampere versions. I will provide you this datasheet but so when you look at it from the top like this this is the V out this pin and then this is a ground and this is a VCC these two are positive and negative that you will connect in terms of DC you will connect your wires here. it needs 10 mA to operate the current supply so this is for 50 B version this chart and here is the 40 millivolts per ampere the minimum is 39.04mV/A the maximum is 42.96 but the typical is this one electrical offset voltage at 25°C plus minus 4 millivolts so keep that in mind. this is at room temperature as soon as it heats up it will go 6mV and the electrical offset voltage drift over time this is the magnetic offset error I've considered this in the library which means we have to subtract 120 milli ampair from the calculation and the total errors plus minus 0.5 so half a percent at 25 degrees and 1.5% at between 25°C to 250°C so this is the module that I'm using now it is 80 millivolts per ampere the U version and the same way we have charts 100 B and then 100U as you can see the sensitivity decreases as the current increases let's lock here 150 it becomes even 13.3mV/A and if you look at it at 200 it becomes ten so meaning the lower currents will be ignored maybe 1 1 ampair even you will not be able measure it properly see 250 mA impair magnetic offset errors 1.5%. 200 ampere is like Wiring Explained this is the electronic load DL 3031 and these are the two terminal that from the circuit will be connected in here and we will see the voltage here and the current. to measure the current between the load and your powerful either battery or AC depending on the type of the sensor you will connect it in series with the load for example in here the positive goes to the positive terminal or the this terminal of this ACS770 and the from the negative it exits and goes to positive and from negative it goes to the battery and the circuit is completed when the current passes through this the Hal effect to the amount of current and we will measure it via these ins wiring diagram of this project is available as part of my Arduino Course on Udemy.com The link to my Udemy course is in the description below this video. if you want to learn Arduino I have a best seller course on udemy where you can learn Arduino from ground up with hundreds of projects all course material library codes wiring diagram everything available in one place. the link for my new courses below this video in the description. this pin from this site is the output it goes to analog zero the middle pin is ground this middle pin is ground ground is connected using this purple wire to ground and the last pin on this side is connected using gray wire to 5 volts this needs to be attached to thick wires something like that for 50 amperes this is 12 AWG wire so I put two of them even though one can handle 60A, I put 2 so 50 ampere goes and comes back and I try to because my cable was a little long about one and a half foot this one or sixty centimeters and this is also short but actually I'm using this of a weg 8 wire very thick but and also to show you and this is the cable that I'm using from my main power supply that supplies 60 ampere so you have to have nuts and bolts to hold it so 50 amp hour or 100-200 it should become much much thicker so you have to look at the proper wiring for that. t was very hard for me to solder it and then finally when I was able to solder it I was worried that if I apply a lot of heat this module might burn because it was that temperature was increasing but after soldering it I tested it and fortunately it was good it did not die. but I had a bunch of it in the back so I was ready in case of something burns so I will have a lot of these. Code explained now let me explain the code if you need for explanation of this code it is available as part of my Arduino course at udemy where you can learn Arduino and get all the code detail explanation library wiring diagram and everything in one place in a structure course the length for my course is below this video in the description. I have provided the link for the library download it as a zip file save it in your computer after that click on a sketch-> include library -> then add .zip library and then pointed to where you have saved the zip file, for example if it was here just go and select it and click open it will be installed after that you can go to File->Examples and scroll down until you see Robojax Alegro ACS Current Sensors and then open this example once you open it this will be the example I've provided you'd all these models it will work for for all Hal effect sensor from Allegro you just need to know your model for example ACS712 they have these versions and then we have have 7 5 8 and then 7 7 0 so select the version that we have we are using this model and our model number is 12 so keep that in mind here I'm defining A0 as VIN pin and then I've measured my VCC it was 5 point 0 4 to get precise value make sure to measure your Arduino is 5 volts and enter it here if you don't know it just put 5 because by default it is 5 and then the model that we select from your model you will select this one 12 the if your voltage is different a little up and down you can put hair comma and then put this VCC you can put a comma and put the VCC here but if your voltage is 5 volts you don't need to put it you can remove it work fine this is where you will get the current but would you robojax.getCurrentAverage and then 300 so this gets the average of 300 iteration with three decimal points so this is a value you can use it for something or take action or if you just want the print it on Serial Monitor, then use it like this. Demonstration let me now demonstrate it. currently the current is zero and you can see on the serial monitor it is showing 0.74 there's a vise half and here the curve you can see it has magnetic magnetic offset of 120 milli ampair or output error of 0.5% so keep that in mind and health now let me go one unpair now it is said that one ampere let me turn it on as you can see this is the actual current that my electronic load is requesting and this is the measurement that we are reading on the serial monitor it's just updating every 500 millisecond so we are reading 920 milli ampair this is 1000 milli ampere let me go with now 5 ampere now this is 5 ampere and here we are reading this value and remember this is 50 ampere current sensor so those lower values are very minimal because we are looking at 50 ampere max so let's go with 10 ampere and her a 10 ampere this is actual and this is the serial monitor of arduino 120 milli ampere deviation now let's go for 20 it is now set to 20 is 20,000 milli ampere and we are reading 19934 so let's go with 30 ampere now I set it to 30 and let me set it to 40 now it is 40 and pair as you can see it's getting very precise at higher current because this is made for higher currents because the other version of this goes up to 200 ampere so same family of seven seven zero now let's go 50 ampere the maximum that this one can measure and as you can see the 83 milli amperes deviation and that also could be due to the currents sensing and had now I'm demonstrating it directly with a module without those capacitors on any any extra components I've just connected that maybe it will introduce a little noise but let's just try to a 10 (10000mA) ampere and here we are reading 9829 so 170mA per deviation because I cannot go further these wires are very thin for this purpose but to show you that this will work so do not worry you can just go directly connected like this I would like to thank my Patrons from Patreon.com you Subtitle Typed and corrected on April 08, 2020 by Ahmad Shamshiri thank you for watching this was how to use this Allegro ACS770 I did my part to help you. Now you can help by subscribing and 👍 up the video. You can support me via PayPal Hall effect 50 to 200 ampere AC and DC current sensors. if you learned something and found this useful please jump up 👍 as this will help my video in the search algorithm of YouTube. if you have comment or question posted a comment section below I try to answer and reply. if you want to get updates of my upcoming videos make sure to subscribe. if you want to learn Arduino I have a best seller course on udemy where you can learn Arduino from ground up with hundreds of projects all course material library codes wiring diagram everything available in one place the link for my new courses below this video in the description
Info
Channel: Robojax
Views: 6,680
Rating: undefined out of 5
Keywords: electronic, tutorial, training, video, robojax, arduino, code, download, project, diy, robot, robotics, afghanistani, canadian, engineer, nejrab, ahmad, shamshiri, ontario, ajax, english, ACS770ECB-200B, ACS770ECB-200U, ACS770ECB-400B, ACS770ECBTV-250B, ACS770ECBTV-250U, ACS770KCB-150B, ACS770KCB-150U, ACS770KCBTV-050B, ACS770KCBTV-167, ACS770LCB-050, ACS770LCB-100, ASEK770LCB, current, voltage, measure, 50A, 100A, 150A, 200A, sensor, library, how to, DC, AC, wiring, pcb
Id: sB6EULTix2k
Channel Id: undefined
Length: 21min 48sec (1308 seconds)
Published: Sun Apr 05 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.