PL-05N 5mm NPN NO Fotek Proximity Sensor Switch out DC10-30V Normal Open

Hi People

Please see image below. I want to use a few proximity sensor switches for a lift /elevator project for my old/heavy German shepherd dog using an arduino UNO. Travel 6 Ft. |500x363

2 questions please if you will. 1) Will this switch connection work? 2) What value resistor do I need.

The 10.4 Volts DC will be coming from 8 X AA rechargeable batteries. The lift will raise and lower 440 lbs the 6 ft in 10 seconds. The switches are: PL-05N 5mm NPN NO Fotek Proximity Sensor Switch out DC10-30V Normal Open from ebay. I plan to use them for top and bottom limits and open/close on 2 doors.

Thanks for looking Rick from Canada

1) Will this switch connection work?

No, it will damage your Arduino.

2) What value resistor do I need.

You need two resistors in a potential divider configuration. https://en.wikipedia.org/wiki/Voltage_divider

I would use 10K for the bottom resistor and 15K for the top.

Sensor seems to be a 3-wire NPN type (internal switch to ground) with a weak pull up (47k) to it's supply. If so, you can connect the output directly to a digital input pin.

Or use a 10k resistor (as in your drawing) if you're not sure. Should work both ways. Leo..

Edit: A 10k:15k divider with the sensor's internal 47k pull up won't give a proper HIGH (1.75volt). Another solution is internal pull up on the input pin, and a diode (1N4148) between pin and sensor. Cathode to sensor.

Thank you both so much for your answers/help.

Just to be sure… This is now what I’m planning using the recommended divider.
I took my electricity courses 45 years and am obviously more than rusty:)

Cheers

Rick

This is now what I'm planning using the recommended divider.

No, I didn't see the 47K internal pull up in the spec, mainly because you did not post a link to it. As Wawa correctly put it:-

A 10k:15k divider with the sensor's internal 47k pull up won't give a proper HIGH (1.75volt).

So either follow one of his suggestions or remove the 15K altogether and change the 10K pull down to a 39K pull down.

Thanks Mike. Hope I've got it right this time. :( |500x363

Rick

Yes looks good.

I'm back trying again. Paul__B messaged me that I should really use Wawa's last recommendation above which is....

"internal pull up on the input pin, and a diode (1N4148) between pin and sensor. Cathode to sensor."

What would the value of the PullUp be? Did I get it right?

Thanks

Internal pull up means activating/using the resistor INSIDE the Arduino chip.

pinMode(pin, INPUT_PULLUP);

If you do that in your code, then no external resistor is needed.
Leo…

rhubka: I'm back trying again. Paul__B messaged me that I should really use Wawa's last recommendation above which is....

"internal pull up on the input pin, and a diode (1N4148) between pin and sensor. Cathode to sensor."

What would the value of the PullUp be? Did I get it right? Sorry I got the image URL wrong |500x363

Thanks

"pinMode(pin, INPUT_PULLUP);

If you do that in your code, then no external resistor is needed. Leo.."

OHHHhhhhhhhh I get it.

Remove the pullup in diagram above above use the code: pinMode(pin, INPUT_PULLUP)

That is Way Cool!!! |500x363

Thanks so much