4-20mA Industrial Sensor + Arduino

Поделиться
HTML-код
  • Опубликовано: 20 июн 2017
  • How to build a simple 4-20mA transducer circuit on Arduino. It's easy: add a 250 ohm resistor. If you want more protection for the Arduino, you'll need to add zener diodes and a 10k resistor to the Arduino analog pin. 🔥 teespring.com/SafetySquints_us
    Shop Supplies www.etsy.com/ca/shop/AvEwerkz 🔥
  • НаукаНаука

Комментарии • 412

  • @swp466
    @swp466 7 лет назад +37

    3:46 -- I think you mean 5V divided by 20mA as that's what would give you 250 ohm.

  • @WarrenGarabrandt
    @WarrenGarabrandt 7 лет назад

    I love that you lead with the TL;DR, then go into the intro and explain what's going on for those of use who decide we care about that topic. Cheers!

  • @steckkasten
    @steckkasten 7 лет назад +2

    I really like your videos! I'm studying electrical engineering - It's just so cool to take a look inside stuff I wouldn't want to break and seeing how much we've actually learned. Thank you!

  • @thierryboudanphotography4562
    @thierryboudanphotography4562 7 лет назад

    This video explains something i never thought to question. Having worked with PLC's which you can usually select which type of device you connected ( 4-20ma or 0-5v ), and usually having the option to choose which I bought for the job there was never a need to think about it.
    It is very logical and this will stick with me.
    Thanks

  • @DirceuCorsetti
    @DirceuCorsetti 7 лет назад

    This is well timed. I'm going to build one to log the temperature of my in-laws heating system. Just so much cheaper than to rent a data logger. Simply put: this is the best channel on RUclips period.

  • @Samv6271
    @Samv6271 7 лет назад +8

    finally the Arduino sensor vid!

  • @johnforrestboone1
    @johnforrestboone1 7 лет назад

    i really like these kinds of videos of ave. i like when he nerds out and i learn to love something.

  • @NathanNametka
    @NathanNametka 7 лет назад

    Holy shit. I literally ran into this problem at work today and was braining about how to fix it. You rock!

  • @elioselectric468
    @elioselectric468 4 года назад

    Wired a water treatment room for an aerospace manufacturer about 7 years ago. It was a beautiful decent sized industrial job. There was one 460 Volts PLC controlling everything. To someone who doesn't know much about it, it would look complicated but it's really not. There is inputs and outputs, and the 4-20ma sensors talk to the PLC which through programming and miscellaneous switches controls the vfd's for the pumps according to what the client needs. Of course the wiring diagram was engineered nicely, we just run the wiring and build the system. Still to this day it was my favorite job.

  • @susedianinso
    @susedianinso 7 лет назад +46

    AVE Has super powers ! watch him turn 3 10ohm resistors into a 250ohm resistor @ 4:30 :D
    Yes, i realized what he did was 220 ohm + 3*10 ohm

  • @CrazyBackwoods
    @CrazyBackwoods 7 лет назад

    the videos of you releasing the shmoo are better for us gear heads and were getting less of our shmoo fix here lately and i still need some freebies

  • @manytoolsmike
    @manytoolsmike 7 лет назад

    I was just trying to figure this out. perfect timing.

  • @microk7648
    @microk7648 Год назад +1

    Everything I needed to know within 50 seconds, good ol' boy!

  • @raymondmarsolais519
    @raymondmarsolais519 7 лет назад +1

    thanks for your vids dude keep em coming

  • @Leadfoot70
    @Leadfoot70 7 лет назад +4

    AvE, Based on your comments near the end of the video, or in case you were not aware...
    Plotting the data coming from the serial port is super easy. Just remove all the extraneous Serial.print commands, and instead just print the value (for instance, your calculated PSI) to the serial port via a single "Serial.println(outputValue);". Once you've made those changes, then instead of choosing the "Tools"..."Serial Monitor" to open up the serial window, simply choose "Tools"..."Serial Plotter" and you'll get a pretty self-sizing graph next time you run your program.
    Hope this helps...Mike

  • @microbuilder
    @microbuilder 7 лет назад +62

    Dont sweat the petty, pet the sweaty!
    Now THAT is some good advice...if you'll excuse me, I have some petting to do...

  • @joefrisco
    @joefrisco 7 лет назад +4

    In school we always did our arithmetic using kOhms, mA, and volts. So 20 v / 20 mA = 1 kOhm. As long as you express the values in these units you can simply do the arithmetic 20/20=1

    • @TekCroach
      @TekCroach Год назад

      But he’s got 250 ohms. 😮

  • @sjmww1235
    @sjmww1235 6 лет назад

    Interesting, especially learning why you use 4-20mA sensors vs analog voltage sensors

  • @zzchadzz
    @zzchadzz 7 лет назад

    I have no idea what, where, how, I would ever use this but I enjoyed it.

  • @GrandHunterMan
    @GrandHunterMan 7 лет назад

    I've seen the map function used in some other programs before but never really understood what it did, even after I looked it up. Just you giving a brief explanation did more than countless articles online. Thanks Uncle Bumblefuck.

  • @Tj55333
    @Tj55333 7 лет назад +2

    Ave! Just a suggestion, since you're so good at explaining things.... You should make a video about how use an arduino or some other controller in conjunction with sensors and a control element. All together to make a simple PID control loop! I know it would really help me in my schooling.

  • @silvermediastudio
    @silvermediastudio 7 лет назад

    Instrumentation and data acquisition is an art form. This is brush clearing.

  • @cabbiea12
    @cabbiea12 7 лет назад

    Just got my tap chart t-shirt in the mail, and had to explain to the the wife why it was upside down. Thanks for the videos.

  • @MaltaLumpie
    @MaltaLumpie 7 лет назад

    That hug I got from the van was quite warm and sticky 6/10

  • @KamiCrit
    @KamiCrit 7 лет назад

    Great video, I get to work with 4-20 equipment so it's great to learn more about these great industrial devices.
    But that paper napkin maths. Answer seemed a little funny.

  • @stevenbiars6212
    @stevenbiars6212 7 лет назад

    UA Level 1 instrumentation tech here. Enjoyed the vidjeo.

  • @chadkrause6574
    @chadkrause6574 2 года назад

    Messiest desk, cleanest explanation. Thanks!

  • @lucaspye9434
    @lucaspye9434 4 года назад +1

    You have no idea how helpful this was for me, thank you so much!

  • @spikeydapikey1483
    @spikeydapikey1483 7 лет назад

    Yay, Uncle Bumblefook is back!

  • @mattmoreira210
    @mattmoreira210 7 лет назад

    To take advantage of the full resolution of the AVR microcontroller's ADC, you can add gain and offset adjustment with a 741 opamp.

  • @Braeden123698745
    @Braeden123698745 7 лет назад

    Awesome video

  • @ingenioID
    @ingenioID 4 года назад

    great job bro !!

  • @geraldgepes
    @geraldgepes 7 лет назад

    One of these days, one of these tricks, is literally going to save lives.

  • @Eytaris
    @Eytaris 7 лет назад

    it's interesting, I got a lot of sensors in working condition from scraping industrial machines, I never got the time to hook them up to an arduino (because, first, I rarely work directly on electronics so my experience is limited, I mostly work on automatic systems that have all the electronic components built-in the I/O devices and second, I'm lazy as frakk). so thanks for this video, it may probably kick me out of my laziness and try!

  • @gproto1
    @gproto1 7 лет назад

    thhanks for the video Ave!

  • @williamensign1408
    @williamensign1408 7 лет назад

    This is great, I going right now to Graingers to buy a dozen of these things. Thanks

  • @MichaelSteeves
    @MichaelSteeves 7 лет назад +4

    You have hit my specialty area! We use 225 ohm resistors (0.9 to 4.5 VDC). You can detect some failures where the current goes above 20 mA or below 4 mA. The current loop allows you to have multiple devices in the loop (panel meters, current switches etc.) without affected the output. Since the loop doesn't care about resistance (within limits) it is unaffected by resistance in the wiring.
    Just be careful about the configuration so that you don't have a power supply with a grounded negative, then ground the loop somewhere else.

    • @gavster89
      @gavster89 7 лет назад +1

      Michael Steeves you need to make sure the power supply can drop the voltage for each device but otherwise yes. Just use 220R for an Arduino, it's an E12 value

  • @jackcaldwell485
    @jackcaldwell485 7 лет назад

    thanks , I do learn something even when you are making a funny video! I've always dreaded messing with electrical things , now I am not so skiddish of it!

  • @cicibradley2809
    @cicibradley2809 7 лет назад

    Present and ready to learn.

  • @carringtonfuels9462
    @carringtonfuels9462 3 года назад

    works a dream thank you

  • @jarjarbeans
    @jarjarbeans 4 года назад +1

    Nice video. I'm watching forma Perú and it help a lot. Best wishes for your channel.

  • @jonluchtefeld6639
    @jonluchtefeld6639 7 лет назад

    relearning my electronics classes, all over again.

  • @lastick56
    @lastick56 7 лет назад

    just what i needed

  • @danielrbdr
    @danielrbdr 7 лет назад +22

    If you send the values from the arduino to the pc you can open the serial plotter(tools->serial plotter) in the arduino IDE and show a graph of the values comming in

    • @gordonlawrence3537
      @gordonlawrence3537 7 лет назад +2

      Or just use a Pi with an ADC hooked up.

    • @Sebbl3
      @Sebbl3 7 лет назад +11

      Gordon Lawrence "just" .. I would say the arduino solution is way easier to get it running

  • @Johnsmith-uc9df
    @Johnsmith-uc9df 4 года назад

    Thanks for sharing mate

  • @ws_stelzi79
    @ws_stelzi79 7 лет назад

    Interesting 2 chanel power suply you made. Looks like to be a 19" standard to fit in a server cabinet.

  • @IrishHitman79
    @IrishHitman79 7 лет назад +2

    more of this kinda witchcraft pls... Great vid.

  • @breezyjr
    @breezyjr 7 лет назад

    I have no idea what you're talking about... But, I find it incredibly interesting...

  • @firehawk6188
    @firehawk6188 7 лет назад

    Bastard got me. I'm running it over and over in my head how the F does one get 250 ohms from 3-10ohm resistors. It didn't occur to me until I finally got that marble loose in the old can of brake clean I have had on my shelf for years!
    You had me really questioning myself.
    Never doubt AVE!

  • @AmateurRedneckWorkshop
    @AmateurRedneckWorkshop 7 лет назад

    Very useful information.

  • @Simon_Bahr450
    @Simon_Bahr450 7 лет назад +2

    Awesome! Thanks for posting this! I'm assuming you can do the same thing with a 0-5V output sensor?

  • @junuhunuproductions
    @junuhunuproductions 5 лет назад

    Interesting video.

  • @JulienCope
    @JulienCope 7 лет назад +20

    Do i have to watch this right now at work or will this video be removed again!?!?

  • @bigrobbyd.6805
    @bigrobbyd.6805 7 лет назад

    Way above my head, but darn entertaining.

  • @Oskard2017
    @Oskard2017 7 лет назад +2

    Fraid you lost me on this one. Thanks for the Video though! I'll check out the next one.

  • @farmerdave7965
    @farmerdave7965 4 года назад

    The reading that is measured by the arduino depends on the precision of the 250 ohm resistor. At my steel mill we always purchased expensive high precision 250 ohm resistors.

  • @adammcblain428
    @adammcblain428 7 лет назад

    AvE, you could do a pretty cool video with feedback control loops using this setup, just need to get your hands on a control valve or something similar.

  • @mrkattm
    @mrkattm 7 лет назад

    Good video, very valid approach to convert current into a voltage, however a more Skookum way would be to use a Transimpedance amplifier, just google it on the confuser.

  • @BiddieTube
    @BiddieTube 7 лет назад

    You godda, you just have to graph it! Please do follow up video, take this thing to the limit, and past.
    I have liked your videos, but this video brings you up a big notch, this is the cool and fun stuff that we can participate in with for most part, almost no monetary investment.

  • @LazerLord10
    @LazerLord10 7 лет назад +4

    Perhaps some of the errors in the readings are from poor tolerance resistors?

  • @youtubered7856
    @youtubered7856 7 лет назад

    Thx for the vid AvE!!

    • @youtubered7856
      @youtubered7856 7 лет назад

      can't get enough arderno related vids!!

    • @jp040759
      @jp040759 7 лет назад

      I agree. I love them things. Always looking for a problem to solve with an Arduino solution. Just finished a automatic live well pump timer control for my boat. Very basic problem but I needed a new timer. I made mine all solid state. Saved $65.00 USD making my own to boot. The original one had a relay for switching the pump motor power. I used a MOSFET to power the motor. Works great.

  • @diegofortiz5865
    @diegofortiz5865 4 года назад +1

    Thanks man !!

  • @robertoswald2321
    @robertoswald2321 4 года назад +1

    Will do a review on the micsig tablet mini scope

  • @storm19001
    @storm19001 7 лет назад

    Don't know if they all ready have something like that on a car but it would be cool to apply this to the air pressure system on a car with a little turner comfuser or a little electric gauge, so if you have air lockers or air compressors in your truck and don't have an easy way to see pressures and stuff while on a trail.

  • @prototype3a
    @prototype3a 7 лет назад

    For what it's worth, if you're using a 6" bourdon tube gauge as your calibration standard, they're typically +/- 1% of full scale. Heise (mirror backed) gauges are generally 0.1% or better.

  • @PLCDROID
    @PLCDROID 6 лет назад

    Nice sir ....

  • @davidcoakley85
    @davidcoakley85 7 лет назад +1

    AvE you should do a vijeyo on DIY air bearings!

  • @AEON.
    @AEON. 7 лет назад

    Never going to use this stuff - but yet - I am zombied into watching it! lol

  • @PaftDunk
    @PaftDunk 7 лет назад

    it's bacckkkkk

  • @necro_nemesis
    @necro_nemesis 7 лет назад +1

    I'm in the habit of constraining values in addition to mapping them when reading from analogue devices. This eliminates generating errors from erroneous input in later code if you're working with returned values such as when the circuit wasn't powered and returned negative values.

  • @Extreme99Gamer
    @Extreme99Gamer 7 лет назад +1

    If you want to correct for non-linieraty you should make a function (or maybe look it up in the data sheet for the sensor) and use that instead of the linear map() function

  • @SpencerWebb
    @SpencerWebb 7 лет назад

    Have you enjoyed the outdoor seating at The Boathouse in White Rock? One of my favorites.

  • @donzmilky5961
    @donzmilky5961 7 лет назад

    its odd my favorite creepy uncle is posting vjos on load sensors when my new job heavily relies on load sensors and is really the first time I've knowingly been around such a device in the open where I can see it at least.
    hopefully this info will score me some brownie points and possibly a tech job in the future.

  • @SirArghPirate
    @SirArghPirate 7 лет назад

    you can graph it directly in the most recent versions of the Arduino IDE.

  • @corgano6068
    @corgano6068 7 лет назад +1

    Thinking of the "blue smoke" video you released the other day, we need someone who can do BOLTR reviews of electronicals. Pop the cap off, put it under an electron microscope, talk about how the bits wrangle pixies and see how skookum it is.

  • @darrenu1339
    @darrenu1339 7 лет назад

    Nice!

  • @amargnwalkr
    @amargnwalkr 7 лет назад +3

    AvE, you should check out William Osman's new video- exploding resisters- quite enjoyable.

  • @WeighedWilson
    @WeighedWilson 7 лет назад +1

    we applied the cortical electrodes but were unable to get a neural response from either patient... great vijeo AvE!

  • @alecdacyczyn
    @alecdacyczyn 7 лет назад +12

    Many people here are saying that he did the math wrong an should be using a 1K resistor because 20V / 20ma = 1kohm.
    No. 250 ohm is correct. He's simply using a resistor to convert current output to voltage. The sensor lets through current and the resulting voltage developed is based on the resistance (up to a limit... cannot be higher than the supply).
    V@4ma = 250Ω * .004A = 1V
    V@20ma = 250Ω * .020A = 5V

    • @alexgray552
      @alexgray552 7 лет назад +12

      Yeah that's the right answer, but he wrote down the wrong math! He wrote and said "20V/20mA=250 ohm", which is plain wrong. He should have written 5V/20mA=250 ohm.

    • @DanHaiduc
      @DanHaiduc 5 лет назад +2

      I agree with Alex Gray: AvE shouldn't actively try to mess up with our heads.
      Math. Not even once.

    • @chadrobbins7329
      @chadrobbins7329 5 лет назад

      The 20mA should be represented in amps before the division. 24v/0.02amps = 1.2kohms. Ohms law is Voltage divided by amps x resistance in ohms. Not Voltage divided by milliamps x ohms

  • @ACA332
    @ACA332 7 лет назад +2

    Swapped out a controller once, old devices were setup for either sink or source 4-20mA, can't remember which but our new controller was setup for the opposite. Ended up dead shorting a 96VA 120/24VAC transformer. She hummed like a bastard but there was enough cable length there that it didn't immediately trip the overload. Scared the bejesus out of me.

  • @JD-ub5ic
    @JD-ub5ic 7 лет назад

    Wow this was incredibly useful. Opens up a ton of options for sensors for arduino that I didn't know enough to consider before. Thank you, uncle bumblefuck!

  • @ThCrunch
    @ThCrunch 7 лет назад

    Make sure you use a high accuracy resistor too or it will add to your measurement error (possibly significantly)

  • @etelmo
    @etelmo 7 лет назад +1

    Depending on how the sensor is rated I would suggest that the lower value (100) isn't actually 0 psi, it's likely closer to 14.7 psi depending somewhat on your elevation (14.7 psi would be sea level, 13 psi would be 1042m/3420ft, etc).

    • @chrisdockman7237
      @chrisdockman7237 5 месяцев назад

      You would only do that if you're trying to measure absolute. He's reading PSIG.

  • @samuelrosen137
    @samuelrosen137 7 лет назад +3

    For better, more functional code that properly handles below 4ma errors:
    short read420(analogPin){
    sensorValue = (short)(analogRead(analogPin)-204); //is an approximation of the 4ma value
    if (sensorValue < 200){ //is under the 4ma value by some quantity to account for component aging and noise
    sensorValue = -1;
    }
    return sensorValue;
    }
    //Note that -1 is an error code and anything positive is a good value

  • @gordonlawrence3537
    @gordonlawrence3537 7 лет назад

    Dependant on ADC then a couple of 100R in parallel would be better as at 20mA you get less voltage drop (1V) so there is less of an issue from errors when the battery runs low. EG if the circuit in the transducer needs say 4V and you use a 200R resistor (E96 value) then you have a 4V drop at full scale. That means if you are powering it from a 9V battery you will be seeing drift well before the battery is low (7.2V). Noise really is nothing like as much of an issue with a differential twisted pair as it would be with say a single ended shielded co-ax so you don't really need to worry about reducing from 5V to 1V FSD.

  • @hamitavcoglu9813
    @hamitavcoglu9813 3 года назад

    Greaatt!!

  • @zaplocked
    @zaplocked 7 лет назад

    Nice

  • @ryandueck5054
    @ryandueck5054 7 лет назад

    i wish i had a pile of those on my old pneumatic system; for faster solenoid changing more run time, only for the odd solenoid but still good troubleshooting tool could get ready faster for complex pneumatic system rise the initial cost and clean air of course; mechanics dream system; wish i could co design for run time championship

  • @ajtrvll
    @ajtrvll 7 лет назад +1

    "Only 2 pins... can't be that complicated to hook up"... infamous words uttered by very man moments before hoopajooping it.

  • @paultucker2027
    @paultucker2027 7 лет назад +1

    in your diagram the +/- on sensor are wrong way round. Also with your wiring, if the 24v gnd and auduino gnd connect the auduino will let the smoke and/or schmoo out. if you connect the 24v to sensor and put 250R between sensor and gnd, then sensor and auduino using same gnd reference and the circuit will be much safer.

  • @Scotty519
    @Scotty519 7 лет назад

    Could do a basic curve fit in excel to calibrate the sensor. I'd bet a simple 2-3 term fit would get you plenty of accuracy.

  • @timyoung6682
    @timyoung6682 4 года назад

    I at one time calibrated these for a living. To source a pressure point. You actually use your one fluke there and source 4-20 mA and see if it’s reading correctly.

  • @smindustries8847
    @smindustries8847 4 года назад

    If say you wanted to use this method to read 2 different pressure sensors both with the same 4-20mA output signal would you simply connect the +ve side of the second sensors limiting resistor to a different analogue input in the arduino and connect the - side of the second sensors limiting resistor to the same arduino ground?

  • @flymario8046
    @flymario8046 4 года назад

    Is that really how simple it is? Nice. If I die... you are gonna have to support my wife! ;)

  • @oqsy
    @oqsy 7 лет назад

    When AvE reads code I find it very tricky to power through and finish the stroke. Barely finished this time. I guess it's endurance training.

  • @stefanwosinsky1935
    @stefanwosinsky1935 7 лет назад

    The ' heeere we go' reminds me of the finnish dude from the hydraulic press channel

    • @alex_ottomano
      @alex_ottomano 7 лет назад

      stefan wosinsky because that's exactly wat he's referring to

  • @Superhobo40
    @Superhobo40 7 лет назад

    I'm pretty sure the Arduino IDE has a built in serial plotter now so you don't have to use processing.

  • @TheLRRPS
    @TheLRRPS 7 лет назад

    I'm not first, but I noticed this video was uploaded than took down a week or so ago. Do I win a prize for having such arcane dark knowledge?

  • @TheTheSammus
    @TheTheSammus 7 лет назад +1

    Hey , Ave why not get a few data points, and make discrete linear equations for each line segment. Then all it takes is a quick multi-if statement based on the voltage range to land at the "right" multiplier for that range. Might get you to +95% accuracy pretty quick. Anyways, great video, pleasure as always

  • @justmeeeeeeeeeeeeeeee
    @justmeeeeeeeeeeeeeeee 7 лет назад

    Maybe a lookup table with some measured points to fix the nonlinearity problem