#186

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 เม.ย. 2020
  • Measuring current is both easy and very accurate using a current sensing module and an Arduino.
    PCBWay $5 for 10 pieces www.pcbway.com
    PCB Prototyping the easy way - see my video #129 for Hands-On details.
    09:30 INA219 (digital) begins
    Let's investigate whether an analog or digital device is better for detecting and measuring current in all sorts of circuits - up to 26V and 30A.
    All this information plus sketches and more in my GitHub:
    github.com/RalphBacon/186-Mea...
    INFORMATION
    Good reading on the *INA219*
    cdwilson.us/articles/understan...
    *Adafruit article* on INA219 (using their library)
    learn.adafruit.com/adafruit-i...
    Adafruit *GitHub library* for INA219
    github.com/adafruit/Adafruit_...
    Texas Instruments *Datasheet for digital INA219
    www.ti.com/lit/ds/symlink/ina2...
    Sparkfun Datasheet for *ACS712* (analog current sensor)
    www.sparkfun.com/datasheets/B...
    List of all my videos
    (Special thanks to Michael Kurt Vogel for compiling this)
    bit.ly/TH-camVideoList-RalphB...
    All this information plus sketches and more in my GitHub:
    github.com/RalphBacon/186-Mea...
    PRODUCTS
    Links may be affiliate links that help support my channel - thank you for your support!
    Banggood INA219 High Precision I2C Digital Current Sensor Module $3.27 + shipping
    Easy to use via I2C (really, it is) and gives a lot of control over the level of detail you want to retrieve. I'm just getting the current in the video but you can do lots more!
    www.banggood.com/GY-INA219-Hi...
    Banggood ACS712 Analog Module 5A /10A / 20A Current Detection Board
    www.banggood.com/ACS712-Modul...
    Banggood Electronic Load Ageing Battery Power Capacity Tester Module
    www.banggood.com/Original-ZHI...
    Banggood XH-M240 Battery Capacity Tester mAh mWh for 18650 Lithium Battery
    www.banggood.com/XH-M240-Batt...
    If you like this video **please give it a thumbs up**, share it and if you're not already subscribed please consider doing so and joining me on my Arduinite journey
    My channel, GitHub and blog are here:
    ------------------------------------------------------------------
    / ralphbacon
    ralphbacon.blog
    github.com/RalphBacon
    ------------------------------------------------------------------
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 220

  • @Cptnbond
    @Cptnbond 4 ปีที่แล้ว +3

    Thanks Ralph, for yet another interesting video.

  • @airwavested
    @airwavested 4 ปีที่แล้ว +1

    Thank you Ralph for yet another excellent video. Great explanation of both devices and sketches. Stay safe.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      Glad you enjoyed it, Ted.

  • @Taran72
    @Taran72 3 ปีที่แล้ว

    Awesome tutorial! You really make things easy including the bit writing part while you were explaining the wire library functions. :)

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Glad it was helpful!

  • @stevehallam0850
    @stevehallam0850 4 ปีที่แล้ว +1

    Two interesting devices, both have their place. Thanks again Ralph.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Horses for Courses, as they say! Thanks for watching!

  • @StigBSivertsen
    @StigBSivertsen 4 ปีที่แล้ว

    Great video. I have had INA219 for a little while but haven't made a project out of it yet. Now you just made it just a little easier :-)

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      Go for it! Now you can connect it up! Hmm, did I put the sketch in my GitHub? I will check!

  • @simonbancroft8579
    @simonbancroft8579 3 ปีที่แล้ว

    Marvelous tutorial, thank you. I have been trying to get my INA219 to work "properly" for quite some time, without real success.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      Glad it helped! The one I'm using in my Smart Phone Charger, Simon, is working 100% reliably for several weeks now. It's a nice product that delivers what it promises aka does what it says on the datasheet!

  • @Roy_Tellason
    @Roy_Tellason 4 ปีที่แล้ว

    That Banggood device that you show with the two lithium batteries in it has one very interesting feature, when I went to look at it in detail. The "load" is a big 10W power resistor that's mounted right next to the battery that you're testing! If I were using one of those I would remove the resistor from that location and extend the connections to put it at least several inches away...!

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Thanks for the info! When it (eventually) arrives (it's been weeks already) I will doubtless take your advice, Roy.

    • @Roy_Tellason
      @Roy_Tellason 4 ปีที่แล้ว

      I am reminded of a repair I did on a F****r guitar amp one time, which had a (plastic) headphone jack and a 5W resistor mounted so close to it that when the jack was used, the heat from the resistor eventually melted it and the formerly normally-closed contacts weren't making the connection to the speaker any more.

  • @webslinger2011
    @webslinger2011 4 ปีที่แล้ว +1

    This was very helpful. I have the usb current/voltage meter. Can read up to 28v (from what I remember).

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Glad you liked it!

  • @azmrblack
    @azmrblack ปีที่แล้ว

    Ralph the INA219/260 are great boards. Totally agree they are miles ahead.

    • @RalphBacon
      @RalphBacon  ปีที่แล้ว

      Glad they worked for you, Chris! My Smart Phone charger in use daily (all day) and still accurately reports current flow.

  • @gavinsmalley1513
    @gavinsmalley1513 4 ปีที่แล้ว +2

    Hi Ralph, another interesting video. Re the ACS712, would it be more reliable at measuring AC current? (I guess it can measure either way because of 0 being 512). Hall effect needs a lot of extras to measure DC which is why there aren't many DC current clamp meters.
    Very strange that the INA219 is limited at 26V when the datasheet lists telecoms equipment as a suggested use which typically runs at -50VDC!

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I didn't try it with AC current (which it handles, of course) but I suspect we would not be trying to detect 100mA of AC current flowing so the noise issue goes away. Regarding the 26V max, the datasheet itself gives a few scenarios with much higher voltages so I'm a bit confused at the figure too!

  • @Hasitier
    @Hasitier 4 ปีที่แล้ว +1

    Hi Ralph. I used this INA219 before and it is really great and the way to go with small current measurements. I saw you use a Streamdeck now. Did you ditch your self made controller?

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +2

      I still use my home-made (touch) controller for my videos, Michael. I use the Stream Deck for experimentation. Coincidentally enough, I am working on a project that ensures I do not need it so much. All will be revealed in a future video!

  • @kipsus
    @kipsus 4 ปีที่แล้ว +3

    One thing to mention is that acs712 is very fast. If you were to take many adc samples over the same 4+ milliseconds and average them out, the noise would be much lower and perhaps comparable to the INA

    • @Ed19601
      @Ed19601 4 ปีที่แล้ว

      Good to know

    • @kennmossman8701
      @kennmossman8701 4 ปีที่แล้ว

      why would the noise be lower?

    • @milanljuba7563
      @milanljuba7563 4 ปีที่แล้ว

      Kenn Mossman because of the averaging.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Yes, I'm sure I could have done more with the ACS712 but I knew the digital INA219 was so "good" in comparison I just wanted to get on with that one!

    • @BendeVette
      @BendeVette 4 ปีที่แล้ว

      @KIPSUS
      I did a project with the ACS712 measuring AC and oversampled the current on a 50 Hz 230V powerline. Had "Great" result on an ESP32 with 12 bits ADC. Sampling rate 10.000 effective samples per second (4 samples/effectieve sample).

  • @andymouse
    @andymouse 4 ปีที่แล้ว +1

    Hi Ralph, I have used the INA 219 myself, it's a great little module, Julian has some good vids where he combines them with an OLED display and makes a "Wattmeter"...cheers!

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      Julian who? Never heard of him. Although the reverse is not true as he commented on one my videos, I will never wash that video again! Yes, once you have this working you can do what you want with it. Flashing LEDs always acceptable!

    • @JC-zl7sq
      @JC-zl7sq 4 ปีที่แล้ว

      @@RalphBacon I think he means Julian Ilett a youtuber

    • @pupplecoffee
      @pupplecoffee 4 ปีที่แล้ว +1

      INA226 is also good.

    • @Roy_Tellason
      @Roy_Tellason 4 ปีที่แล้ว

      @@JC-zl7sq I think he knew that, and was just playing with you...

  • @mattshepcar2866
    @mattshepcar2866 4 ปีที่แล้ว

    Nicely explained. I think it's often more fun to ditch the libraries and go back to basics as it gives you a much better understanding of the capabilities of these little modules and how to talk to them. That said, I've not had any problems with the adafruit INA219 library for monitoring the power usage on my LED strip setup. One small suggestion: you could use the lowByte and highByte macros to make the byte shifting/masking easier to explain.

    • @mattshepcar2866
      @mattshepcar2866 4 ปีที่แล้ว

      Oops, just checked and the library I settled on was not the Adafruit one but John De Cristofaro's ArduinoINA219 library github.com/flav1972/ArduinoINA219 so that's another alternative worth trying!

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I'll have a look at that library, thanks for the heads up, Matt.

  • @MarkHopewell
    @MarkHopewell 2 ปีที่แล้ว

    I'm currently finalising a ESP32/Nano combined weather station, primarily one centred on wind speed and direction.
    One of the sensors, the wind vane, uses a "current signal" to relay the raw wind direction data. I didn't bother with the INA219 in this instance.
    I chose to ignore the "current signal" arrangement and convert it to a "voltage signal" instead. I did this by using a 220Ω load resistor in series with the "current signal" feed wire and ground, then took the subsequent voltage reading from across the resistor.
    I put the wind vane on my bench and tabulated the voltage readings myself by rotating the vane by hand to N>E>S>W and watched this against the tabulated current to wind direction values supplied by the manufacturer. I'm very pleased with the result.
    Since the output can swing between 0v and +5v, I used the A1 port on a Nano to take the voltage feed. This is then processed by the Nano and outputted as a float value, via serial, to an ESP32, which does the rest of the weather station processing and display functions.
    The anemometer sensor, conversely, uses a "voltage signal" output by manufacturer default. There was no need to convert that raw output. That signal is sampled on A0 and outputted as an integer value, via serial, to the ESP32 again.
    The receiving ESP32 takes the serial data and uses a ParseFloat() and ParseInt() function to separate out the direction and speed data and then process it further in other functions for display or reading comparisons, e.g. wind gust calculations, wind speed over time etc;
    I don't care about how I carried this out, or how I *should* have carried it out using other methods; it was fun playing around with it all just for the sake of it!

    • @RalphBacon
      @RalphBacon  2 ปีที่แล้ว

      Yes, it sounds as if you had some fun and got it working. Only thing I would have changed is to output the wind vane output as an integer (the float value multiplied by, say, 100) so that it didn't get corrupted (the last few sig. digits) along the way, which always happens with floats! 👍🏻

  • @JerryEricsson
    @JerryEricsson 4 ปีที่แล้ว

    Good luck on getting your stuff from Banggoods in any decent time. The last two orders I put in with them finally arrived. I placed the orders on the 24th of March, the last one finally arrived a couple of days ago. Strangly though, the hold up didn't seem to be with China, at leeast according to their tracking but here in the US of A! The packages were held up at each sorting office for weeks, I don't know if that was some anger at China, or some damn regulation about packages from China. When the packages arrived they looked as though they had been placed on a stage coach and ridden hard across the Mohave Desert, the packages were beat to hell! Luckily all the items worked, hard to kill those ESP32's I guess. One did arrive with the pins, which were not soldered, of course, broken into several pieces but I was still able to solder them in and the boards all worked Thank God, I am sure the nerves on the sellers in China are getting a bit frazzled by complaints by folks who do not read the tracking. It is strange though, I ordered one item from Hong Kong, it arrived quicker then orders from dealers here in the States.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      WOO HOO! I GOT A BANGOOD PACKAGE YESTERDAY! Unfortunately it was nothing electrical, just a set of (non surgical) face masks. It took a *whole month* to get here. But in good condition, so no desert trekking for mine (we have no deserts here in the UK).

  • @rwils6333
    @rwils6333 4 ปีที่แล้ว +1

    I've used the ACS712. But on my own designed power supply. I had the same problems with readings when zero current is present. Got about a 10mA resolution, but have to do averaging and even then jitter is always present. What I needed tho was isolation between measuring circuit and measured circuit. The ACS module provides this

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      The isolation part I did not emphasise - perhaps I should have, as it's a good selling point. Changing the filter cap on the module might also improve jitter, according to several others here.

  • @oncledan8509
    @oncledan8509 4 ปีที่แล้ว

    Hi, Ralph.
    Hmmm !! Quite a nice little device, I must admit. Here goes an application, right away ! Hahaha ! And quite accurate too ! Thank you for sharing this info with us, Mate !
    Have a great week ahead. P.S.: It's nice to see you with two eye, again, Captain .. Arrrr ! :-)

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      I knew you were getting bored without your laser work so this little project is just for you!

  • @reelrebellion7486
    @reelrebellion7486 4 ปีที่แล้ว +2

    This probably isnt how the real world works, but I heard 'hall effect' and I immediately thought, "run a couple of turns of wire through those holes by the chip....".

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Well, internally, maybe that's what it does?

  • @stevetobias4890
    @stevetobias4890 4 ปีที่แล้ว

    Great video, I have some of these on order and was wondering how accurate the will be. I'll hook them up to a 1604 display for easy display

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Glad I could help, Steve. The accuracy of mine was 2V wrong at 240V (as you saw it showed 242v for a 240v supply, measured by my multimeter) and at 10A it was about 0.5A in error - but that's not too bad, 5% error, considering! If you have the means to accurately measure (eg AC clamp meter) you can then tweak your code (eg lookup table or formula) to get it better.

  • @on1ytheb3st
    @on1ytheb3st 3 ปีที่แล้ว

    Did you ever attempt splicing the INA219 into the charging chord for your phone project? I'm attempting this and my Serial Monitor output shows the bus and load voltage fluctuating substantially with a connected iPhone 8 at around 80% charge. The Bus voltage fluctuates from about 0.5V to 2.5V but seems to mostly hover around 1V. My current is hovering around 720mA. I'm curious if the voltage fluctuation is normal. Is this possibly a defective INA219 or is the iPhone doing this on purpose (fluctuating the voltage). I would think the voltage should be either increasing or constant with charge.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Yes, my Smart Phone Charger video #193 (th-cam.com/video/fvb3i4yV20s/w-d-xo.html ) contains more details. The current does fluctuate quite a bit (I take a rolling average to smooth things out a bit). I never measured the voltage as that wasn't the focus of the project but I do know the phone controls how much current is taken (depending on how flat the battery is) so I guess it also controls the voltage (which must change as often as the current - ie very often). The project is, however, complete and in use all day, every day. Works like a dream.

  • @gennadyyakubovich4076
    @gennadyyakubovich4076 4 ปีที่แล้ว

    Thanks, great video. So is there way to use digital module INA219 to measure current with voltage up to 120V ? Also, does it have galvanic isolation from measured current?

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      The INA219 is designed for low voltage DC, up to 26V and 2A. To measure AC 120V, Gennady, use the ACS712, which has 2.1kV RMS Voltage Isolation. As others have noted here increase the filter cap to reduce the noise.

  • @jeffbluejets2626
    @jeffbluejets2626 4 ปีที่แล้ว

    Hi Ralph, I used the INA219 on a specific project and used the Adafruit library which was dead easy ( great for me :)) AND it was also accurate as a plus.(mA) As with many projects it involved a few different codes nailed together and it has been working successfully for over 2 years now. Application is basically for the curing of epoxy on a fairly delicate operation. Can send you details on pm if you like to see it.(used your diode reset idea...thanks for that)
    Apart from that, just curious if you tried the 712 on AC at all. Assume the same resolution problem would be present but until recently was not aware there was an AC/DC sensor.
    Once again, thanks for great presentation.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I suspect I was being somewhat unfair to the ACS712. It was never really designed to detect such low (

  • @robertfkidd7206
    @robertfkidd7206 4 ปีที่แล้ว

    I enjoyed your presentation of the videos.
    Is it OK to use Easy EDA to send to PCB way ?
    Do you have any comments about sending an order to PCB way in the present climate ?
    Thanks

    • @McTroyd
      @McTroyd 4 ปีที่แล้ว

      Robert, I think you'll find Easy EDA is pretty heavily tied to JLC PCB & LCSC (the parts supplier). IIRC, you can get the gerbers out of it, but they charge a pretty penny for that.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      You can use whatever CAD program you like and send the Gerber files to PCBWay. EasyEDA does not charge for generating the Gerber files. No problem with PCBWay making the high quality boards, delivery back is slower due to the reduction in air transport but that's all. Go for it!

    • @McTroyd
      @McTroyd 4 ปีที่แล้ว +1

      I stand corrected.

  • @JohnZonneveld
    @JohnZonneveld ปีที่แล้ว

    Would the INA219 work with measurements around 1mA with a AC signal of about 5kHz?
    Looking for a way to detect if on a model railroad a track is occupied. Using DCC so it it a Pulse Modulated signal on the tracks. Stationary the draw is about 1mA, running it is up to 20mA. Tried it with a analog current transformer (5A), but guess have too much noise making it unreliable.

    • @RalphBacon
      @RalphBacon  ปีที่แล้ว

      Check the datasheet, John, for minimum current detection. But I'm more worried about PWM output. It _should_ still detect it but your sketch will have to monitor the current. Could you not do it the other way round? That is, any current flow below (say) 10mA means a train cannot possibly be running?

  • @JC-zl7sq
    @JC-zl7sq 4 ปีที่แล้ว +1

    Did you connect the gnd of the device your measuring to the gnd of the device that is measuring. I got funny readings until I did that with my Atiny85 driven INA219.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      All grounds are commoned, for the INA219 anyway, which was accurate and didn't misbehave. The ACS712 was not commoned in any way, as it supposed to be isolated (working on the Hall effect). Good point you mention though, JC, that grounds must be commoned or nothing will work as expected, that's for sure.

  • @NBL00D
    @NBL00D 4 ปีที่แล้ว

    Many thanks for sharing. Very good vídeo.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Glad you enjoyed it!

  • @BendeVette
    @BendeVette 4 ปีที่แล้ว +1

    The noise can be reduced bij increasing the filter capacitor, it wil reduce the noise significantly.
    It's described in the specs.
    I had a reasonable good experience by oversampling an 50Hz (10.000 samples/second) line and averaging the values.
    This by using an ESP32 which has 12 bits.
    But to be honest, they do not compare as they are two different kind of beasts and you used the correct one for your use. It would be different when you want to measure 230AC.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Yes, different beasts, which I do make clear but for Arduino use I know which one I prefer!

    • @BendeVette
      @BendeVette 4 ปีที่แล้ว +1

      @@RalphBacon
      They each have their use, with arduino. The hall effect sensor (ACS712) is perfect for AC. Where the INA is absolutely unusable.
      Like to have a hall effect sensor with fast ADC and a SPI or I2c bus though. Haven't found one yet, unfortunately.

  • @philholding9720
    @philholding9720 3 ปีที่แล้ว

    Hi Ralph, I have learned so much from your videos, thanks. But I am trying to use your "Arduino_INA219_I2C_No_Library.h" sketch and I can't work out how to get this 'No_Library.h' into the sketch.
    When compiling I get an error saying that this file or directory, does not exist.
    Thanking you in anticipation.
    Phil.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      Easily done, Phil: You don't need it. Remove the #include statement in the sketch that wants it. Job done. My sketches get all sorts of things added that won't be required when using the Arduino IDE.
      If you *want to add it* just so you know, place it into the same folder as the sketch itself. Arduino IDE will then find it like magic. The quotes around the name (instead of chevrons / angle brackets) tell the IDE that it is a local file not a library file.

    • @philholding9720
      @philholding9720 3 ปีที่แล้ว

      @@RalphBacon Thanks so much I have it up and running now.

  • @Wilksey37
    @Wilksey37 2 ปีที่แล้ว

    Apologies for the late comment, but will these be of any use for AC current detection? You mentioned a kettle, would you be able to use say the 5A version of the ACS and just read it saturated (use it as an on/off indicator rather than measuring current) or would it damage the chip? Cheers

    • @RalphBacon
      @RalphBacon  2 ปีที่แล้ว

      I think you would melt the chip; it has to pass that current and that is what the rating is for. Best to have a much higher rated chip (eg 15A)

    • @Wilksey37
      @Wilksey37 2 ปีที่แล้ว

      @@RalphBacon I wasn't sure as it is hall effect if the 10, 20, 30A versions just scale to give different readings. As hall effect is non contact I didn't think it would be an issue.

    • @RalphBacon
      @RalphBacon  2 ปีที่แล้ว

      But the full current has to flow from one terminal to the other, regardless of what the electronics is inside. I can't believe a Chinese factory is going to allow 15A through the tracks designed for a 5A version. But, if you're feeling brave and have good house insurance...

    • @Wilksey37
      @Wilksey37 2 ปีที่แล้ว

      @@RalphBacon I understand the PCB tracks might be different, although, they looked the same width on both my 5A and 30A versions, but I meant from the IC perspective. Traces under high current usually just vaporise rather than catch fire, sometimes let off a funny smell for a bit!

  • @renezwart3201
    @renezwart3201 ปีที่แล้ว +1

    Really great tutorial; I love your style and the bits of humor injected :-). Noting the INA219 used and the comments below regarding the INA260 (which I really like!) are you aware of a similar module for even higher voltage and current values with similasr precision and/or functionality as the INA260? I'm looking into controlling an induction annealer that operates at 48VDC/30A. I noted the INA229, but it doesn't take the current. Thanks!

    • @RalphBacon
      @RalphBacon  ปีที่แล้ว

      Glad you enjoyed it! Unfortunately, for higher current I'd revert to a current sensing device like this one bit.ly/3VRsEEK although you can get cheaper versions from China (if you are prepared to trust them).
      This means that although they can handle the current (eg 1A, 5A, 10A etc) the resolution drops so measuring tiny currents is not what they are good at.

    • @renezwart3201
      @renezwart3201 ปีที่แล้ว

      @@RalphBacon Thanks for the quick response!! I had a look around and thought about a WCS1700 module. Appreciating the limited bandwith (?) of the Arduino at 10-bit ADC I would then run the WCS1700 analog signal over a ADS1115 and use your method of averaging over a group of readings. As I'm not looking for milliAmp percision I think (wonder if 🙂) that should work. Appreciate your thoughts, thanks!

    • @RalphBacon
      @RalphBacon  ปีที่แล้ว

      If you have several WCS1700s to read then you can wire them into an ADS1115 (I should think) otherwise just use your analog pins to do it directly from the processor (if it has any). A rolling average as per my demo code works pretty well although it can take a few seconds to stabilise and/or respond to changes (the whole point, I suppose).

    • @renezwart3201
      @renezwart3201 ปีที่แล้ว

      @@RalphBacon Great, thanks! I intent to use the 1115 to improve the signal bandwith (16 instead of 10 bits), but a rolling average it is. I can have the system 'settle' before making it available for use.

    • @RalphBacon
      @RalphBacon  ปีที่แล้ว

      Using higher than 10 bits will give a fair amount of jitter/noise so you deffo need a rolling average! Use screened cable if poss.

  • @TheModelmaker123
    @TheModelmaker123 4 ปีที่แล้ว

    What are the advantages of using the INA219 over a ADC such as the ADS1115 to measure the voltage drop and convert to current?

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      In a word, simplicity. I, too, tried the approach you mention, just using either the Arduino's (rather low) 10-bit ADC but them moved onto a separate Op Amp IC doing the same. Neither was as good as this dedicated chip, unsurprisingly! And it has an I2C interface to set all the parameters you want. But give it a whirl, as they say, YMMV.

  • @davidvukovic
    @davidvukovic ปีที่แล้ว

    Thanks for the tutorial.

  • @avejst
    @avejst 4 ปีที่แล้ว

    Great video as always 👍
    A bit strange thing that you average In the digital range, but not in the analogue range..
    Thanks for sharing 👍😀

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      The difference I was showing is that the averaging comes as standard in the digital version but I'd have to write code to average out in the analog version. I also ran the code *without* averaging and got the same results lol but I had to show the possibility!

  • @wrrail4428
    @wrrail4428 2 ปีที่แล้ว

    Thank you for the great video, this is very useful. I am looking for a similar type of component for an Arduino to measure if any current is being drawn on a circuit. It is an 18v circuit and I need HIGH value if 1mA or more is drawn, it could be up to to 2A but I am not interested in the value, only that current is drawn. I could you use this component and check returned values and set HIGH and LOW, but it seems a little heavy and I wanted to check if there was a more suitable component Do you have any suggestions Thank you

    • @RalphBacon
      @RalphBacon  2 ปีที่แล้ว

      By "a little heavy" I presume you are talking about the price, around $9?
      There are cheaper (non digital) versions available such as the ZXCT1022, which is a low offset, high-side current monitor.
      Basically, it still measures the voltage difference between a very low resistance and outputs a proportional output (which you could measure on an analog pin on an Arduino for example).
      One trick I learned is to put a known current device (eg resistor + LED) on the circuit load output to "stabilise" the device; if the LED takes, say, 5mA the output will send out a more stable voltage than if left floating. You can then read the offset from that value.
      Here's a link to the datasheet; there are many others available so have a browse and see what is suitable for your application. Good luck!
      www.farnell.com/datasheets/1846240.pdf

    • @wrrail4428
      @wrrail4428 2 ปีที่แล้ว

      Thank you for the quick response, Oops I should mentioned I have to measure the current On/Off at 70 separate points. I could use the I2C bus which would support the number of sensors. By heavy I was referring to the code to monitor 70 separate sensors reading the various values to process the required action, the price in this case was reasonable. I was checking if there was a lighter (processing) current detected High or Low component. Of course price is also a consideration as I require 70

    • @wrrail4428
      @wrrail4428 2 ปีที่แล้ว

      Perfect Component by the way, thank you

  • @dikl2689
    @dikl2689 4 ปีที่แล้ว +1

    To get proper voltage readings you need to connect the Gnd and V- on the module.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Which module, Dik, not the isolated ACS712? And I was getting proper readings on the INA219 so I am confused, please can you just clarify?

    • @dikl2689
      @dikl2689 4 ปีที่แล้ว

      @@RalphBacon I've sent you an email.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Let me go and dig your email out of the Trash folder.... right got it. No, I did not connect the two grounds together in that case, the power I was measuring was entirely separated from the Arduino's/INA219's power. So the solution is to connect them together. Makes sense... sort of. I will try it again when I get my phone charger sorted out. Thanks for clarifying what you meant, I should have realised as I am always going on about common grounds but this fooled me by working on the current range but not voltage. Doh!

  • @catalinalb1722
    @catalinalb1722 4 ปีที่แล้ว

    Hello, What IDE is this? it seems like is not Arduino IDE perhaps something in Linux? How to use this and is it better than the Arduino IDE? Could you do perhaps a video with differences btw. Atmel Studio, Arduino IDE and Geeniy in Raspian ? Thank you

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      It's the Eclipse Sloeber version but the new Arduino IDE will be appearing this year (in non-alpha mode) so that is where I will be focussing my IDE efforts!

  • @andyfraser5876
    @andyfraser5876 4 ปีที่แล้ว

    I found that the Polar / Chargemaster EV chargers use the ACS712-20 (on a 30A feed). I've mended a load of these chargers, but only seen one exploded ACS712 so far. It looks horrific for all that current to be flowing through two pairs of tiny legs of an 8 pin SMD chip.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I wondered about the tiny chip legs (even though they are paralleled up). But I guess the manufacturer has tested all this otherwise they would not sell any! Probably worth beefing up the PCB tracks with some solder though.

    • @BendeVette
      @BendeVette 4 ปีที่แล้ว +1

      The resistance of the ACS712 is very low (1.2 mΩ), so the effective power drain is very low too. So no Heat, no problem. If you really don't like the ACS712, you could opt for the ACS758.

  • @craigharris480
    @craigharris480 4 ปีที่แล้ว

    At 24:00 line 103 - is the device actually sending back a float?

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Hmm, I noticed that whilst editing. Given that with 8xGain and 12-bit resolution we can resolve down to 0.1mA, so it probably does. Just how accurate that is remains to be seen. Perhaps that stray 1mA in my demo was just rounding, after all? I will experiment more when I get this wired up into my Smart Phone Charger project.

  • @MrBobWareham
    @MrBobWareham 4 ปีที่แล้ว

    Hi Ralph pleased to see you have two eys now and not one all the best Bob

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I have one and a half eyes, Bob, but that's an improvement! It should get better in time and more surgery... Glad to see you here!

  • @ctbully
    @ctbully 3 ปีที่แล้ว

    Hi Ralph, which dev environment are you using here ?

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      For the moment I'm using Eclipse Sloeber but I'll be using the new Arduino IDE (also Eclipse based) when it's ready later this year (2020).

    • @ctbully
      @ctbully 3 ปีที่แล้ว

      @@RalphBacon I use Microsoft Visual Code with the PlatformIO plugin, it works great once you understand how to set it up properly

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      I'm sure it is, John, and the same could be said about the Eclipse setup. It's a pity a more up-to-date compiler is not being used but that might change with the new Arduino IDE too. We'll just have to wait and see!

    • @oladunk9986
      @oladunk9986 3 ปีที่แล้ว

      We are always waiting for the next version.Nice tutorial . Thanks.

  • @Haamedtm
    @Haamedtm 4 ปีที่แล้ว +1

    Analog is not rubbish, get a decent in-amp and you can measure the current at high side of circuit with uA accuracy.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I believe you but you really must not take every word I say so seriously, Hamed! I have used the Hall Effect device very successfully in a mains project before but not in _this_ project, too much noise. They are both good products and each has its place but for my project I'm using the digital device. Great to hear from you, thanks for posting.

  • @peteradshead2383
    @peteradshead2383 3 ปีที่แล้ว +1

    I'm writing a library for the ina260 so I can tell you that the data sheet is nice bed time reading , 5 minutes of reading that and you are asleep, But you do get to know lots of information which people don't tell you about in their library.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว

      I love datasheets (when I have time to really read them). I'm glad you're similar in that respect (well, if you can stay awake long enough)! My Phone Charger project has been running for weeks and months now using that fantastic INA260. My phone is never charged beyond 95% and I then let it run down to 90% before it all starts again. I should really give it a maximum of 80% to _really_ save the battery but, hey, it's all good!

  • @largepimping
    @largepimping 4 ปีที่แล้ว

    Ralph, you have maximised your usage of "oi" in this video. Or is it "oy"? BTW, I'm using British Spelling(tm) in honour (there I go again) of you.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I am indeed honoured, thank you for your recognition that British English™ came first, before the colonies decided to corrupt it to their own ends. Too much? Sorry not sorry. Well, yes, that INA219 needs waking up and OI YOU seemed appropriate! An eager puppy if ever I saw one!

  • @AJB2K3
    @AJB2K3 4 ปีที่แล้ว

    Ive got a few ina219 modules sat in my box

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Time to put them to good use!

  • @crisselectronicprojects8408
    @crisselectronicprojects8408 4 ปีที่แล้ว

    If we combine ACS712 / 30A with ADS1115, do we get better results?

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      I haven't tried that, but if you remember when I did the project on the ADS1115 we also had a bit of noise on the inputs. I think the ACS712 is not really designed for low current measurement - not when they have 30A modules. Even the 5A could read 500mA "OK".

    • @crisselectronicprojects8408
      @crisselectronicprojects8408 4 ปีที่แล้ว

      @@RalphBacon
      I have to make a 2x30Vdc / 8A power supply for the laboratory and I would have liked to use ACS712 with ADS1115. Now I'm thinking about it and I don't know what I'm going to use.
      th-cam.com/video/jhdcxo9zza0/w-d-xo.html

    • @andymouse
      @andymouse 4 ปีที่แล้ว +1

      I'm using the ADS1115 a lot these days and find it great, love the little thing, so I don't see you having any problems if you clean up ACS712 output a bit.

    • @crisselectronicprojects8408
      @crisselectronicprojects8408 4 ปีที่แล้ว +1

      @@andymouse
      Thanks for the reply!

  • @kendrickapps674
    @kendrickapps674 4 ปีที่แล้ว

    The divide y 10 may well relate to the shunt resistor used.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Yes, the "magic number" is all down to the combination of parameters I used. The datasheet (and Adafruit's library) comments this very well but it was far too involved for my audience!

    • @kendrickapps674
      @kendrickapps674 4 ปีที่แล้ว

      Ralph S Bacon it may prove useful if you decide to change the shunt resistor to allow for a larger current reading. By altering the value and wattage of the shunt resistor a much higher voltage and current could be measured,the cost would be how the size of the units measured and calibration would be required,I might have a try to modify the sensor.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Indeed, either the datasheet or the Arduino library says you can change the resistor to 0.01Ω and measure 10 times the current.

  • @nickpelov
    @nickpelov 2 ปีที่แล้ว +1

    it's not apple to apple. The difference is not digital vs analog. The difference is shunt vs hall effect. One would choose hall effect because of the "zero" shunt resistance. So if you compare the two you should compare the resistances. Does the hall effect really add less series resistance. And usually hall effect is for high current situations - like I want to measure my server which draws between 30 to 150 watts from 12 volts. So how much loss will you have in shunt compared to hall effect sensor. Let's say that at full range the drop is 100mV * 10A = 1W. Even half that will bring a lot of heat which will also affect the measurements and also has other implications.

    • @RalphBacon
      @RalphBacon  2 ปีที่แล้ว

      Well, maybe; a lot of this was said at the time. I guess I was a bit unfair on the analog measuring device but I still love the INA219, works like a dream.

    • @teotwaki
      @teotwaki ปีที่แล้ว

      The drawback of the Hall Effect device is maintaining calibration for low (mA) currents. This device appears to be influenced by both local and natural magnetic fields, thus making it difficult to maintain calibration if the device is physically moved. The analog device solved all of my calibration problems.

    • @timmiyg5894
      @timmiyg5894 9 หลายเดือนก่อน

      Well said. But the INA219 only goes to 3.2A anyway. I too read 100 Watts at 12 volts, so the ACS712(20A) is ideal. It reads 100mv per amp over a 5 volt (2.5v centre) range. I use a resistor divider to measure over 3.3 volts.

  • @borayurt66
    @borayurt66 4 ปีที่แล้ว

    There is something very wrong there. I've used the same analog sensor like 2 years ago to make a battery charging current indicator for my motorcyle. My first try was a little jittery with a simple "read analog value, map it to an amps figure and display the result" code, but nothing like this at all. It was reading a steady zero when no current was flowing, and when there was current flow, the reading just jumped around like +/- 5 in 1023. Thinking that a steady reading would be more meaningful than a very fast update on the display, I changed the code to take 1000 samples (worked quicker than I expected and upped it to 5000 samples) and averaged them before mapping and displaying the result. Worked as well as expected but there were some linearity problems. Then, a friend of mine who knows maths (unlike me) came up with a statistical (?) formula that I could use instead of Arduino's map function to convert the analog value to actual amps figure. All he needed was some sample data (what increment in current gave what reading in analog value, all thru the range) which I provided with 20mA increments. His formula looked totally gibberish to me but I managed to implement it in the code. The result was perfect. I got a 0.01A accuracy and a rock steady display. I still have the code if you are interested.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I'd be interested in the sampling code, Bora. Whilst I could invent a rolling average algorithm myself there is no point in reinventing the wheel! Either email me it or place it in a shared storage area and I'll download it, thanks in advance. It would be good to get this working at low current values - I could show everyone too!

    • @borayurt66
      @borayurt66 4 ปีที่แล้ว

      @@RalphBacon Should I send it at the e-mail you have in the about tab?

    • @borayurt66
      @borayurt66 4 ปีที่แล้ว

      @@RalphBacon I sent it to the email in your about tab.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I have the code Bora, thank you. That library you use for the SSD1306 (and related) is ginormous! 238Mb! I will see how good it is in due course. The averaging formula was obtuse, to say the least, but I'll give it a whorl (I'm using a rolling 20-point average in my phone charger sketch at the moment but it is slow to react, perhaps that one will work better). You may see the results in a future video! Thanks again.

    • @borayurt66
      @borayurt66 4 ปีที่แล้ว +1

      @@RalphBacon The library itself is no problem, it is the fonts that take up all that space. I used 2 different fonts so the poor Atmega328 is almost out of memory, I know. But it looks good. :-) Hope I works fine. The numbers in the formula are derived from the curve plots I took with 20mA increments in 10A range. The sensor is not fully linear and I am afraid the non-linearity is device specific, so curve of my device may not fit with yours exactly. Good luck!

  • @asagk
    @asagk 4 ปีที่แล้ว

    Oi, by the way, Ralph, your 1mA off the track might also be caused by rouding issues when using 'floats' and converting them into 'int' and the rounding taking place when doing so.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      Indeed, I already mentioned this in a post below, Sebastian. I'm glad you think might be the issue too! I'll get this sorted for when I do my Smart Phone Charger, although as I say I'm not worried about the odd milliamp or six!

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      Oi, Oi Sebastian, I was looking for your previous post, which I though was quite funny, oi! but you have removed it, shame! (Did I say OI a lot? I was just getting the INA219's attention!)
      Yes, I am doing fine, thanks!

    • @asagk
      @asagk 4 ปีที่แล้ว

      @@RalphBacon Every time I post it, it disapears. Perhaps it cannot contain source code for some reason? I sent you an email with it anyways to the address you provided in this channel.

    • @asagk
      @asagk 4 ปีที่แล้ว

      ok, one more try ... just to see it disapearing for nonsense ... uint32_t divu10(uint32_t n) { uint32_t q, r; q = (n >> 1) + (n >> 2); q = q + (q >> 4); q = q + (q >> 8); q = q + (q >> 16); q = q >> 3; r = n - (((q

    • @asagk
      @asagk 4 ปีที่แล้ว

      Oi, Ralph! So, no reason to use a float, since it is pretty bloated and also discards the fraction part when converted into int while printing. The above example is quite small and speedy, while it does not make use of any multiply or divide but just shifts and add / substract. Of course the 328 does not know any sort of 32 bit values and has to emulate using them. But using a 32 bit float is still more costly most the time compared to uint32 emulation. Oi, and glad to hear you are fine by the way!

  • @misterAD88
    @misterAD88 4 ปีที่แล้ว

    Très bn vidéo mon ami.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Merci beaucoup! Merci d'avoir posté.

  • @AJB2K3
    @AJB2K3 4 ปีที่แล้ว

    Can you use the ina219 with those cheap usb 18650 chargers

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Yes, you can but you can "only" measure up to 2A unless you change the on-board resistor to a different (lower) value (Adafruit has some details in their library and so does the datasheet). I mention this because it is easy to suck out more than 2A from those batteries!

    • @AJB2K3
      @AJB2K3 4 ปีที่แล้ว

      @@RalphBacon I'm confused because some people use them on the positive and some one the negative side.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Not a great idea to use them on the negative side. This is because the "ground" reference can then constantly change which can upset the electronics. If you can, always install on the high side.

    • @AJB2K3
      @AJB2K3 4 ปีที่แล้ว +1

      @@RalphBacon Thank you for clearing that up for me. Now I know how to properly connect them.

  • @tubeDude48
    @tubeDude48 4 ปีที่แล้ว +1

    You could cheat and add -1 to Serial.println((int) (value / 10)-1);

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      But that would indeed be cheating and what do we do when it accurately reports 500mA? Better to find out why it is 1mA out (which I will try to do in my Smart Phone project). Stay tuned!

    • @Roy_Tellason
      @Roy_Tellason 4 ปีที่แล้ว

      @@RalphBacon I'll bet it has something to do with that release of the magic smoke. :-)

  • @Brian_Of_Melbourne
    @Brian_Of_Melbourne 4 ปีที่แล้ว

    You should be aware that your code: "float value = ((Wire.read()

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      So, does the GCC compiler not compile from left to right when all other things are equal? Or is it optimisation that might put things in a different order? It works now, so will it always work, or was it just good luck it worked? I'll check and see how Adafruit do it too, thanks for the heads-up, Brian, appreciated.

    • @Brian_Of_Melbourne
      @Brian_Of_Melbourne 4 ปีที่แล้ว +1

      @@RalphBacon The thing is it works today, and will probably continue to work for this compiler family, but it is not guaranteed. A later (or earlier) compiler may behave differently. A different compiler for a different target may well behave differently. e.g. The ESP32 compiler, the PIC compiler, GCC vs ARM vs ST for the ARM. And in general - if it works by chance then that's great but remains a possible future bug that's will be hard to find.

    • @mattshepcar2866
      @mattshepcar2866 4 ปีที่แล้ว +1

      Very good point. I have had to debug a very similar issue to this in a big project before so it's definitely not just theoretical. It was a real pain to debug because it only showed up with certain compiler settings: turning compiler optimisations off made it go away. It's probably best to write a wrapper function for reading 16 bit values which makes your code look a bit cleaner too.

    • @superdau
      @superdau 4 ปีที่แล้ว

      Isn't it also the case that you can't be sure on which data type the operations are done on if you mix them without explicit type casting?
      Btw. I'm cringing as always at the use of floats in an Arduino program for anything else but the immediate display of a value (and even there it is often unnecessary). ;)

  • @Ed19601
    @Ed19601 4 ปีที่แล้ว

    Interesting stuff

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      Glad you think so, expect to see one of the modules (I wonder which one) in my final Smart Phone Charger project.

  • @timmiyg5894
    @timmiyg5894 9 หลายเดือนก่อน

    I gain much from your tutorials. In this case, however, it's 'horses for courses'. The ACS712 is great at measuring high currents. I use them for linear actuator loads of 6 amps or more using the 20 amp model. The INA219 does not go over ~3.2 amps. With an ESP32 it can read to an accuracy of 12 bits. Using an ADS1115, it can read to 16 bit accuracy (15bits +-). The INA219 also offers a maximum of 12 bit resolution but being digital, can not be increased by using say, an ADS1115. Does an INA219 read negative current, something I need for linear actuators where current flows in both directions? Please, do not 'rubbish' a device when it was just not suited for your project of reading a phone charging-current, where I too, would use a INA219.

    • @RalphBacon
      @RalphBacon  9 หลายเดือนก่อน

      Yes, you're right, of course; an open-minded balanced approach is always the better option. Lesson learned!

  • @TheUnofficialMaker
    @TheUnofficialMaker ปีที่แล้ว

    well done

  • @DavidLeeMenefee
    @DavidLeeMenefee 4 ปีที่แล้ว

    thumbs up, hope you're doing fine.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      Thanks for the visit and yes, things are improving a little it must be said.

  • @flemmingchristiansen2462
    @flemmingchristiansen2462 4 ปีที่แล้ว

    As I Remember the analog one is a wire through a coil, when measuring those low values you have some stray resistance such as bad connectors, wire resistance and noise go right through.
    With the digital one, the noise is still there but it is canceled out by the op-amp configuration (differential) and there by leaving the voltage across the shunt resistor.
    It seems that you are shooting canaries with cannons (if that is the right term).
    You don't really need that "fancy" chip with the Arduino, you already have the ADC in the Arduino.
    You could do that with an op-amp connected to the analog port on the arduino and let Arduino do the conversion.

    • @Conservator.
      @Conservator. 4 ปีที่แล้ว

      Yes, and the software averages 8 measurements to a single output value.
      That simple code would have improved the hall-effect sensor too.
      (The Arduino only has a 10 bit adc whereas the ‘digital’ sensor has a 12 bit adc. And as Jens Schröder pointed out below only 9 bits are used by the Arduino sketch).

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Tried that, Flemming, didn't work very well. Purpose built devices will always have the edge. And make it very simple to connect to. It's joining my Smart Phone Charger project now!

    • @flemmingchristiansen2462
      @flemmingchristiansen2462 4 ปีที่แล้ว +1

      @@RalphBacon I do look forward to the finished charger.
      The purpose build will of course have the edge, i admit i didn't think it through. It would probably be more expensive to build up a stabil differential op-amp circuit.

  • @Roel_Scoot
    @Roel_Scoot 2 ปีที่แล้ว

    You can shed a lot of the noise by taking the mean value of a series of measurements.

    • @RalphBacon
      @RalphBacon  2 ปีที่แล้ว

      I do that with my Smart Phone Charger. I take 10 readings into a rolling buffer and take the average (ignoring any [initial] zero values). Works well.

  • @ImnotChuck.
    @ImnotChuck. 4 ปีที่แล้ว

    INA219 (digital) begins at 9:30.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I forgot to put the time codes in the description, thanks for that.

  • @Graham1904
    @Graham1904 4 ปีที่แล้ว

    Shipping charges penalised by Covid-19?

    • @jessicacarter8264
      @jessicacarter8264 4 ปีที่แล้ว +1

      It'd certainly make sense, there's a lot less passenger jets flying around. Quite a few packages travel with passenger jets. Less jets, less 'cheap' posting options since you have to use (and plan) a dedicated journey for your packages.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +2

      I never knew passenger jets took mail but if there is capacity it makes good sense! Now, no passenger jets to speak of (especially not from China) so prices go up. Drat and double drat!

    • @superdau
      @superdau 4 ปีที่แล้ว

      @@RalphBacon
      About half of all air cargo is transported on passenger planes. That means there's a huge drop in capacity right now. That's also why many passenger airline companies have now started to cargo only flights with their planes, sometimes even filling the seats with boxes. Apparently that's better than leaving the planes grounded.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      That makes sense. If I were an aircraft company owner I'd do that as long as it was profitable.

    • @jessicacarter8264
      @jessicacarter8264 4 ปีที่แล้ว +1

      Yeah. The more time a plane is on the ground 'idle' the more money it wastes. If a plane is grounded too long they have to do a full plane inspection (a 'C' check) before it's cleared to fly again. If I had planes, I certainly would repurpose them for deliveries right now. Every minute a plane is grounded it costs thousands.

  • @DeeegerD
    @DeeegerD 4 ปีที่แล้ว +2

    Shipping has killed my ordering unless it's something I need not want ;)

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +2

      Tell me about it, Digger D. I too have reduced my orders. Kind of ironic, don't you think?

    • @DeeegerD
      @DeeegerD 4 ปีที่แล้ว +1

      @@RalphBacon It's probably that huge supply I've already ordered over the years ;)

    • @Roy_Tellason
      @Roy_Tellason 4 ปีที่แล้ว

      I've noticed that increase in shipping costs too, even when looking at something that appears in an earlier video which shows free or very cheap shipping costs. i suspect that them wanting tracking has something to do with our current "car owner" situation...

  • @saturdayscience5540
    @saturdayscience5540 4 ปีที่แล้ว

    Wow! You really do have a downer on Hall effect devices. You have a downer on analogue devices [end to end]. You are right that Hall is the wrong choice for this project but can be excellent in the right project. Calculate the magnetic field for a single coil at 10mA or 50mA and it's naff all. You clearly have a massive chip on the shoulder. I used Hall current monitor on the motor supply of an industrial powder agglomerater and could tell what particle size was inside the bowl by looking at the Hall FFT. Current or power from sophisticated VSD detected nothing. Horses for courses.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      Not at all, Michael. In this particular use case, however, it became apparent to whilst testing each device that the Hall Effect device was not going to be suitable. Hence the slightly dismissive tone, but in my defence I do say that it would work much better at higher amps. I've actually used one on a Tumble Dryer (240AC mains) so that I knew when it was finished drying as it had no alarm to let me (OK, my wife) know. So I do know they have their place, just not in this project!

  • @jessicacarter8264
    @jessicacarter8264 4 ปีที่แล้ว +1

    Nice, finally a video where you don't have me rush to $ELECTRONICS_STORE and want to put an order in, since I already have both. I got them because I'd like to make a discharge tester for batteries so I can see how many mAh are in them.
    I tried making one with a mosfet but got one with a gate voltage of 10v so it wouldn't turn on properly, then the ADC was giving me meaningless gibberish too (like when I asked you about getting vBAT from a LiPo cell) ... So I got the INA219 and the ACS712. I picked up a 30A version of it. I can't remember for why now but it's always good to have modules for those "what if" moments. Oh also, remember me telling you about the memory project? I got a 2.1" eInk display to play with. They're expensive though and more suited towards RPi but you can get some output from a standard Arduino (allegedly!). I haven't gotten much done, still aren't able to concentrate that well and health is bad.
    Hope you're staying safe! How are things with your eye going? In this video it looked like you were seeing a bit better (especially on that whiteboard bit), is this a sign of improvement? :)

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      Last question first then, Jess. I had my eye op on 6th April (cataract removal) and whilst a great improvement I will probably need laser surgery to complete it, a "five minute" job, apparently. Then my other eye needs doing which is now quite cloudy. Unlike the sky today, which is clear, blue and sunny!
      I agree that having parts to hand is a great idea. I often just add a few "interesting" ones to orders I place from China - at those prices it is silly not to! But now that shipping is no longer free it's not so frequent.
      If you get the e-Ink display working please let me know! Sorry to hear your health is not great. But perhaps the summer sun will cheer you up a bit, along with my videos! Keep safe.

  • @jensschroder8214
    @jensschroder8214 4 ปีที่แล้ว

    if you read from 512 to 1024 you get only 9 bit resolotion.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Yes, as the module is bidirectional we lose bits, correct.

    • @superdau
      @superdau 4 ปีที่แล้ว

      @@RalphBacon
      Not only that, but it also doesn't go to the rails at both ends, especially with the 5A version.

  • @theonlymudgel
    @theonlymudgel 4 ปีที่แล้ว +1

    Aha! There’s all that “easy” coding again. Grrrrrrrrrrrrrrr! I need a headache pill or 2..

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      Just use my code, Greg, and it "just works". Once it's up and running you can dig a bit deeper and change things, secure in the knowledge that you have a working model.

  • @4funrc11
    @4funrc11 4 ปีที่แล้ว

    Sweet 👍

  • @TheWareek
    @TheWareek 4 ปีที่แล้ว

    Im sorry analogue was good enough for Dr Frankenstein its good enough for me.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      Indeed, my last monster made use of analog signals, this time I fancied a change.

  • @Chrisamic
    @Chrisamic 4 ปีที่แล้ว

    Analogue = bad
    Digital = good
    Got it, LOL

    • @kennmossman8701
      @kennmossman8701 4 ปีที่แล้ว

      analog; faster, cheaper, less code so less taxing on memory, non-intrusive, much higher upper limit(?)
      digital: slower, more $$, more code and more complex, higher accuracy, intrusive

    • @theonlymudgel
      @theonlymudgel 4 ปีที่แล้ว

      I like that analogue sound.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Analog = inaccurate, prone to external interference
      Digital = intelligent, programmable interface, $1 more
      Let me have a think about this...

  • @edwardpaulsen1074
    @edwardpaulsen1074 4 ปีที่แล้ว +2

    Your thorough bias against analog is woefully evident... Your perceptions and maths are way off and your rudimentary code is shite. Strange that the highest precision lab equipment uses analog measurements for precision down into the microamps... You only tested **one** raw sensor configuration (with no built in circuitry, and the worse one for your type of measurement) and make the bold claim that *"analog is bad"*... Oddly enough, in your description you ask which method is better *"for all circuits"* up to 26V and 30A So, yet another reason why the method you used was very inappropriate for the application you showed. Next you go into an explanation about the mV reading being 0-1023 and half of that being 511.5 and since there is no such thing in binary, and 0 is the "first digit" of the total range count of 1024... in fact 511 is the halfway point then you compound the error by using the Fixed width integer command of "uint16_T" which is *NOT* normally used excepting for code portability between different processor types and is of a 16 bit (65,536) range as opposed to the 10 bit (1,024) range of the actual Arduino ADC (which is actually done within the ACS712 library and should not be called out for your final reading in the external arduino loop!) .... then you further compound this mess by using the raw data with none of the required maths to translate that into an *actual mA (milliamp) reading*! Nearly *Every* other example of using this part has far more code involved for getting an accurate mA reading... All you are displaying is the binary bit code from the arduino ADC of the **mV** signal being sent by the ACS712 directly... at 185mV/A... so for a +/-5A range (assuming the use of a ACS712-05A or -05B which is *Actually* -5A to 5A *NOT* the 0-5A you say) you have a total of 1,850mV to spread across that 1024 digital range or about 1.8mV per digital unit. It is *STILL* measuring *millivolts*!!!! Either way, your absolute maximum resolution is approximately 10mA per unit. **IF** it is done correctly.
    Suffice it to say that this particular sensor range is obviously not going to be very good for your application... this is not the fault of the sensor but in the choice made by the designer You are using a raw sensor with a range of -5A to 5A which is a total of 10 amps and when divided by the 1024 digital ADC range only gives a precision (with proper maths) of the aforementioned 10mA... then you have only used the equivalent of a shoddy "debounce" code for your smoothing rather than the proper averaging code necessary in proper coding , that 500 millisecond "delay"" allows 40,000 outputs of the sensor.... do you see the problem here?
    The take home from this is *NOT* that analog as a method is "bad" as it can be one of the most accurate methods of all if used (and programmed) properly, but to choose your sensor according to the desired usage. Since this particular part is not conducive to the types of very small readings you desire, find one that is!
    By the way, your INA219 is **ALSO** an "analog" sensor that has *additional circuitry* to convert it to a digital I2C Communication format!!! It also has a listed accuracy from the inbuilt ADC of 10 *Micro*volts rather than the 10*milli*volts of that raw ACS712 sensor... So your argument is spurious and misleading at best! They built circuitry to perform all the functions you didn't want to do with the raw ACS712 circuit and packaged it with a simpler digital user interface... basically and essentially performing the function of the ACS712 raw sensor and a properly programmed arduino (which can perform the same I2C output) and then feeding that output into your "measurement" arduino... Perhaps a better title would have been Raw analog signal or integrated circuit analog to digital module....

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      Oh, Edward, you've read far too much into what I said. There's nothing intrinsically wrong with analog and, as you rightly point out, the INA219 (or any other device that reads a shunt voltage) must also read an _analog_ voltage and convert that to a digital data value.
      I've used a similar analog device that reads household AC current going to my washing machine so we knew when it was finished!
      Yes, I know I was being a little unfair to the poor old ACS712 but I was trying to show how the INA219 with its I2C interface could be "talked to". Anyway, you've taken it too much to heart. I shall have to do another video on the ACS712 in the future to redress the balance, I can see that! Keep tuned, you will catch the update and thanks for posting!

    • @edwardpaulsen1074
      @edwardpaulsen1074 4 ปีที่แล้ว

      @@RalphBacon I can respect that... I have a history in instrumentation including high precision equipment and was hoping to elucidate to those with "less experience" that analog has it's place but can, admittedly, be a but more finicky to get good readings from, and requires matching the type of sensor more closely with the desired outcome or application. Well met good sir and I look forward to more videos! I find that I am enjoying the others I have watched and have subscribed.