Using a MOSFET for a Resistance Signal, 3D Printing

Thread Starter

ultimate_jolnar

Joined Mar 6, 2023
3
Hello! This is my first post, so please bear with me.

I want to change the mechanical endstop on my 3D printer to an optical endstop for better accuracy. The mechanical endstop has a simple resistance signal: closed circuit while not engaged; broken circuit when engaged. The optical endstop has a voltage signal: zero when not engaged; high when engaged. In order to turn this into a resistance signal like the stock part, I'm using the setup in the picture (please forgive the hand drawing).

The left side is the optical endstop; I want the resistance between R1 and R2 to be my output (inverting the logic that I described above). My problem is that I fried my main board when I plugged it all together. I haven't ever used a MOSFET before; is there a principle here that I'm missing? Thank you for your help!
 

Attachments

LowQCab

Joined Nov 6, 2012
4,022
Without a Schematic it's difficult to decipher your description.

It sounds like You are talking about a "Limit-Switch" to stop a Motor at the end of it's travel.
In that case, Switches don't have Resistance, they are either On or Off, ( Closed or Open ).
Any "Resistance" will be on the Control-Board, not the Switch.

And, there are common Limit-Switch setups that use
either N/O ( Normally-Open ), or N/C ( Normally-Closed ), Switches.

What does "Engaged" mean ??? ( maybe "End-of-Travel ?, or "Stop" ? )

What is the "normal-running" condition of the Switch ?, Closed or Open ?

When the Carriage reaches the end of it's travel,
what must the state of the Switch change to ?, Closed or Open ?

Measure the Voltage "across" the 2 Switch-Terminals
both in the Run, and in the Stop, conditions,
report back what You find.

What is the Part-Number of the "Optical-Sensor" that You want to use ?

What is the Part-Number of the FET that You want to use ?
.
.
.
 
Last edited:

Thread Starter

ultimate_jolnar

Joined Mar 6, 2023
3
Without a Schematic it's difficult to decipher your description.

It sounds like You are talking about a "Limit-Switch" to stop a Motor at the end of it's travel.
In that case, Switches don't have Resistance, they are either On or Off, ( Closed or Open ).
Any "Resistance" will be on the Control-Board, not the Switch.

And, there are common Limit-Switch setups that use
either N/O ( Normally-Open ), or N/C ( Normally-Closed ), Switches.

What does "Engaged" mean ??? ( maybe "End-of-Travel ?, or "Stop" ? )

What is the "normal-running" condition of the Switch ?, Closed or Open ?

When the Carriage reaches the end of it's travel,
what must the state of the Switch change to ?, Closed or Open ?

Measure the Voltage "across" the 2 Switch-Terminals
both in the Run, and in the Stop, conditions,
report back what You find.

What is the Part-Number of the "Optical-Sensor" that You want to use ?

What is the Part-Number of the FET that You want to use ?
.
.
.
Thank you for the quick response! Let me try to answer your questions:

1. This is indeed a limit switch. When I say a "resistance signal," I meant either infinite or zero (technically about 12 ohms) resistance, but closed or open would have made more sense. Thank you. :)

2. It is a normally closed switch; however, it is easy to invert the logic in the software. In other words, I could (and think it would be easier to) instead use a normally open switch, and just change a firmware setting.

3. "Engaged" does mean "end-of-travel." The mechanical switch is actuated; the light beam is broken.

4. In the run condition (closed switch), the voltage across those two leads is 0 (of course). In the stop condition (open switch), the voltage is 3.3V.

5. This is the optical sensor I want to use: https://www.amazon.com/gp/product/B07MFT8NWJ/

6. And I would like to use a P30N06LE FET.

Let me know if there are more details you need from me. Thank you again!
 

LowQCab

Joined Nov 6, 2012
4,022
Buying Electronic Components from Amazon or AliExpress is a total crap-shoot.
Don't buy any Electronic-Component that does not come with
a prominently displayed PDF Specification-Sheet.

Sorry, I can't help You,
unless You want to get Genuine-Components from a reputable distributor.

You probably don't need a FET for this application,
a Photo-Transistor can probably replace the Switch directly,
but, You may have to get LED-Power from your Control-Board,
or add an External-Supply for any additional LEDs added.
Your Control-Board may not have enough reserve-Power to run more than one extra LED,
I have no idea if it does, or not.
.
.
.
 

Ya’akov

Joined Jan 27, 2019
9,068
You might consider making the connection to the printer via a reed relay which will operate at the TTL levels this sensor produces. It will provide the dry contacts the existing mechanical switch does and greatly simplify interfacing since no power will ever appear at the output of the reed relay that isn’t at its input and put there by the printer mainboard, not by your circuit.

The most commonly available, low cost reed relay for this application is this Pan Chang SIP device. It has a coil resistance of ~500Ω so at 5V you will need ~10㎃ to operate it. This makes using a NOT gate made from a 2N2222 transistor a very easy way to correct for the fact it is a NO device.

I favor simple solutions like this that have some inherent safety against failures in your own design and the galvanic isolation of the reed relay solution is very attractive.
 
Top