# Connecting a two wire inductive proximity sensor to Arduino Uno

Hello folks,
Could somebody help me connect this sensor to an Arduino Uno?

It’s just that I m not very literate when it comes to electronics…

I m attaching a photo of the wiring diagram.

It is easier if you edit your post with the image after you attach it.

So, what is your load? What voltage are you using for the sensor?

Whatever you tell me :) The sensor is rated for 12V so I guess that what I m going to supply to it. Like I said, I m not very electronics savvy...

But I can give you more info on what I m trying to do: I m running GRBL 0.9i I am using only one stepper motor, I connected the driver directly to the board with no shield. I just want to use the sensor as a homing switch.

Reading specification sheet is one of the most difficult tasks in engineering. You first have to have an understanding of what is going on.

I would connect it like the attached.

The voltage across the 1k ohm resistor should go from 0.8V to 9V (12-3) when the sensor is operated.

The 10 k resistor limits the current into the pin of the arduino. If your arduino is running at 5V and the sensor is at 9V without the 10k you would “power” the arduino through the input protection circuit causing it to fail.
The 10 k limits the current into the arduino input pin to (9-5)/10k = 0.4 ma , well within the specifications of the AVR µP.

Good luck

JohnRob

A somewhat safer approach is to use a voltage divider as shown below. Since the sensor load is activated by 12-3 = 9 V, the output of the divider will be about 4.5V when activated, and about 0.4V when not. You can keep the 10K (as suggested above for input protection) as well.

Don’t forget to connect the sensor ground (12V battery negative terminal) to the Arduino ground.

Thanks, both you guys for the advice.

I understand JohnRob's schematic, but I m not sure about jremington's. I don't see a connection to Arduino's ground, does ArduinoInput refers to Digital Input?

does ArduinoInput refers to Digital Input?

Any Arduino input, digital or analog.

The ground connection is indicated by the standard triangular symbol at the bottom of the drawing.

If you are interested in learning more about electronics, it is extremely important to learn how to read schematic diagrams. Such diagrams have been the universal language of electronics for roughly 100 years.

Avoid Fritzing diagrams!

jremington: If you are interested in learning more about electronics, it is extremely important to learn how to read schematic diagrams.

Those words are gold, I shouldn't wire things up unless I learn how to read schematics properly, same as people should not drive a car without knowing how to read street signs :)

Having said that, I 'll try to follow your instructions and post a photo, where you could possibly tell me if I got it right.

Thanks again for helping me get started !

I do wonder about their circuit though, with a supply voltage quoted as 12V -- 24V (+/- 10%) - what does that mean!!?

@jremington, I think I did wiring according to your diagram.
It seems to be working perfectly! Thank you for your precious advice!
I m going to use some solder and shrink tubing to make it a little more robust.

MarkT:
I do wonder about their circuit though, with a supply voltage quoted as 12V – 24V (+/- 10%) - what
does that mean!!?

I think it means that this sensor can work with a variety of voltage, I went with 12V.

Looks OK, glad to help. Soldering connections is always a good idea.

MarkT questioned what the manufacturer could mean by the +/- 10%, when a range of 12-24 V was specified. Who knows??

Guys, I have a follow-up question,

I need to connect the same sensor to RAMPS 1.4 There is a ton of instructions for 3 wire sensors, but none about the one I have with 2 wires...

Do I keep the same resistors or RAMPS has internal ones?

Do I keep the same resistors

Yes.

Tested, Works like a charm ! Thank you very much Grumpy_Mike !