Corrections and additions: . Ohms law was used wrongly (kzbin.info/www/bejne/eZiQZXqggcqYd6s ) - This video is about DC sensors (albeit some of them measure current in both directions). - The video about AC sensors is here: kzbin.info/www/bejne/jJOcXqOYgcmmnLM - The INA219 can measure currents in both directions
@-Gadget- Жыл бұрын
Just came to check if you corrected that the Ina219 can measure in both directions, and was pleased to see it 👍🏻 I have what I call a "Micro Solar Setup" that runs 4 of these modules for 2 solar panels charging 2 x 12v on each panel/solar charge controller, which I then series'd up to give me 24v. I did it this way so that I could have "Roughly" 24v on a rather long, but flimsy power cable, that supplies all the routers, fibre and switches which have buck converters down to their applicable voltages. Works like an absolute charm, although currently I may have to add another set of panels, as, I am drawing as much as I put back daily 😔 I suppose this is what happens when you get carried away with IOT, and just keep adding more stuff to the already burdened system 😂😂😂 I love those INA219's by the way, they are super useful, easy to use and their accuracy just blows my tiny little mind most of the time 👍🏻
@NikitaOlenets Жыл бұрын
I second this. I have micro solar mppt charger for my garden measurements. Using INA3221 I had no issues with current flows in both directions (charge/discharge cycles)
@NathanSweet Жыл бұрын
18:04 "mA per mA" -> "mV per mA" :)
@PolarisLP Жыл бұрын
At 3:05 the current is wrong. It should be 10A instead of 100A. Narration is correct, shown equation is incorrect. Calculated result is correct if 10A is considered. (kzbin.info/www/bejne/eZiQZXqggcqYd6s)
@johnwest7993 Жыл бұрын
Thank you Andreas. You often save me from wading through the datasheets of inappropriate devices and board modules, and wasting my time looking for what I need. A 22 minute video brings me up to speed on the commonly available sensors, and their pros and cons. This is one such occasion.
@AndreasSpiess Жыл бұрын
Glad you liked the content. And thank you for your kind words!
@CNCKitchen Жыл бұрын
Perfect timing and great overview and explanation! Exactly what I need for my smart home water level sensor 👍
@AndreasSpiess Жыл бұрын
Maybe you also watch my videos about water level sensors? BTW: I like your channel a lot!
@mahudson3547 Жыл бұрын
The INA219 sketch you used does have the voltages back to front. Your rant at 13:35 - the 219 allows the difference between bus and load to be both positive and negative, so it can measure current in both directions - very useful. I think your comment at 15:26 is therefore not accurate. It’s one of my favourites.
@AndreasSpiess Жыл бұрын
You are right. My mistake!
@bubbaganoosh13879 ай бұрын
Thanks again Andreas! Bought the INA3221 for my solar project. Was originally going to design myself. But you saved me so much time. You're the best!
@AndreasSpiess9 ай бұрын
Thank you. Glad the video was helpful.
@636Swiss Жыл бұрын
Detailed instructions and specifications don't get any better than what Andreas presents!
@AndreasSpiess Жыл бұрын
Thank you! I am honored.
@andamodeming274 Жыл бұрын
Thanks!
@AndreasSpiess Жыл бұрын
Thank you for your support!
@mathom100010 ай бұрын
French new embedded engineer here. I just discover your channel Andreas. I must have listien to this video 6 times by replaying back some portion of it. Great content. Subcribed!
@mathom100010 ай бұрын
I am so enjoying the content of this video that I needed to say it back again! Thank you!
@AndreasSpiess10 ай бұрын
Welcome aboard the channel!
@wktodd Жыл бұрын
Watch out for a catch with the hall sensors - magnetised screws! I chased around for ages trying to find and null drift , only to find that every time I tightened the screws my magnetised screwdriver was changing the field around the screw and effecting the hall sensor
@edinfific2576 Жыл бұрын
You could try plastic screws.
@AndreasSpiess Жыл бұрын
Thanks for the tip. A mistake that takes some effort to discover. But I am sure you learned something ;-)
@wktodd Жыл бұрын
@@edinfific2576 or Brass , which was what I expected in a terminal block
@marcseclecticstuff9497 Жыл бұрын
I'm using a handfull of them on my boat to monitor the currents of the alternators, battery charger, solar panels, and house buss. My solution to the stray magnetic field issue was to incorporate a calibration screen that allows me to change the error offset values for each on the fly. I measure the current with a DMM, then jump to the calibrate screen, select the appropriate source, and simply change the value until it matches the measured value. I'm in the middle of developing my battery management system for my boat so I haven't done much testing on long term stability nor accuracy of them over the range. The accuracy issue isn't a big deal. I've got 20A, 50A, and 100A sensors to improve precision/resolution on the smaller ranges where it's more important. In the end, it's not a big deal as I'm using a microcontroller so I can easily expand my simple error offset value to a table with as many offsets as I need. In my case high precision isn't really needed. If I find there's a stability issue over relatively short periods then I'll design a method of auto-calibration. FWIW, I had a similar issue with measuring voltages with the Arduino Mega that I'm using for this project. They too were very unstable, I found I was constantly chasing them around over the space of an hour or two. Finally tracked it down to the fact the Mega was running off the boat batteries, as the battery voltage dropped it caused the 5v supply change. Since the ADC of the Mega defaults to the 5v supply as a reference, it constantly changed as a result causing the instability. I solved the issue by incorporating a precision voltage regulator and fed the Mega VRef pin with it.
@critical_always Жыл бұрын
After being educated as an electrical engineer in the eighties I ended up in IT and now more low level stuff and Robotics. Obviously my knowledge is stale. Your back to basics with a modern twist is exactly what I need.
@AndreasSpiess Жыл бұрын
Cool. Similar here. Trained in the 80s and returned after the age of 55...
@Some11 Жыл бұрын
The ACS712 is a wonderful chip and it helped me in a big project. I was measuring mains at 230 Vrms in up to 20 Amps (tested). The inner resistance of the ACS was so small (
@AndreasSpiess Жыл бұрын
Thank you for sharing your experience! This video is focused on measuring DC, and I left a link to a video about AC sensors. There, as you describe, some other problems have to be solved...
@2meters2 Жыл бұрын
I have similar good experience with these little Hall devices for my (kW range) power boards. They are remarkably reliable, pretty accurate, bi-directional, fast and fully isolated. Those properties solve a lot of issue in the design of power converters. I most often use the TMCS1107 devices (op to +/- 22 A) which are very similar to the ACS712 series, but a bit more accurate.
@dennisfahey2379 Жыл бұрын
Very well done. One must also keep in mind temperature stability and drift and the concept of dithering in quantization. Resistors must all be 1% and for really important accurate measurement, consider a precision, temperature compensated voltage reference. Finally be sure to characterize the wiring/connector drops on any voltage measurement.
@AndreasSpiess Жыл бұрын
I agree with all your additions!
@jeffro. Жыл бұрын
Thanks for addressing all those points in the beginning, like implementation issues, high/low side monitoring, etc. Unfortunately, I think most of the viewers missed a lot of it, or just didn't understand. (Judging by comments) I thought you did a great job explaining it! Maybe they just need to watch again, or even a few more times? Good stuff. Thanks for the comparison of all these sensors. And for pointing out a couple that have "gotchas." I might not have noticed that before buying, because I would assume they made sense, like not having 3 sensors measuring the same load!
@AndreasSpiess Жыл бұрын
Thank you for your feedback. I like people who watch my videos not understanding all. They are ambitious and want to learn ;-)
@bm830810 Жыл бұрын
6:00 you dont need negative opamp for this, you can use a divider and bias input of the opamp with a positive voltage, then the negative voltage would add to that and the resulting voltag could always be poisitive
@AndreasSpiess Жыл бұрын
Also a good possibility if you pay attention to the ground of the MCU.
@kierancampbell3322 Жыл бұрын
Good catch on the variants of the INA3221 breakout board available from circuit designers with strange ideas. I agree with other comments though that some of the TI shunt sensors can handle reverse current sensing. From the datasheet: "VIN+ and VIN- can have a differential voltage of -26 V to +26 V; however, the voltage at these pins must not exceed the range of -0.3 V to +26 V". The datasheet shows an example of reading a -80mV shunt voltage from the CH1 shunt-voltage register.
@AndreasSpiess Жыл бұрын
You are right. The INA3221 can measure both directions. My mistake!
@marcmillecam613 Жыл бұрын
Ohms Law is I=U/R and not I=UxR as said in your video at 1:42
@AndreasSpiess Жыл бұрын
You are right. My mistake!
@Paul_Poanie Жыл бұрын
Das sollte/darf nicht passieren!!!! Schulnote 6!!
@MikesCarInfo Жыл бұрын
Nice Pointer!
@AndreasSpiess Жыл бұрын
Thanks!
@stevejagger8602 Жыл бұрын
Danke viel mal Andreas This video came at precisely the right moment as I am trying to implement overcurrent sensing on a 2 cell lithium ion powered project.
@AndreasSpiess Жыл бұрын
Good luck with your project!
@sarahjanegray Жыл бұрын
Your a wizard, Andreas. I've been playing with the idea of using a current sensor with LIFEPOv4 batteries to power and possibly then shutdown a Pi and been looking at creating a circuit to create an effective UPS with a couple of cells. So your video is very timely. I had already purchased a couple of the INA219 boards as this was what was used on a Pi UPS board that I managed to fry! So was particularly at using this chip. Thanks for your info and cross-sections of boards out there. I think may have chosen the right option! Thanks, as ever for your useful info.
@AndreasSpiess Жыл бұрын
I am sure the INA219 is a good choice. Other than I said, it can also measure negative currents. So you could even measure battery charging ...
@rickharold7884 Жыл бұрын
Beautiful. I had in the past looked at all these types of sensors, and it’s always very difficult to determine which ones are appropriate. Thanks for sharing
@AndreasSpiess Жыл бұрын
Glad you liked the content!
@taoufikbadri6959 Жыл бұрын
As always, interesting subject, explained precisely, maximum informations popularized with tact and generosity while remaining short and precise. Thank you Mr.
@AndreasSpiess Жыл бұрын
Glad you enjoyed it!
@fir3w4lk3r Жыл бұрын
One advantage of sensors with analog output is that you can use them in a analog closed loop.
@AndreasSpiess Жыл бұрын
I agree.
@shodanxx Жыл бұрын
Is the response time fast enough ? For instance for current limiting a high power (10W) LED at 500khz ?
@AndreasSpiess Жыл бұрын
@@shodanxx You have to consult the datasheet.
@OmarMekkawy Жыл бұрын
I think that the INA219 and all similar modules can measure bi-directional current without any problem.
@BeercanSailOr Жыл бұрын
Correct. It can measure both charging and discharging of a load, i.e. current either way
@AndreasSpiess Жыл бұрын
You are right. My mistake!
@NathanSweet Жыл бұрын
I work for a long time on a project (so far: ESP32 I2S MCLK and current sensing), figure out some things, and only afterward do I come across your excellent videos on the exact same topic. One of these days I will look for a video from you first! FWIW, I appreciate the reviews of the ICs specifically. I make PCBs so don't need breakout boards, though they can be useful to test and dissect. I ended up with a hall sensor for isolation (TMCS1101-A4, 5V version for max sensitivity, my load is ~100-200mA, 24VAC). Also had to figure out an RC filter (R1K, 300nF) and a better ADC than the ESP32. Hall sensors have a lot of HF noise, the RC filter is required to make any use of it. I don't think being inline means a hall sensor has a burden voltage. It's just how the IC routes the trace under test very close to the hall sensor. High amp ICs require special consideration for thermal dissipation. I found many users on the TI forums talking about their burnt ICs. It should be possible to do it right though. Anyway, nice video! Thanks!
@AndreasSpiess Жыл бұрын
Searching KZbin is always a good choice if I start a new project ;-)
@toastrecon Жыл бұрын
Interesting - I was just thinking that if you were measuring small currents, and you wanted to use the inductive clamp method, maybe you could wrap the wire 10x around the lead and then just divide the measured current by 10? (Or however many loops) Also, this is awesome! I’ve tried measuring voltage and current with an Arduino in the past, and have had mixed results. This should help.
@AndreasSpiess Жыл бұрын
Yes, you can wrap the cable around the measuring loop and do the division. I do this often to increase sensitivity.
@willgilliam9053 Жыл бұрын
for clarification, the INA219 can be used to measure current in both directions. I have used it before to measure positive amps (discharging battery) and negative amps ( charging battery) in a project before. Measuring the current is a matter of identifying which side the voltage is lower... thats the direction of flow.
@AndreasSpiess Жыл бұрын
You are right. My mistake (I pinned a comment with the correction)
@Fernando_S Жыл бұрын
Around year 2000 I had to measure current in a project and I used a similar approach shown between 5:00 and 6:00. Back then I didn't have the option to buy a INA219 module. After the rectification and filtering of the power supply, only the op-amp was powered. Then I put a diode on the negative rail creating a voltage step (0.6 - 0.65 V) to the remaining circuit. This way I created a negative supply for the op-amp. It was not a symmetrical supply, since the positive rail is the same for the entire circuit, and the negative rail was only a diode drop from the main circuit. But it worked since the voltage drop on the shunt resistor "fitted" inside the voltage drop of the diode.
@AndreasSpiess Жыл бұрын
Good idea! Creative.
@knussieisbar317 Жыл бұрын
Voll cool, danke Andreas, Ich bin seit zeiten auf der suche nach einem guten Modul, ein guter Vergleich hat mit noch gefehlt.
@AndreasSpiess Жыл бұрын
Dann hoffe ich, dass du das richtige findest!
@helmuthbecker7636 Жыл бұрын
Hi, my teacher always recommend your vídeos
@AndreasSpiess Жыл бұрын
He is a wise person ;-)
@Lampoonlongtails Жыл бұрын
I've always enjoyed your presentations, and occasional jokes. A critique/recommendation. When mentioning the shunt resistor in the multimeter being "smaller", while I understand exactly what you meant, "smaller" may have been interpreted by some, as a physically reduced size, and not, reduced resistance. Perhaps, "of less resistance" or "lower resistance", would have been better. As always, great presentations! You're someone, I wish to emulate. Inspirational!
@AndreasSpiess Жыл бұрын
You are right. However, "smaller" resistor is a common expression in electronics. The answer of ChatGPT: When someone mentions a "smaller resistor," they are indicating that it has a lower resistance value, which means it allows more electric current to flow through it compared to a resistor with a higher resistance value. Conversely, a "larger resistor" would have a higher resistance value, impeding the flow of electric current to a greater extent.
@Lampoonlongtails Жыл бұрын
@@AndreasSpiess I have learnt something important. Don't rely in advice from ChatGPT! 🙄 It's obvious, a 100k surface mount resistor, MUST be bigger, than a 10 ohm 1/4 watt through hole resistor. 😏 Regardless, your presentations are excellent! 👌
@cccmmm1234 Жыл бұрын
INA226 can measure negative shunt voltages ie negative current.
@AndreasSpiess Жыл бұрын
You are right. My mistake!
@cccmmm1234 Жыл бұрын
@@AndreasSpiess no problem. Everyone makes mistakes unless they do nothing!
@cccmmm1234 Жыл бұрын
Very fortunate for me, I was just researching this.
@AndreasSpiess Жыл бұрын
So maybe you saved some time ;-)
@cccmmm1234 Жыл бұрын
@@AndreasSpiess it helpedms avoid researching some things that would not have helped. Ina226 fits my needs perfectly. I am using it with a 1khz loop.
@pldaniels Жыл бұрын
After going over a lot of options I ended up going with the INA237 due to availabilty, cost and simplicity. Coupled with an Attiny212 and i2c LCD made a nice USB-C volt/current meter with PC data link. It's a nice chip and only a small programming change from the INA219 but with greater common mode and resolution. Worth having a look at.
@AndreasSpiess Жыл бұрын
You are right; the newer "models" of the INA family are attractive. And some seem pin-compatible. You can use the same Chinese boards and change the chip...
@pldaniels Жыл бұрын
@@AndreasSpiess when I saw Apple was moving to 28V USB-C modes I had to move from the INA219, that basically was the only reason I did the redesign and move to the 237; the 219 certainly provided a perfectly good platform and still does.
@qchatgreg Жыл бұрын
informative and accurate as always. i would have liked to see a little more explanation of “high side” & “low side” measurements.. and when /why you might use each…. also a slightly better explanation of “common mode” voltage specs and where/why this is V important if using it on high side. ive heard a lot of users on forums burning up chips because they used a “low side” spec chip for high side measurements…. not realising that its NOt the shunt voltage thats critical when spec’ing it for high side.. i use a lot of INA226 (in “24V systems”) … a lot of users “forget” that a 24V system will commonly see 29V when batteries are charging … (similarly for 12V systems … 14.5V ++)
@AndreasSpiess Жыл бұрын
The most important word of a (good) KZbinr is "no" to keep the videos short enough ;-) The mistakes you mention can be avoided by my favorite word: RTFM. And: Sometimes, smoke from a defective part is good for learning (I know what I am talking about).
@avejst Жыл бұрын
Another great video Impressive and interesting test as always 😊
@AndreasSpiess Жыл бұрын
Thank you!
@InssiAjaton Жыл бұрын
I seem to remember one old application note describing use of a floating differential sampling and storing front end. In principle, it had a 2-pole, 2-throw relay and a capacitor that stored the sample, then delivered the stored voltage to the amplifier input, when the relay changed state. Of course the relays are not a favored thing in the era of all solid state systems. Yet, an interesting addition to the collection of different topologies.
@AndreasSpiess Жыл бұрын
Most of the current ADC have such a "Sample and hold" architecture built in. So the learnings of the past are used in a different implementation
@bascomnextion5639 Жыл бұрын
The INA228 and INA229 are very nice sensors measuring current in both directions also having voltage , current , power , energy and temperature registers working up to 85v.
@AndreasSpiess Жыл бұрын
Good to know. Thanks. Unfortunately, I did not see them on breakout boards :-(
@bascomnextion5639 Жыл бұрын
@@AndreasSpiess The INA226 is on break out boards but only 36v but same pin out as the INA228 so can be swapped on the board if you have a hot air station. I have designed a board to take them with 200amp shunt , 48v to 5v isolated converter and I2C isolator for my 48v off grid. Stuart Pittaway has boards and code for Arduino .
@jameswkirk Жыл бұрын
Another good choice is the Texas Instruments AMC1302. It's a galvanically isolated op amp designed to sense current through a resistor with ±50 mV burden voltage. It needs two power supplies, one isolated, but that can be done with a small transformer, a square wave (Arduino TONE using a spare pin) diode and capacitor. Working isolation voltage 1500 VRMS. They also have an AMC1311, with a 2 volt high impedance input designed to measure voltage with the same galvanic isolation. Both have ~100kHz frequency response. I've used them to make efficiency measurements on high power audio amplifiers by monitoring the voltage and currents of the mains supply and amplifier output.
@AndreasSpiess Жыл бұрын
Thank you for the info!
@TheMason76 Жыл бұрын
Schöne Übersicht über Stromsensoren ..... Weiter so ... Auch mit dem Akzent 😉😉😉 Echt tolle Videos
@AndreasSpiess Жыл бұрын
Vielen Dank!
@rastikw Жыл бұрын
I'd add SCT013 clamp sensor, it's easy to use and you can choose from many versions, depending on the current and precision.
@smaroukis Жыл бұрын
looks like this is a current transformer based sensor so that will only work on AC, I think this video was specifically directed at DC (using hall effect and shunt resistors)
@rastikw Жыл бұрын
You're right, I didn't realize that DC was the goal. I always used it for AC and actually never thought this method cannot work on DC. Good catch, thanks.
@dwagner6 Жыл бұрын
If you use a very small Rsense, the first three chips are very capable at higher currents. It is very common to use 0.1 or 0.01 ohm Rsense.
@AndreasSpiess Жыл бұрын
I agree.
@ArgusRosenhaim Жыл бұрын
Hello, nice video and very well explained as always. Just to confirm, you mention that the sensor doesn’t support reverse current, but at least for for INA219 I know that it does measure both directions. I have a setup where I use a solar charger to a Li-ion, where the sensor is in series to the battery, and I can see positive current values when it’s charging, and negative when it’s discharging the battery.
@AndreasSpiess Жыл бұрын
You are right. My mistake!
@Wayde-VA3NCA Жыл бұрын
Thanks Andreas! A great overview on current monitoring modules and very timely too! I'm looking at a project to remotely monitor and control some 12V(nominal) fused circuits for an amateur radio setup. Are you aware of any modules that can reliably/safely switch 12VDC up to 50A for the main, and as much as 25A for a branch that may have a 100W transceiver on it? I might just have to go with automotive relays and a driver circuit, or figure out a suitable high side MOSFET switch circuit, but I was hoping for a nice easy to use module! 😂
@AndreasSpiess Жыл бұрын
For my new remote station (Flex6600), I use DC solid-state relays (shown in one of my last mailbags, if I remember right). I do not want to have a mechanical relay on 24/7. For the current measurement, I use the BMS function.
@thomasblock3117 Жыл бұрын
Hi Andreas, very good overview, also you use Hall sensors, but I'm missing XMR sensors like TMR sensors. They are much more accurate. Any Plans for TMR? Best regards Thomas
@AndreasSpiess Жыл бұрын
I never heard of these sensors. They seem to be interesting for high-accuracy applications. Are they already available for the Maker budget?
@johnmoser1162 Жыл бұрын
Great stuff ... Andreas do you care to present some longer distance radars (100-200m) like used for collision avoidance in cars ?
@AndreasSpiess Жыл бұрын
So far I did not see them in a reasonable price range :-(
@MaxintRD Жыл бұрын
Right on time! I'm on a project where I want to measure voltage and current of a 90V solar panel. The INA219 only goes up to 26V, so I'm curious to see what alternatives you're reviewing. Going to watch it now!
@greekstraycats Жыл бұрын
I am also used to INA219. 26V is good for my purposes. But also curious now about alternatives.
@piotrswiatkiewicz3259 Жыл бұрын
Use a voltage divider and multiply the result. It should work very nicely.
@AndreasSpiess Жыл бұрын
90V is a high voltage! And a big panel;-) The solution of piotrswiatkiewicz3259 might work (you need 2 quite stable voltage dividers)
@MaxintRD Жыл бұрын
Hello@@AndreasSpiess The panel is actually not that big. It is a used GS-55 by GS-Solar. It's some sort of copper based thin-film PV in a glass panel. It originally promised 55 Wp and has a Vo of 86V, relatively high compared to traditional silicon based PV's. I intend to make a power monitor to see what it actually delivers and to see what can be improved. Your video came just at the right time! Thank you and thanks to @piotrswiatkiewicz3259 for the great suggestion.
@AndreasSpiess Жыл бұрын
@@MaxintRD BTW: I still remember your music library ;-)
@guatagel2454 Жыл бұрын
Thank you, Andreas. Have you ever used a Rogowski coil to measure alternating current?
@AndreasSpiess Жыл бұрын
No. I had to google it ;-)
@dougcox835 Жыл бұрын
Something you did not address here is frequency response. Normally all you need to measure is low frequency like 50/60 Hz, but sometimes you need to measure much higher frequencies and the resistor types are the only ones with any real higher frequency response. And the stuff I was measuring was only in the kHz range. Not really RF frequencies.
@AndreasSpiess Жыл бұрын
I agree. These sensors are mainly used for DC. I left a link to a video where I covered AC sensors. So far, I did not cover higher frequency measurements as this is not mainstream business...
@twr46418 ай бұрын
This episode is awesome as always - many thanks. Would you mind covering the *new* INA3221 that you just mentioned in this video (since you did not have it back then)? It seems to be a great fix over the old INA3221 design and capable of measuring different voltages. I searched all day but just found „mods“ to fix the old design yet no docs about the new board design and the mysterious two GND pins. The new INA3221 seems to be perfect for monitoring solar charger systems and apparently is used for this purpose already. Covering it would be of great interest to many, especially since this topic seems not be covered yet anywhere, and INA3221 are both readily available and cheap. I simply can’t wrap my head around how to wire up the new version (lacking your experience). Any hint greatly appreciated. Many thx!
@AndreasSpiess8 ай бұрын
This is just another board, not a differenct chip. So no stuff for a video :-(
@twr46418 ай бұрын
@@AndreasSpiess ok I understand. Thanks!
@BerndFelsche Жыл бұрын
I've used a current transformer to measure AC . That clips a ferrite core over a power cable of an external device and provides an AC voltage signal with amplitude proportional to the current... Usually DC biased so that no negative voltage is seen as the microcontroller. It's instantaneous current so the AC has to be measured rapidly to determine the average current. With some software trickery, and assuming that the load is sinusoidal, you can play software tricks to measure the voltage at a certain angle after zero crossing. That avoids lots of number crunching. One can adapt to AC frequency at startup and any drift in phase offset over time by monitoring the zero crossing voltage at the expected time... Sort of phase-lock. If you need true RMS then it's calculation intensive. Most of the time you don't need it for control purposes where you wish to avoid damage through over-current. The phase-point measurement could be sufficient in many application where it can react at 4 times the AC frequency, if you choose.
@AndreasSpiess Жыл бұрын
The sensors shown here are mainly for DC. I made a video about AC sensors and put a link in the description. Usually, you do not only want to measure current but, as you describe, also want voltage and phase shift for AC sensors...
@frogandspanner Жыл бұрын
2:54 Do you like your multimeter? Have you reviewed it previously?
@AndreasSpiess Жыл бұрын
Yes, I like it, and I have it for a few years now. I do not do reviews on multimeters (not so important for me).
@kareemumanami3075 Жыл бұрын
Hello. Awesome video. Please what sensor would you recommend for a large scale use, say for instance measuring all appliances in a house
@AndreasSpiess Жыл бұрын
This question cannot be answered in a KZbin comment because it depends on your situation.
@danielymilva Жыл бұрын
Thank you Andrea. There is also the INA226 which can handle voltages up to 36V against 26V for the INA 219 (usefull for my Oscar 100 final PA...) 73 de HB9IIU
@AndreasSpiess Жыл бұрын
Thank you for the tip!
@lasersbee Жыл бұрын
Good info... BTW...There in no 'W' in "circuit". The 'U' is silent....😉
@danilodelconsole800 Жыл бұрын
Hi Andreas..very interesting. What IC would you use to check if a smartphone is charging or not (an IC in the middle between charger and smartphone)?
@AndreasSpiess Жыл бұрын
Any DC current or power meter should do.
@OldCurmudgeon3DP Жыл бұрын
I would expect that when measuring mains, being AC, you would been some code and a bit of bandwidth on the mcu to calculate the RMS equivalent current value? It looked like all your tests were done with a DC source.
@AndreasSpiess Жыл бұрын
These are mainly DC sensors (some can measure currents in both directions). I made a separate video about AC sensors and added the link in the description
@tinygriffy Жыл бұрын
Very interesting ! Will you make a video where you explain how to program the esp with grafana and co to give a nice current reading over time in a webbrowser ?? ;) Or is there already one ?😅
@AndreasSpiess Жыл бұрын
I made one or two videos about MQTT, node-red, influxDB, and Grafana. Search for IOTstack
@tinygriffy Жыл бұрын
@@AndreasSpiess I knew it ! :D Thanks :)
@DIYtechie Жыл бұрын
@AndreasSpiess Have you considered making a video about how to program an ESP32 C6 with zigbee to make your own zigbee-devices, such as plant sensors, remotes and other sensors? This would be a game changer for DIY smarthome.
@AndreasSpiess Жыл бұрын
As soon as Espressif supports Zigbee in the Arduino IDE...
@DIYtechie Жыл бұрын
@@AndreasSpiess Why not ESPHome? 😊🤷♂️ Easier in my experience and integrates directly to Home Assistant.
@AndreasSpiess Жыл бұрын
@@DIYtechie I use ESPhome whenever possible...
@WilliamDudley Жыл бұрын
The Hall effect sensors like the ACS721 also have the problem of hysteresis, in other words, the "zero current" output voltage changes depending on what was the last current you measured. Measure +1A, then note the "zero" voltage (nominal Vcc/2). Now measure -1A. Now check the "zero" voltage, and it will have changed by several % of full scale.
@AndreasSpiess Жыл бұрын
Thanks for the info!
@marcus3d Жыл бұрын
In future videos like this, could you include the approximate prices for the alternatives, please?
@AndreasSpiess Жыл бұрын
I leave links in the description to the source I bought them. Prices vary by country and by supplier.
@marcus3d Жыл бұрын
@@AndreasSpiess Yes, and I can look them up myself, but it would be very useful seeing the price on the screen when you introduce each.
@PFBruno3 Жыл бұрын
Thanks for the great video and explanation as usual. I'm still not clear about AC... do these sensors measure AC? Obviously if you used an analog input, you might measure varying voltage based on the AC sine wave timing. I assume the ACS7xx chips do measure AC since they can measure mains.
@AndreasSpiess Жыл бұрын
This video is about DC sensors. I made another video about AC sensors. Some of the DC sensors can measure currents in both directions.
@yannkitson116 Жыл бұрын
Working with a Raspberry Pi Pico W I had issues with the fluctuation from a voltage divider as well, but I stabilised it in the software by using the average of the last 10 measurements as the value for decision making. It worked well and produced a value that was very stable in comparison with a bench multimeter. The example is in python: # Calculate the average of the last 10 Batv values batv_average = sum(batv_values) / len(batv_values)
@AndreasSpiess Жыл бұрын
Good idea! BTW: If you want to save some RAM space, there is even an easier formula where you do not need to store all 10 values (moving average).
@yannkitson116 Жыл бұрын
@@AndreasSpiess Oh I didn't know, I will look into that. I know moving averages but I didn't know that there was a specific function for it. Thank you for letting me know.
@AndreasSpiess Жыл бұрын
@@yannkitson116 No function, just the normal formula.
@hedleyfurio Жыл бұрын
Many thanks - please consider an episode on how an MPPT controller dynamically changes the impedance that is ‘seen’ by a solar panel depending on the load, where load seems to be a combo of battery charging needs , and the inverter input . I have looked on the internet for months and still can’t find a clear technical explanation . The question arose when my inverter showed 400 watts solar panel output on a sunny day with a 4.6 Kw array - the battery was fully charged and most appliances turned off.
@AndreasSpiess Жыл бұрын
MPPT controllers are switching buck converters. They can adjust the voltage ratio between the input and the output voltage to match the MPP of the panel(s). Input power is always similar to the output power. This is why your converter only consumed 400W from the solar panel when the battery was full.
@hedleyfurio Жыл бұрын
@@AndreasSpiess thank you - I’m trying to build a small test unit or simulate on ltspice so the “ penny drops “ as reading vs understanding something are often worlds apart .
@hedleyfurio Жыл бұрын
@@AndreasSpiess The "all in one inverter" appears to have inputs from the 1. utility , 2. solar panels , 3. battery - The outputs are- 4. the load , and 5. the battery charging . I was trying to correctly position the panels both azimuth and angle by measuring what came out of the panels to input(2) . This is where the confusion started as the displayed, or measured value depended on the load (5) . A collogue suggested I switch on a reflow over to ensure that load was more that the inverter could deliver and then measure but that caused inverter to shutdown - Perhaps I am asking the wrong question, and there is a better way to measure the output of the solar panels , ideally measured every 5 minutes over a day ? If I get this to work the plan is to install a slew drive to track azimuth daily and I will adjust the angle every 2 months manually between seasons .
@AndreasSpiess Жыл бұрын
@@hedleyfurio Think of the buck converter as a transformer for DC with an adjustable turn ratio. The turn ratio is used to shift the working point on the curve of the solar panel to match the power needs of the output.
@hedleyfurio Жыл бұрын
@@AndreasSpiess Thanks again : so summary could be : The buck converter is like an inductor,( viewed from the solar panel output) , with an input impedance of 2PifL , where by varying the frequency / duty cycle (f) , the input impedance changes which thereby allows more or less current to flow from the solar panel . The MPPT controller ' seeks ' for the optimum impedance point to then matches that to allow maximum output . If you have a situation where the load requirements are LESS than the solar panel output then the input impedance is increased to match the instantaneous load requirements , meaning the excess energy in the solar panel , that is not supplied to the inverter/mttp charger will be dissipated as heat .
@5Komma5 Жыл бұрын
So that's where I messed up. I tested the shunt version but did not like the accuracy. I am not 100% sure but I probably did not connect to both GNDs. Learned something. Thank you.
@AndreasSpiess Жыл бұрын
Indeed, these ground problems are not easy to discover!
@VIJJAPUSAIMUKUNDAMOGH8 ай бұрын
Thank you Andreas, But i have one question, could you please give information regarding AC current sensing that which sensor is best for 85khz Ac current application and it should be connected to MCU, how can I achieve it ?
@AndreasSpiess8 ай бұрын
This is a very special thing. So google is the better way to find answers. I do not know :-(
@cccmmm1234 Жыл бұрын
Ina226 can be used high side or low side, but it does still add a burden voltage.
@AndreasSpiess Жыл бұрын
I agree. But on the low side, the GND of the load is no more GND of the sensor. Not easy for many designs...
@cccmmm1234 Жыл бұрын
@@AndreasSpiess yes I agree. I am using top side for my designs.
@AndreasSpiess Жыл бұрын
@@cccmmm1234 Me too...
@brendandelear1145 Жыл бұрын
Yaay i was wanting an update on this :)
@AndreasSpiess Жыл бұрын
Maybe it is time...
@jesjames Жыл бұрын
Very nice test. For ACS712 you must change those green connectors, they melt after 10A. Plus a smoothing algorithm will give you a great improvement👍
@AndreasSpiess Жыл бұрын
Thank you for sharing your experience!
@soufbel34554 ай бұрын
🌟 I need a sensor that detects a mAmps current, just detect it, I don't need to measure it, the current is about 20mA, can you advice? Nice video as usual, thank you 👍
@AndreasSpiess3 ай бұрын
You can use all kinds of current sensors and adjust the shunt resistor to your current levels.
@arnebirkeland6249 Жыл бұрын
The ina226 can be used both on high and low side.
@AndreasSpiess Жыл бұрын
You are right! My mistake.
@yancymuu4977 Жыл бұрын
Measuring current on my solar system has been a recurring interest for me for several years. This year I have implemented a circuit based on Stuart Pittaway's excellent KZbin channel. I'm using 3 INA229 chips (charge controller load, and battery current) on a custom PCB. The chip uses an SPI interface. Current measurement are by directional, with very low zero offset. Therefore coulomb counting for battery charge level is extremely accurate and repeatable from day to day. I show the board in a short overview KZbin Video if interested.
@AndreasSpiess Жыл бұрын
Impressive project! I had a similar problem (8x300Ah battery) but went the easy way: I bought a Daly BMS and interfaced it using an ESP8266 to node-red. So far, I do not have experience with how accurate the ampere-counting is.
@MiniLuv-1984 Жыл бұрын
I want to measure mains current and direction. I've been told I need to put two inductors in quadrature to determine...what does that mean? Possibly a future video?
@AndreasSpiess Жыл бұрын
I put a link to my video on AC sensors in the video description.
@MiniLuv-1984 Жыл бұрын
@@AndreasSpiess Thank you Andreas.
@pochuanhsing2466 Жыл бұрын
Nice video for current sensor, I am from ME major. I don’t understand why I need to measure a current linked to arduino? Why can’t they separate in two loops? Say I want to measure if my water pump is turned on from line voltage I could use hulls sensor in it’s loop and don’t bother my low DC supply to Arduino. Even for the shunt sensor at 5 A range, can’t design them in a different loops? Like you have example with resistors? Also if I use a transformer to supply say 7 and 5 volts DC then I have more choices to handle my application in a different loop and don’t bother normal working voltage for Arduino? Thanks
@AndreasSpiess Жыл бұрын
This was just an example load. Most people will measure the currents of other loads.
@techno_mesh Жыл бұрын
There is a typo at 1:40
@AndreasSpiess Жыл бұрын
You are right!
@NicksStuff Жыл бұрын
Why is there a potentiometer on the board of the WCS1800?
@AndreasSpiess Жыл бұрын
It can change the threasold level for a digital pin
@NicksStuff Жыл бұрын
@@AndreasSpiess Thank you
@Rob_65 Жыл бұрын
The INA226 has one advantage over the INA219 that you did not mention: it can also be used to measure current on the low side (placed in the ground wire) because it has a separate Vbus input to measure the supply current. By the way, both chips state "bidirectional" in the datasheet so you can place one INA226 in the wire to the battery and measure both charge and discharge currents
@sunilgeorgethomas9071 Жыл бұрын
it can also measure voltage
@AndreasSpiess Жыл бұрын
You are right (I made an error about the direction). However, I do not like that the load is not connected to the same ground as the INA if used on the low side. This will fool a lor of people, I think...
@Rob_65 Жыл бұрын
@@AndreasSpiess I also prefer high side current measuring but sometimes I do not have that option. My 36V battery charger for example outputs 42V of charging voltage which is too high even for the INA226 to allow current measuring in the positive voltage wire.
@czhusky Жыл бұрын
What would be the best of these to measure an AC or DC ground fault detect or current leak to ground down to 1M?
@AndreasSpiess Жыл бұрын
I assume the same rules apply. The shunt has to be quite big if you want to measure very low currents. But I never tried it.
@ffoska Жыл бұрын
Could we get a video on powering microcontrolers with redundant power supplies? What type of powersupply is the most reliable? What makes power supplies fail, which component fails first from heat, cold, moisture etc. How to protect board from the elements and lightning etc. Kinda obscure toppic, but I think it would be interesting for people making IOT stuff that is a royal pain to get to when needs replacing.
@AndreasSpiess Жыл бұрын
IOT devices usually are extremely low power. So the reliability of power supplies was never a particular problem for me. Most of the time, they run on batteries or on a 5V USB power brick.
@pedrosimoes8590 Жыл бұрын
Isn't there a Hall sensor in the ESP32 also?
@AndreasSpiess Жыл бұрын
Yes. But how would you use it for this purpose?
@pedrosimoes8590 Жыл бұрын
@@AndreasSpiess You're the teacher. Just here to learn ;-) I once took a look at it but just for current detection, not measurement. I think it was even possible but not straightforward to wake up the esp32 from sleep in response to changes in the field.
@MikesAllotment Жыл бұрын
I've been battling with this current monitoring problem for a while now and still don't really have a solution after watching your excellent video. The INA219 can measure current in both directions, and operates at VCC 3.3v (even lower actually), however it is limited to max 3A current measurement. The ACS712 can measure higher currents, but only operates at VCC 5V, which is no use for ESP8266 projects. What I need is a current sensor that operates at 3.3v and is capable of measuring 5A or more bi-directional - so I can see when current is being drained from the battery or fed into the battery from the solar panel. Is there anything out there that can fulfill this?
@mahudson3547 Жыл бұрын
The INA219 will measure any current you want. It measures the voltage drop across a shunt resistor up to 320mV. The fitted one is 0.1ohm , hence 3.2A. If you solder a second 0.1 on top of the existing, it will be .05 ohm and then will measure up to 6.4 A.
@AndreasSpiess Жыл бұрын
I agree with mahudson3547. Maybe you have to create your own PCB to accommodate higher currents
@mahudson3547 Жыл бұрын
@AnreasSpiess If you remove the 0.1ohm resistor, the two terminals are just measuring voltage (high inpedance). So put high current terminals and shunt off the board and connect the two terminals with hookup wire to either side of the shunt. Almost any current you like and no new circuit board.
@mahudson3547 Жыл бұрын
@AndreasSpiess - just thinking… If you take the shunt off the INA219 board so it becomes a voltmeter, you could also use matched voltage dividers on the terminals to allow for more than 26V. The current would be multiplied by the divider ratio? Calibration in the micro would be easy.
@0ffGridTechClub6 ай бұрын
Grape Video ! 🍇
@shodanxx Жыл бұрын
Which of these sensors are appropriate to measure reactance, the phase difference between voltage and current, to differentiate apparent power versus real power in inductive loads such as motors, solenoids, coils, antenna and to perform power factor correction of digital devices power supplies ? Soaking of power supplies, what happened to the "super power" power supply ?
@AndreasSpiess Жыл бұрын
This video is mainly about DC. I made a video about AC msensors.
@AJB2K3 Жыл бұрын
I have several INA219 boards but they are only rated @3.2A making them unusable for solar which can run up to 10Amps (in my basic setup case). I am a bit confused over that issue.
@mahudson3547 Жыл бұрын
You can change the shunt resistor…
@piotrswiatkiewicz3259 Жыл бұрын
@@mahudson3547Stronger: one must do that. The data sheet states the bit size for shunt voltage measurement is 10 μV. Also, the ADC resolution is given (12-bit ADC). Also, the full scale voltage range for the current sense input is ±320mV (at the PGA /8 setting). So, you can derive all the parameters needed for the shunt to be able to measure the current in your range of interest.
@AndreasSpiess Жыл бұрын
I agree with piotrswiatkiewicz3259. You probably need a custom PCB to deal with higher currents.
@piotrswiatkiewicz3259 Жыл бұрын
@@AndreasSpiess Dear Andreas! What does PC mean in your response? Oh... possibly, a custom PCB. That would make a lot of sense :)
@piotrswiatkiewicz3259 Жыл бұрын
By the way: @zyghom below proposed another of the TIs products: INA260. It has a built-in shunt ..... only 2 mΩ(!) which is nicely manufactured to work well with the rest of the circuitry (I am deliberately holding short of saying: calibrated). The chip is rated up to 15A.
@username9774 Жыл бұрын
Wouldn't it be possible to just use a hall effect sensor and measure the magnetic field induced by the current? Would propably work better with a small coil
@AndreasSpiess Жыл бұрын
Yes. Some of the sensors do that.
@martinvollderpro Жыл бұрын
15:27 wrong. some of them can measure reverse currents, for example ina219/ina226.
@AndreasSpiess Жыл бұрын
You are right. See my pinned comment
@BadZocker13 Жыл бұрын
Why the Reupload?
@AndreasSpiess Жыл бұрын
Because it is summer break (as said in my last video)
@klassichd10 Жыл бұрын
Thanks again, I am looking for affordable DC current clamps for the PV strings, to integrate it in my home automation system.
@AndreasSpiess Жыл бұрын
I hope you find an appropriate one.
@klassichd10 Жыл бұрын
@@AndreasSpiess up to now unfortunately not. For sporadic tests I am using the Voltcraft branded UT210, but I have nothing to integrate in the PV system and in my automation system. At least nothing which is not too expensive.
@AndreasSpiess Жыл бұрын
@@klassichd10Maybe you try a WCS1800?
@klassichd10 Жыл бұрын
@@AndreasSpiess Thank you for the hint. I though about that, but I had to open the inverter and to remove the string cables to feed them through the hole. I want to avoid to lose warranty, I am still hoping, that there will be a variant to clip on.
@klassichd10 Жыл бұрын
@@AndreasSpiess We might come closer: "Hall split core" seem to be the keywords. 30A DC ca, 40 EUR. Expensive for nice to have. I will still wait a bit. The inverter also transmits values, but I have 2 strings in parallel at one of two MPPT trackers.
@timmiller7524 Жыл бұрын
I=UxR isn't right Andreas! U/R is what you meant! A neat video is so much more human with the odd slip-up. We know we're not being bamboozled by AI!
@AndreasSpiess Жыл бұрын
You are right! (I put the correction in a pinned comment).
@TheTweakerTweaks Жыл бұрын
Use piecewise linear interpolation to calibrate your values. //used on esp32 // Coefficients for the piecewise linear interpolation //Raw ADC value's float coefficients_ADCread[] = {2 ,149,270 ,363 ,452 ,550,637, /* Add other ADCread values here */}; // corosponing mA measured externally float coefficients_mA[] = {3.2,8.3,12.3,15.3,18.3,21.4,24, /* Add other mA values here */}; float convertToMilliAmps() { // Read ADC and convert to mA adccounter=0; ADCread=0; //take 1000 mesurements for more avarige value while (adccounter coefficients_ADCread[index]) { index++; } if (index == 0) { // Ensure the index is within bounds index = 1; } else if (index == sizeof(coefficients_ADCread)) { index = sizeof(coefficients_ADCread) - 1; } // Perform linear interpolation within the segment float mA = coefficients_mA[index - 1] + (ADCread - coefficients_ADCread[index - 1]) * (coefficients_mA[index] - coefficients_mA[index - 1]) / (coefficients_ADCread[index] - coefficients_ADCread[index - 1]); return mA; } void setup(){ analogSetClockDiv(255); analogSetPinAttenuation(35,ADC_11db); adcAttachPin(35); //Analog read pin (pin 7 IO35) } void loop(){ Serial.print(convertToMilliAmps()); }
@AndreasSpiess Жыл бұрын
This is a very sophisticated program! Thanks.
@1kreature Жыл бұрын
The big hall sensor board is bad for mains as it has copper fills up along the side of the chip. This reduces insulation.
@AndreasSpiess Жыл бұрын
This video is about DC sensors. I made another one about AC sensors
@george12121979 Жыл бұрын
in my opinion one more chip( ADS1115) can use as currert meter in positine or negative power cable. General this I2C chip include 1)4 positive analog inputs with PGA in 16 bit ADC In PGA have 6 range A)PGA: +/-6144 mV Resoultion: +/-187.5uV B)PGA: +/-4096 mV Resoultion: +/-125uV C)PGA: +/-2048 mV Resoultion: +/-62.5uV D) PGA: +/-1024 mV Resoultion:+/- 31.25uV E)PGA: +/- 512 mV Resoultion: +/-15.625uV F) PGA: +/-256 mV Resoultion: +/-7.8125uV 2) alert output pin for high voltage in analog input 3) differential mode convert 4 Analog input in 2 differential channels channel 1 (ADC 0-1) channel 2 (ADC 2-3) ================================================================ Then use differential mode ADS1115 analog input MUST be between 0 and the ADS1115 supply voltage ================================================================ if connect in posstive power supply cable the max range is the power supply of ADS115 if connect in negatige power supply( ground point) the range is larger because the voltage in resiston is very smail. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - My design i use 2 differential Channel with R0.05/10W connect to "negative"( ground point) to get resoultion in six range's 1)PGA: +/-6144 mV Resoultion: +/-7.5mA => 245 A 2)PGA: +/-4096 mV Resoultion: +/-5mA => 163 A 3)PGA: +/-2048 mV Resoultion: +/-2.5mA => 81.62 Α 4) PGA: +/-1024 mV Resoultion: +/- 1.25mA => 40.96 Α 5)PGA: +/- 512 mV Resoultion: +/-625uA => 20.48 Α 6) PGA: +/-256 mV Resoultion: +/-312.5uA => 10.24 Α keep mind with 10W resistor max current is about 14.14 A so for safety limit is 10A. with 50mV MAX loss of Voltage in resistor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@AndreasSpiess Жыл бұрын
I agree. You can use all ADCs to measure current using a shunt (as you did).
@dougcox835 Жыл бұрын
You put your restisor divider in the beginning of the video on the wrong side of the sense resistor. The divider would only measure the supply voltage which should remain constant. I got what you were trying to show though but it should have been on the other side of the sense resistor so you would be measuring the drop rather than the supply.
@AndreasSpiess Жыл бұрын
I agree. My drawing is misleading. You need to measure a second time on the right side of the resistor to get the difference (as mentioned in my text).
@arnebirkeland6249 Жыл бұрын
The ina3221 realisation is not good. The channels has crossover error.
@userou-ig1ze Жыл бұрын
what would you use for 2x 100W solar panels with 20V (running parallel)? I get max 10A. Can I use a i2c board???
@AndreasSpiess Жыл бұрын
You have to use a shunt resistor that is compatible with your needs. Maybe a custom PCB?
@userou-ig1ze Жыл бұрын
@@AndreasSpiess but as a newbie a custom pcb is so hard to do - or rather (too) easy to make mistakes
@ronaldronald8819 Жыл бұрын
I missed the popular PZEM 004T in your lineup. For anyone using this sensors i am interested in your experiences. Cheers.
@AndreasSpiess Жыл бұрын
These sensors (and explanations) are mainly for DC. I left a link to a video where I covered AC sensors.
@edvardfranke Жыл бұрын
Thx
@AndreasSpiess Жыл бұрын
You are welcome!
@Filip_Visnjic Жыл бұрын
Why this old video again?
@AndreasSpiess Жыл бұрын
As written in the comment and announced in my last video, I always show old videos during my summer break. Viewers asked for that, and according to the many comments here, a lot of newer viewers did not see the initial version. You seem to be a longtime viewer, though.
@Jacklsovakia1 Жыл бұрын
Nothing appeared in the top right corner for me
@AndreasSpiess Жыл бұрын
Thank you for the input. Indeed, I forgot to add the link :-(
@sammin5764 Жыл бұрын
🌟🌷🌟
@Richardincancale Жыл бұрын
Does anyone know of an open source equivalent to the Emporia energy monitor? It has up to 16 clamp-on current transformers to monitor home energy usage. It must use an analogue multiplexor to service so many inputs rather than multiple ADCs - but I have no experience with analogue muxes…
@dave00011 Жыл бұрын
open energy monitor
@AndreasSpiess Жыл бұрын
I also put a link to my video about AC sensors in the description.