Proximity sensor project

Hello there,
I'm pretty new on arduino and have basics knowledge on electronics. I searched on the forum for an answer but find only partial information. So I have a project for my lab were I need to detect a sensor from a Namur Sensor (inductance with constant voltage (8.2V) and current from varrying from 2 to 3mA when it detect a metal in its ring, see attached doc).
So I chose to aliment it with a 9V battery, I put a resistance (1kohm) in series and then y put my arduino in // with the resistance, connected on the analog A0 of the arduino hoping to see a change on the voltage correspoding to the change in current (see picture attached, the component are not exactly the same as the one a used but the connection are).

Doing this I only read 0 (or 1023 on how I connect the arduino on the analog) on the monitoring. Do you have any insight or advice for me ?

thank you very much

051666_eng.pdf (214 KB)

Interesting. I never heard of NAMUR before today.

I found the actual NAMUR standards but it seems like you have to pay money to download a copy. Most other websites I can find are selling products intended for industrial PLC controls and they look expensive and require 110V AC power.

Your circuit seems good. (Although you should find the button to switch F**ing into schematic view instead of breadboard view.) If that circuit does not work then I suspect the sensor is faulty. Do you have one of the proper NAMUR interface amplifiers to test the sensor? Another sensor to test?

If this is just something you found or you were given for free then throw it away and buy one that is more likely to work on the Arduino. If you actually require the explosion-proof intrinsic safety and the SIL reliability then Arduino is none of those: throw away the Arduino.

Don't use the Arduino to bugfix your circuit. Use a mulitimeter or prefferably an oscilloscope to see what voltage you get on the A0 pin.

With a resistor of 220 Ohm and a change of 1 mA you should see a change of 0.22 Volts.

(You say 1 kOhm, but your breadboard says 220 Ohm)

Also, the analog input of the Arduino take from 5 Volts and down, and you input 9 Volts. A normal inductor have "zero" resistance in a DC circuit so most likely you get the entire 9 Volts on the A0 pin.

Of course I don't know how the NAMUR component works and if it have internal circuits that negates what I've said, but you really need to use a multimeter on the A0 pin to see what you really get.

Thank you MorganS,
You were right, the circuit were good, I only change my resistance from 1kOhm to 500 Ohms. And then I also recheck my code and there were a little mistake... I forgot to set the analog pin as Input...
So know it works perfectly

I forgot to set the analog pin as Input.

No need to do that. It automatically is set when you do an analogRead.