how to read air flow sensor ESK4A

Discussion in 'General Electronics Chat' started by khalad, Mar 10, 2017.

  1. khalad

    Thread Starter Member

    Feb 9, 2017
    55
    0
    hello everyone,

    I am trying to write a code in arduino so i can get a reading of the flow sensor below . Can someone help me out with this please ? how is the code going to look like photo5913450302328121422.jpg photo5913321393179699223.jpg photo5913321393179699224.jpg
     
    Last edited: Mar 10, 2017
  2. alyeomans

    Active Member

    Sep 13, 2010
    34
    4
    Looks like the output is in current (4 - 20mA) you cannot feed this into an ADC directly as ADC's read voltage and as most/all arduinos are single ended not differential you will need to signal condition for 0 to 5V. If you pass the current through a resistor you can measure the voltage across the resistor (V=IR should give you a clue there). To measure the voltage of the resistor you could use a differential amplifier with gain or even an instrumentation amplifier (AD623 instrumentation amp should work okay) and feed the output into the ADC input - simply analogRead(pin) will secure the ADC value.
     
    khalad likes this.
  3. Dodgydave

    AAC Fanatic!

    Jun 22, 2012
    7,414
    1,223
    Put a 250 ohms resistor across the output of the sensor and that will give you 1-5V full scale.
     
    khalad likes this.
  4. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,456
    1,535
    The data sheet reflects a 4 to 20 mA out for the span of the unit, so a zero flow is 4 mA and full scale flow is 20 mA. When setup as shown in the data sheet if you use a 250 Ohm resistor the output becomes 1 to 5 volts and using a 500 Ohm resistor you get a 2 to 10 volt drop across the resistor. Typically I run units like this at 24 VDC to allow for internal unit drop and a good usable compliance voltage drop across the resistor. If for example you want a 3.3 volt output you would 3.3 Volt / .020 Amp = 165 Ohms so you would use a 165 Ohm resistor for #4 the external load. This was your Arduino can see a full scale voltage for the full scale engineering units of your sensor, you write your code accordingly.

    While you can write the code for the Arduino to convert the ADC (Analog to Digital Conversion) it would likely, if you are using a PC to monitor the Arduino, be easier to use the pc to convert the bit count from the Arduino to engineering units. Matter of exactlt what you want to do and how you plan to implement the Arduino.

    Ron
     
    khalad likes this.
Loading...