Namur sensor to analog input A0


I am trying to interface a Namur sensor into analog A0 of my Uno.

The Namur requires a steady supply voltage of 8V to operate and current drawn indicates the state of the switch.

<= 1mA = metal detected.

= 3mA = metal not detected.

The supply to the switch is simply 0V and +8V.

Now the question is, how best to interface this to my Uno analog input being +5V tolerant?

I was thinking a simple 1k resistor in the supply line to the sensor would allow the drawn current to be converted to a voltage and read by the uno, but the potential difference across the sensor is too high? Ground on the sensor being linked to gnd on the Uno.

Any guidance appreciated.

Don't apply 8V to Arduino I/O pin! You must use a voltage divider, but 0 to 3 mA don't sound right, can you post a link for that sensor? EDIT: You could run the 3 mA through a 1k R and read the 3 volt result on an analog pin but you have to protect the pin in case the load R failed and the sensor put out 8V trying to drive 3 mA into an open circuit. Maybe a 10k R in series with the analog pin?

The usual way to interface sensors like that is to simply use a resistor to ground, and an analog or digital input to measure the sensor current (the voltage to ground).

Connect the sensor power supply (a 9V battery is fine for tests) to the positive sensor lead.
Connect a 1K resistor and the 9V battery negative lead to Arduino ground.
Connect the junction of the sensor and the resistor to an analog or digital input.

If the resistor voltage is less than 1V no metal is detected, if greater than 3V, metal is detected.

For safety, put a 10K resistor between the sensor and the input as shown below. This will prevent damage if the sensor current is more than 5 mA or so (resistor voltage higher than 5V).



JR, you beat me to it! :P

PDF Datasheet

Thanks for your help guys, I will breadboard it up and report back!

Can anyone just explain me can read a namur sensor simply....using arduino....I want connection image and source code tooo....please help me out guys....

please help me out guys

Read this thread, starting with the first post.