<h3><a href="https://en.wikipedia.org/wiki/Wikipedia:Too_long;_didn%27t_read" rel="nofollow noreferrer">TL;DR</a></h3>
<p>Yes, a 2 kΩ resistor is sufficient to limit the current to about 12 mA through the optocoupler. With a maximum current specification of 60 mA you require at least 400 Ω; any resistor in between the values should be suitable for this optocoupler component when used at 24 V. More information is found below.</p>
<hr />
<p>Having a glass bed and using an inductive probe may not work optimally. In such cases a 3D touch sensor is a very good alternative. For inductive sensors, remember that these sensors optimally detect steel, aluminium is harder to detect (<a href="http://www.fargocontrols.com/sensors/inductive_op.html" rel="nofollow noreferrer">about 60 % less than iron</a>; a glass sheet in between the bed and the sensor requires you to acquire a sensor with a large detection range, e.g. 8 mm or more. To optimize the detection distance such sensors need to be powered to the maximum voltage they can handle (usually 36 V) or the highest voltage you have available (e.g. power supply 12 or 24 V). To protect the board, that is only allowed to receive up to 5 V, an optocoupler is an excellent way to guarantee the separation of voltage levels.</p>
<p>Considering your questions, it is fair to assume you are not an experienced electronics tinkerer, purchasing an optocoupler module is the best alternative, you just screw the wires into the respective input screw terminals as shown in <a href="/a/6359">this answer</a>.</p>
<p>As the optocoupler separates two circuits, you can safely use 24 V on the one side and the 5 V on the other side, you do not need an additional resistor when you use a module board. If you plan to buy separate components to build your own circuit, you need to look at the maximum current that the optocoupler can handle on the input side (that will be 24 V). From the documentation from the optocoupler one reads that it is limited to 60 mA. A <strong>maximum current</strong> would therefore require a resistor of:</p>
<p><span class="math-container">$$ R=\frac{U}{I}=\frac{24}{60\times10^{-3}}=400\ \Omega $$</span></p>
<p>My 12 V optocoupler module uses a 1 kΩ resistor implying a 12 mA current. In your case allowing 12 mA of current yields a 2 kΩ resistor.</p>

CC BY-SA 4.0
2019-02-20T18:55:39.093Z
Ok, so when I understand this correctly, I do not need to use as much as 2 k Ohms, as e.g. 400 Ohms would already be enough. However, it should be better for the optocoupler, if I use some more resistance, isn't it? I would say, 1 k Ohm should be a good value... As I do not want the maximum of 60 mA to flow.

One question to the linked thread and the wiring: There they connected the Black Signal Wire and the Golden +12V Wire to the input of the optocoupler. Why is this? I mean, I want Signal and GND, don't I??
der-andyman
CC BY-SA 4.0
2019-02-20T06:28:22.320Z
2019-02-21T14:07:21.870Z
2020-06-18T08:29:41.667Z
0scar
<p>I am going to buy an inductive probe for my Creality Ender 3 to enable ABL (Automatic Bed Leveling). And now, I have one last question left on my mind:</p>

<p>I am going to buy a <a href="https://www.conrad.de/de/vishay-optokoppler-phototransistor-sfh610a-1-dip-4-transistor-dc-154085.html" rel="nofollow noreferrer">Vishay Optokoppler Phototransistor SFH610A-1 DIP-4 Transistor DC</a>.</p>

<p>Is it sufficient to put a 2&nbsp;-&nbsp;2.2&nbsp;k&Omega; resistor between the input of the octocouplers LED side and the 24&nbsp;V Output of the probe, to lower the current and voltage enough to work with the octocoupler? Or do I need something else?</p>

<p>On the transistor side, I will simply attach the 2 wire Z-endstop cable, +5&nbsp;V on Collector and GND on Emitter.</p>

CC BY-SA 4.0
2019-02-19T06:17:24.550Z
Possible duplicate of [Inductive Sensor in 24 V machine?](https://3dprinting.stackexchange.com/questions/6358/inductive-sensor-in-24-v-machine)
0scar
CC BY-SA 4.0
2019-02-19T14:21:44.177Z
Capacitive sensor trigger distance depends on the amount of moisture in the air and as such are not very accurate for a range of operating conditions. A 3D touch sensor is more reliable when using glass. Furthermore, using a higher voltage for powering the sensor has been asked before
0scar
CC BY-SA 4.0
2019-02-19T23:21:54.583Z
Ok, so, I should use an inductive sensor then, right? Because, I do not have other options.
Additionally, I know that there are similar questions, but I am unable to answer to them. So sorry for making a new thread :/
der-andyman
CC BY-SA 4.0
2019-02-19T23:42:04.240Z
Ok, last question then: I am going to buy the mentioned octocoupler. Is it sufficient to put a 2 - 2,2 k Ohm resistor between the input of the octocouplers LED side and the 24V Output of the probe, to lower the current and voltage enough to work with the octocoupler?
der-andyman
CC BY-SA 4.0
2019-02-20T01:09:43.537Z
ok, with the changes it is clearly a different question - though I would use a proper optocoupler board...
Trish
CC BY-SA 4.0
2019-02-20T18:52:15.017Z
Where do I get a proper optocoupler board from? I am somewhat limited to conrad.de and maybe ebay.de and amazon.de
der-andyman
<z-axis><electronics><creality-ender-3><bed-leveling><inductive-sensor>
Hooking up an optocoupler in a 24V Machine, is a 2 kOhm resistor sufficient?
der-andyman
# Hooking up an optocoupler in a 24V Machine, is a 2 kOhm resistor sufficient?

(Asked by: username_0 on 2019-02-19)

I am going to buy an inductive probe for my Creality Ender 3 to enable ABL (Automatic Bed Leveling). And now, I have one last question left on my mind:

I am going to buy a [Vishay Optokoppler Phototransistor SFH610A-1 DIP-4 Transistor DC](https://www.conrad.de/de/vishay-optokoppler-phototransistor-sfh610a-1-dip-4-transistor-dc-154085.html).

Is it sufficient to put a 2 - 2.2 kΩ resistor between the input of the octocouplers LED side and the 24 V Output of the probe, to lower the current and voltage enough to work with the octocoupler? Or do I need something else?

On the transistor side, I will simply attach the 2 wire Z-endstop cable, +5 V on Collector and GND on Emitter.

**Tags:** z-axis, electronics, creality-ender-3, bed-leveling, inductive-sensor
> **Comments:**
> **username_1**: Possible duplicate of [Inductive Sensor in 24 V machine?](https://3dprinting.stackexchange.com/questions/6358/inductive-sensor-in-24-v-machine)  
> **username_1**: Capacitive sensor trigger distance depends on the amount of moisture in the air and as such are not very accurate for a range of operating conditions. A 3D touch sensor is more reliable when using glass. Furthermore, using a higher voltage for powering the sensor has been asked before  
> **username_0**: Ok, so, I should use an inductive sensor then, right? Because, I do not have other options. Additionally, I know that there are similar questions, but I am unable to answer to them. So sorry for making a new thread :/  
> **username_0**: Ok, last question then: I am going to buy the mentioned octocoupler. Is it sufficient to put a 2 - 2,2 k Ohm resistor between the input of the octocouplers LED side and the 24V Output of the probe, to lower the current and voltage enough to work with the octocoupler?  
> **username_2**: ok, with the changes it is clearly a different question - though I would use a proper optocoupler board...  
> **username_0**: Where do I get a proper optocoupler board from? I am somewhat limited to conrad.de and maybe ebay.de and amazon.de  

---

## 1 answers

### Answer by username_1 on 2019-02-20. Score: 1 | Accepted answer

### [TL;DR](https://en.wikipedia.org/wiki/Wikipedia:Too_long;_didn%27t_read)

Yes, a 2 kΩ resistor is sufficient to limit the current to about 12 mA through the optocoupler. With a maximum current specification of 60 mA you require at least 400 Ω; any resistor in between the values should be suitable for this optocoupler component when used at 24 V. More information is found below.

---

Having a glass bed and using an inductive probe may not work optimally. In such cases a 3D touch sensor is a very good alternative. For inductive sensors, remember that these sensors optimally detect steel, aluminium is harder to detect ([about 60 % less than iron](http://www.fargocontrols.com/sensors/inductive_op.html); a glass sheet in between the bed and the sensor requires you to acquire a sensor with a large detection range, e.g. 8 mm or more. To optimize the detection distance such sensors need to be powered to the maximum voltage they can handle (usually 36 V) or the highest voltage you have available (e.g. power supply 12 or 24 V). To protect the board, that is only allowed to receive up to 5 V, an optocoupler is an excellent way to guarantee the separation of voltage levels.

Considering your questions, it is fair to assume you are not an experienced electronics tinkerer, purchasing an optocoupler module is the best alternative, you just screw the wires into the respective input screw terminals as shown in [this answer](/a/6359).

As the optocoupler separates two circuits, you can safely use 24 V on the one side and the 5 V on the other side, you do not need an additional resistor when you use a module board. If you plan to buy separate components to build your own circuit, you need to look at the maximum current that the optocoupler can handle on the input side (that will be 24 V). From the documentation from the optocoupler one reads that it is limited to 60 mA. A **maximum current** would therefore require a resistor of:

$$ R=\frac{U}{I}=\frac{24}{60\times10^{-3}}=400\ \Omega $$

My 12 V optocoupler module uses a 1 kΩ resistor implying a 12 mA current. In your case allowing 12 mA of current yields a 2 kΩ resistor.

> **Comments:**
> **username_0**: Ok, so when I understand this correctly, I do not need to use as much as 2 k Ohms, as e.g. 400 Ohms would already be enough. However, it should be better for the optocoupler, if I use some more resistance, isn't it? I would say, 1 k Ohm should be a good value... As I do not want the maximum of 60 mA to flow.  One question to the linked thread and the wiring: There they connected the Black Signal Wire and the Golden +12V Wire to the input of the optocoupler. Why is this? I mean, I want Signal and GND, don't I??  

---

