Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using an inductive proximity sensor as a limit switch #24

Open
molove opened this issue Nov 20, 2021 · 13 comments
Open

Using an inductive proximity sensor as a limit switch #24

molove opened this issue Nov 20, 2021 · 13 comments

Comments

@molove
Copy link

molove commented Nov 20, 2021

Hello

Not an issue per se, but a request for help.
I'm a bit of a noob when it comes to electonics/arduinos etc.

I have the breakout board which I've soldered up and am in the process of building an Openbuilds Sphinx type cnc, I would like to make use of grblHAL's auto square function and would like to use proximity sensors instead of limit switches.

I'm not entirely sure how they work but I assume that normally the limit switches just short the limit input to ground.
I have watched this youtube vid https://www.youtube.com/watch?v=F7BjZElStfQ so know how get the output of the inductive sensor to 5v. If I take the power for the inductive sensor from the same supply as the 12v input and using a suitable pulldown resistor on the sensor output, do I just connect the sensor output to the limit input, and when the sensor output goes low it triggers the limit input?

I don't want to damage the board or teensy by sticking 5v onto an input that might not be expecting it.

Great job with the board btw, really quick delivery to the UK.

TIA

Piers

@phil-barrett
Copy link
Owner

phil-barrett commented Nov 20, 2021

Thanks for linking to that video. Worth watching. The inputs for the limit switches are looking for 5V, anything below 5.25V will be good. The 2K he uses in the video is a bit low, try 2200 or 2700 to get the voltage to a little below 5V. You can go as low as 4.25V without any problems.

Note that the actual resistor value will be dependent on the pull-up resistor in the sensor. They are all going to be different so you will have to experiment with yours like in the video.

To answer your direct question, yes, you would put a resistor between input and ground along with the sensor input and common ground. If you use 22 Ga wires, you should be able to insert both the resistor lead and sensor wire into the screw terminals. I recommend using a ferrule to keep the wires together. 20 Ga ferrules are a bit tight but can be made to fit the screw terminals.

@molove
Copy link
Author

molove commented Nov 20, 2021

Thanks for the swift reply, and confirming I had understood correctly.

I will adjust the resistor to match my sensor so it's outputting less than 5.25V. And yes I'm very fond of a ferrule and try to use them for all my projects.

I'm sure there will be more questions that I have as I set up my machine, that won't be "issues" as such. Is there a proper forum to ask them on, or should I just ask here?

@phil-barrett
Copy link
Owner

You are welcome and, yes, you got it right.

I enabled discussions for this repository. So, you can ask them here.

@stevempotter
Copy link

@molove, see my post on here on the Discussion forum about using Hall Effect switches as endstops.

@molove
Copy link
Author

molove commented Nov 21, 2021

@stevempotter I'm not sure where I'm meant to be looking for your post, can you let me have a link?

@phil-barrett
Copy link
Owner

@stevempotter I'm not sure where I'm meant to be looking for your post, can you let me have a link?

It's here, scroll down a bit.

@humneraudio
Copy link

With regards to NPN proximity sensors, which is best between NC or NO?

@phil-barrett
Copy link
Owner

It is a bit complex. If you are only going to use one per axis, then either NO or NC. However, if you will be using 2 per axis, then NO is better. This assumes that you are using sensors with open collector outputs.

@humneraudio
Copy link

no worries, thanks. it will be a single sensor per limit input.

@humneraudio
Copy link

I thought I would just use this to continue with this discussion. I setup the NPN NC proximity sensors and used resistors to get the same 5 v output for the BOB. I used a 12v SMPS for the proximity sensors.

I prefer to have the microusb powering the BOB via my raspberry PI - however I found the proximity sensors don't work in this config. I assume its because both grounds are floating?

If I power the BOB/teensy via a 5v buck converter on the 12v SMPS - it all works ok as it appears the GND is linked.

However I still have a preference for the raspberry PI to power the teensy.

Does that mean I should connect the GND from the 12v SMPS to the GND of the BOB/teensy if its connected to the Raspberry PI to make it a common GND point?

Is that safe?

@phil-barrett
Copy link
Owner

Yes, it is safe to connect the two grounds. They need a common ground otherwise the sensor voltage is not referenced to the ground of the breakout board (which is the Pi's ground, too).

@humneraudio
Copy link

thanks phil. I had a chance to play around with it today, however joining the grounds didn't have any effect or change while the breakout board was connected to the Raspberry PI.

I think I need to take a step back and double check my wiring before i continue.

@humneraudio
Copy link

long story short, it was a wiring fault. And in the process, I also found that I had tied the ground of the breakout board to chassis ground via a DIN cable I made years ago for the halt/start/hold buttons. I had tied the DIN cable shield to the ground connection within the cable itself. No idea why I did that, but have at least solved some mysteries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants