1
\$\begingroup\$

I am using this proximity sensor (E1 NPN) with a Raspberry Pi. The sensor outputs a 24V signal when triggered, which I need to step down to 5V so as to not blow out the Pi. My plan is to use this optocoupler but I'm having trouble understanding the datasheet. It says it has an isolation voltage of 4000VRMS (not sure what dielectric strength means but that's how it's listed on the product page.)

table

It also says it has a maximum forward voltage drop of 1.4V and reverse voltage maximum is at 6V, which is magnitudes smaller. The output voltage is supposed to be maximum 5V (again from the product page) and I'm wondering if 24V on the input will be enough/too much voltage to power the thing.

table2

\$\endgroup\$
1
  • \$\begingroup\$ "Dielectric Strength" could also be called "Insulation rating" - it should be safe to have 4000 volts between the LED (input) and output sides of the optocoupler. \$\endgroup\$ Nov 11 at 21:21
3
\$\begingroup\$

that sensor does not make 24V,

An NPN (open collectror) outut only makes zero volts, or "open"

Add a 10K pull-up to 3.3V and you'll get 3.3V or 0V from the sensior

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
3
  • \$\begingroup\$ In a previous question by the same OP, this was the assumption too, but the measurements indicated the sensor output is not purely NPN but maybe had a pull-up to 24V. \$\endgroup\$
    – Justme
    Nov 12 at 5:54
  • \$\begingroup\$ as it was apparently deleted I'm assuming I should ignore it, \$\endgroup\$
    – Jasen
    Nov 12 at 12:29
  • \$\begingroup\$ It's not deleted. But not resolved either ( electronics.stackexchange.com/questions/593765/… ). It is unclear if the sensor really has a pure NPN output, or if the measurements were just not correct. Other similar sensors from same manufacturer does have internal resistors, but for this sensor there is no good datasheet. \$\endgroup\$
    – Justme
    Nov 12 at 12:40
2
\$\begingroup\$

The optocoupler will blow up if you connect it directly to 24V. Use a resistor to limit current, unless your sensor already limits the output current with an internal resistance.

\$\endgroup\$
2
  • \$\begingroup\$ Anyway he/she should use a resistor. Otherwise replacing a sensor becomes risky. \$\endgroup\$
    – TQQQ
    Nov 11 at 21:20
  • \$\begingroup\$ Do you think a 2.2K resistor would do it? thinking ~10 mA \$\endgroup\$
    – JohnC1642
    Nov 11 at 21:39
0
\$\begingroup\$

The point is that your input is current through a diode. It does not matter what the voltage is, the current should be in a reasonable range.

So use a serial resisor. I = (Vin - VF) /R. Make sure your I is always in range. Determine what current do you need on the output and use CTR (current transfer ratio) range to understand the input requirements.

Don't forget, that diode also has reverse voltage limit. So limit input voltage to about a half of that or put a reverse diode in parallel .

To be more theoretical, output current is allowed by electrons released by photons ay certain probability. Like 1 in each 20 photons releases an electron that becomes available to conduct output current. Same on the input. 1 in every 100 electrons regenerates and releases a photon. Numbers are random of course. Anyway, it's never accurate and usually is given by the CTR range.

\$\endgroup\$
2
  • \$\begingroup\$ So you're saying the input voltage shouldn't be over 3V (without a reverse diode)? \$\endgroup\$
    – JohnC1642
    Nov 11 at 21:41
  • \$\begingroup\$ Yes. Well, 5V might be fine if properly regulated. Otherwise either you put a diode or blow up your optocoupler. \$\endgroup\$
    – TQQQ
    Nov 11 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.