How can i read pulse ,or 4-20 mA output from Arduino?

i'm new with Arduino ,may anyone help me to know how can i read pulse ,or 4-20 mA output?
i have this sensor (micronics flow meters U1000) , it's working fine, but i don't know how to read the output from Arduino.
here is the manual of flow meters sensor:
http://www.micronicsflowmeters.com/newestpdfs/Micronics-U1000-Issue2-1.pdf
Thanks in advance

how can i read pulse

Use the pulseIn() function

4-20 mA output

Use a 250 ohm resistor with an analog input. Gives 1-5volts

Read down further. It can produce a pulse. THIS is the ideal interface for the arduino. This can easily be used to drive an opto issolator that can then be read by one of the digital input pins. Timing the pulses can then give a flow rate.

The device is even configurable for what flow is represented by each pulse.

Thanks LarryD
Thanks KenF
i already tried pulseIn() function ,but its not working i got only 0 value in the result ,may be i did something wrong with he connection.

The polarity of the wires is as follows:
Brown wire: 24V Input
Blue wire: 24V Return
white wire: Pulse Output
Green wire: Pulse Return
Red wire: 4-20mA Output (+)
Black wire: 4-20mA Return (-)

i connected white wire(Pulse Output) to pin number (2) and Green wire(Pulse Return) to Arduino GND between pin 13 and AREF , but i got only 0 as a result.

here is a sample code:

int pin = 2;
unsigned long duration;

void setup()
{
pinMode(pin, INPUT);
Serial.begin(9600);
Serial.println("Started");
}

void loop()
{
duration = pulseIn(pin, HIGH);
Serial.println(duration, DEC);
}

but i got only 0 as a result in my hyper-terminal, so may you help me to get the correct pulse?
and how can i get pulse count from the duration ?

once again thanks in advance.

I never mentioned the pulsein function. I was talking about the pulse signal on your device.

Thanks Kenf , yes so sorry i miss understood , i already set the configuration of (Micronics flow meters U1000) to give me pulse output , and it's working fine , and i can see the water level in the display , but when i try to use pulseIn() with pin 2 like this code i got only 0

unsigned long duration;

void setup()
{
pinMode(pin, INPUT);
Serial.begin(9600);
Serial.println("Started");
}

void loop()
{
duration = pulseIn(pin, HIGH);
Serial.println(duration, DEC);
}

moderator: cross-post in sensors deleted.
Please keep your questions in one thread, saves time for everybody.

Sorry robtillaart ,I'm new and i don't know which thread i need to put my question , because it's programming and sensor issues , that is why i put my question in both of programming and sensor thread.
once again , I'm sorry.

Looking at the diagram on page 9 of the datasheet shows the "pulse" connections as the grey and green wires. (not the red and black)

Grey is "pulse output" whereas Green= "pulse return"

Then on page 21 we have a rather useful looking table that tells us that the "pulse output" is "Opto-isolated MOSFET volt free normally open contact"

So what we have is a pair of wires that are connected to the mosfet side of an opto issolator. It will not have any signal on it unless your circuit provides the power.

What I think you need to do is provide 5v from your arduino to the silver wire via a a suitable resistor (say 4.7K) and connect the green wire to your arduino GND. You can then take your reading from the silver wire (at it's junction with the resistor)

sug.jpg

Thanks KenF , i will test it and comeback to you.

... but when i try to use pulseIn() with pin 2 like this code i got only 0

The pulseIn() is a blocking function and is not required for this very capable and accurate instrument, as your U1000 has both analog and pulse outputs.

The output is a MOSFET relay type and the electronic normlly-opened contacts are "dry" (high impedance) when open. At the Arduino end, I would connect one end of a 1K resistor to the white wire and the other end to GND. Also, the green wire needs to be connected to GND. You should now get pulses 0-5V on pin 2. EDIT: (as per KenF diagram) These pulses are ideal for totalizing (counting) to record accumulated volume.

The isolated 4-20mA signal can be monitored by using one of the analog inputs of the Arduino. This signal will provide the same information as the digital signal, however you can get accurate and near instantaneous readings which is ideal for monitoring flow rate, data logging, creating flow profiles, etc.
To connect to the Arduino, connect a good quality (temp stable) 250Ω resistor across the red and black wires. Connect the red wire to an analog input and the black wire to GND of the Arduino. This will give a 1-5 volt signal.

Disclaimer: I have never used this device.

Thanks a lot dlloyd, i will test it and comeback to you.

Thanks guys ,i tested but still not working. how i can take the reading of U1000 pulse? or in current loop 4 to 20mA? the u1000 is being powered but unfortunately i can't obtain any reading of both output.

Can you please post a schematic of how the device and the Arduino are wired.

Thanks UKHeliBob,

find below the schematic image :

http://s23.postimg.org/ylht43xjf/schematic.jpg

and here is the sample code:

int pin = 2;
unsigned long duration;

void setup()
{
pinMode(pin, INPUT);
Serial.begin(9600);
Serial.println("Started");
}

void loop()
{
duration = pulseIn(pin, HIGH);
Serial.println(duration, DEC);
}

It looks like in the manual, the outputs can be configured and they also can be turned on or off.

i already configured to give me pulse ,and 4-20 mA output , and i can see the result in the device screen.

Example of connections:

EDIT: You could use a stronger pull-up if needed, i.e. 470 Ω and still be well within the output's max current limit of 500mA.

You could try something like this to test the digital input:

// constants
int pin = 2;  // digital input pin

// variables
unsigned long pulseCount = 0;
boolean inputStatus = LOW;
boolean inputStatusPrevious = LOW;

void setup() {
  pinMode(pin, INPUT);
  Serial.begin(115200);        //115200 for faster response
  Serial.println("Started");
  Serial.println("Pulse Count:");
  Serial.println(pulseCount);
}

void loop()
{
  inputStatus = digitalRead(pin);

  if (inputStatus == HIGH && inputStatusPrevious == LOW) {  //rising edge
    pulseCount++;
    Serial.println(pulseCount);
  }
  inputStatusPrevious = inputStatus;
}

Thanks alot for your kind replay , i will check it and come back to you.
once again , Thank you.