Welcome! Log In Create A New Profile

Advanced

Problem with RAMPS and induction Sensor

Posted by HoloPed 
Problem with RAMPS and induction Sensor
March 23, 2015 10:45AM
Hey gang.
I have an induction sensor (LJ12A3-4-Z/BY, same one used by Printrbot) and voltage divider resistors. I'm feeding it 12v.
[www.amazon.com]

When the output pin is not connected to the RAMPS, I measure 0v when the sensor is in the air, and 5v when it's touching metal. However, the Z-Min endstop status is always OPEN or TRIGGERED (depending if I invert the logic in the firmware) and doesn't change state when touching metal. I tried to enabled / disable ENDSTOPPULLUP_ZMIN, same result.

I'm pretty much stuck now, anyone has an idea?
What am I missing?
Re: Problem with RAMPS and induction Sensor
March 23, 2015 01:11PM
How do you have it wired?

Your sensor supplies the pin with 12V when it's closed, and likely floats or is otherwise indeterminate when it's open. The pull up resistor, if enabled, will hold the pin high weakly so if you have that enabled, that may be the source of the problem. It's always seeing a 12v signal. You'll need to add a pull down resistor between the signal pin and ground to hold the pin low until the induction sensor is tripped, supplying the 12V through your voltage divider. You'll also need to invert your logic so that when it goes high, it reads as tripped.

Some people have gotten that sensor to work on just 5V which is under it's rated operating voltage, but still produces enough of a signal that the arduino reads it as high. That would also simplify your circuit as it eliminates the voltage divider but you'll still need the pull down resistor.

IMO, that sensor is pretty much the opposite as what you want. Ideally it's a NC sensor so that it can detect when there isn't a connection, and a NPN sensor would be simpler as it then just grounds the signal coming from the pin, enabling use of the internal pull up resistor and no need for a voltage divider.
Re: Problem with RAMPS and induction Sensor
March 23, 2015 03:01PM
Right now I have a 10k resistor between ground the signal, and another one inline with the output pin.

I don't mind getting a different probe if it would be easier to work with. Can you recommend something? Or I should just get the NPN version of the same probe.

Thanks,
Re: Problem with RAMPS and induction Sensor
March 23, 2015 05:20PM
Does the resistor between signal and ground come before or after the one in series going to the output pin?


I personally would go with a NPN NC sensor. Amazon and ebay have a variety available that likely would work just using 3 endstop pins running at +5V.
Re: Problem with RAMPS and induction Sensor
April 02, 2015 07:00PM
Quote
HoloPed
...When the output pin is not connected to the RAMPS, I measure 0v when the sensor is in the air, and 5v when it's touching metal. ...
Seems like the sensor is working.

Quote
HoloPed
However, the Z-Min endstop status is always OPEN or TRIGGERED (depending if I invert the logic in the firmware) and doesn't change state when touching metal. I tried to enabled / disable ENDSTOPPULLUP_ZMIN, same result.
A pullup on a pin is an internal resistor (inside microcontroller) that is tied on that pin and to the "high" level, e.g. 5volts. A pulldown is the other way, ties that pin to gnd, 0volts. So if you activate the pull~up (or ~down), it will just read 5v (respectively 0v), even if the pin is not connected to anything. If you have a pullup on that pin then it might perhaps still read 5v even when the sensor tries to output 0 (depends on sensor output stage and rating, as it may sink all pullup current or only part of it - didnt seen any datasheet). But you could (and probably should) try without any kind of resistors, no pullup and no pulldown, since the sensor output already seem to have a default state (which is what the pull-ups/downs are for - in case a default state is "missing").

Forward on, need to tell the firwmare which state means what, if 5v means its triggered or the other way around. Conventionally positive logic means input is true when its "high" e.g. 5v, and the other way around negative logic means its true (e.g. switch pressed) when its "low" e.g. zero volts. So you need to set this correctly in firmware, but otherwise its fairly simple to test both cases and see which one works.
Sorry, only registered users may post in this forum.

Click here to login