So, I’ve been thinking about finally using an inductive bed probe. Not for tilt compensation, which I still think is a stupid idea, but I think it will speed up some of the work I’m doing with interchangeable platforms and hot ends. I know some of them supposedly work fine at 5v, even though they’re rated for 6-36v, but I really want to make it safe for a 3.3v logic level, which means I need to put something on the output.
The output on these is driven by, in this case, an NPN bipolar transistor, which should give you ground when activated and nothing otherwise, which would be great, but they apparently DO put out the input voltage (or something close to it) when the normally-open switch is open, presumably because of the load from the indicator LED, and we don’t want our MCU pin to ever see that voltage.
A voltage divider is one obvious solution, but for that to work, you need to know exactly what voltage is coming out (which is dependent on your supply voltage (which is sometimes turned up a little above 12/24v, and of course you’d need different resistor values for those two supply voltages). A better solution I came up with was to put a current-limiting series resistor on the output, then a zener diode to ground. It occurs to me as I’m writing this that a blue/white LED might work too. This way, the microcontroller would see exactly the current dropped across the diode (forward voltage drop for the LED, breakdown voltage for the zener).
I wanted to find a solution that would work with only one component though, and the ideal actually isn’t switching between 0v and 3.3v (or whatever logic voltage the mcu is using). What you really want is a ground connection that switches between high- and low-impedance, so that the controller’s internal pull-up will switch you between a high and low signal.
My thought was to use a MOSFET. This will invert the signal, and should give exactly the signal I want. It’s also easy to wire up. I can send the sensor’s power/ground to the 12/24v line on the board, and run the signal to the gate pin of a mosfet, with its source pin crimped directly into the ground pin of the endstop connector, and its drain pin crimped into the connector’s signal pin. I’m thinking that a 2N7000 would be ideal, but since the high signal would be greater than 10v and almost no current needs to flow through, almost any N-channel MOSFET should work.
I’m not an EE though, and I’m sure there are people here who understand how these components work better than I do. So, is this a stupid idea?