Go Down

Topic: Questions using Inductive Proximity Sensors (Read 9669 times) previous topic - next topic

IMMarkmc

Hi
I am using the Arduino Uno, and I want to detect a metal object at a very short distance (1/16" or even less).

My first questions are,
Is it better to use a NPN or PNP sensor?  (I have seen both mentioned)
Second, would I be reading the input from the sensor as digital or analog?

FYI, the sensor that I am planning on using is
LJ12A3-4-Z/BX Inductive Proximity Sensor Switch NPN DC6-36V

I know that the voltage is 6-36VDC, but from what I have read, it should give a workable "detection" voltage even at 5VDC?
Also, I do have 12VDC available (if this would give me a more reliable reading)?  Not 100% sure how to wire that and keep my Arduino safe?  I think with a zener diode?  Also I think I need to have a resistor at the base of the sensor?

Sorry for all the questions, still very new  :D

Thanks
Mark

larryd

How about using a contact sensor ( limit switch ) set to transfer at ~1/16"
No technical PMs.
The last thing you did is where you should start looking.

IMMarkmc

Hi Larry
I have very limited space, it is all I can do to fit a 12mm Prox. in there.
Also, I will be running 6 of these at once.
Thanks for the reply!
Mark

weedpharma

#3
Jan 18, 2015, 03:39 am Last Edit: Jan 18, 2015, 03:40 am by weedpharma
Use a NPN at 12 volts. Connect 10k R to 5v and read digital input.

The NPN will switch to gnd and there is no risk to your Arduino.

12 volts on the sensor is well within working range.

Weedpharma

IMMarkmc

#4
Jan 18, 2015, 06:06 am Last Edit: Jan 18, 2015, 06:07 am by IMMarkmc Reason: wrong image
Great news.  
Just to make sure I understand,

The NPN  Prox. Sensors has 3 wires,
the (+) ties to my 12VDC+
the (-) ties to ground (both of the power supply and to ground on the Arduino)
the signal wire goes to  Arduino digital  pin as input, and also to + 5VDC on the Arduino through a 10K resistor (that's the part I am unsure of)?

Also I will be running 6 Prox. Sensors, supplying them with a +12VDC 25A.
I assume I am ok there?
I am also powering the Arduino with +5VDC through the Vin pin.

Thanks so much for your input!
Mark

weedpharma

......
the signal wire goes to  Arduino digital  pin as input, and also to + 5VDC on the Arduino through a 10K resistor (that's the part I am unsure of)?

Also I will be running 6 Prox. Sensors, supplying them with a +12VDC 25A.



I assume I am ok there?
I am also powering the Arduino with +5VDC through the Vin pin.

Thanks so much for your input!
Mark
Yes, there is a 10k R from 5v to the Digital input to tie it to a high. The output of your sensor when active takes it to a low.

"Supplying them with +12vVDC 25A". You are not supplying them with 25A, you have a supply capable of upto 25A if required.

"Powering them with  a +12vVDC 25A power supply" would be correct.

Weedpharma

MarkT

Use a NPN at 12 volts. Connect 10k R to 5v and read digital input.

The NPN will switch to gnd and there is no risk to your Arduino.

12 volts on the sensor is well within working range.

Weedpharma
Seconded - I've used this in a CNC machine and its pretty robust, but I added
some 10nF capacitors at the Arduino inputs to filter out noise from other sources
IIRC. 

These sensors are pretty cheap on eBay and are much more reliable than
mechanical switches in the face of dust / dirt / liquids.  They are very bulky though,
I'd love to find some cheap miniature ones.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

IMMarkmc

Thanks again for all of the help!
I will keep the cap. in mind if I have any noise issues (but I don't think I will in this application).

One last thing I want to be clear on, since I will be using 6 Prox. sensors..will I have six 10K resistors (like in the attached pic, I just put 2 in for the example) or will there just be one going to the 5VDC for all 6 Prox?

Thanks again for the assistance!
Mark

weedpharma

Each input requires its own 10k resistor.

Weedpharma

IMMarkmc

Thanks Weedpharma !!
I think/hope I am all set.  The sensors should be here mid week, can't wait.
Thanks again.
Mark

IMMarkmc

Is there any reason not to just use the internal pull up resistors in this case?
Mark

Go Up