I have a 24V pressure switch that is loop powered. Here is the manual/datasheet. I'm trying to figure out how to read the sensor with an Arduino.

Obviously, the Arduino can't handle 24V, so I got some optocouplers (manual/datasheet)

The original schematic looked like this: Original Schematic

This, however, didn't seem to work. When I measured voltage across ports #1 and #2 (from the schematic), it measured between ~13V and ~20V (when the sensor was engaged vs not-engaged).

I'm not really sure how to fix this. I tried using a voltage divider (instead of an optocoupler), but, in my ignorance, I burned up one of my small resisters.

Thanks for any help!

UPDATE: New Schematic (the one above is old) enter image description here

  • \$\begingroup\$ I think that either the output of the optocoupler is not correctly wired (what's DI+ and DI-?) or you accidentally destroyed its LED. To make a test, use a 1-k resistor in series to a 9-V battery, and try to turn ON the LED. Do you see any variation on the rightside of the diagram? \$\endgroup\$
    – next-hack
    Sep 11, 2017 at 21:15
  • 1
    \$\begingroup\$ So you used the optocoupler without a current-limiting resistor? \$\endgroup\$
    – Mike
    Sep 11, 2017 at 21:21
  • \$\begingroup\$ Are you trying to scale the signal from 24V to 5V? If so, use an op-amp with gain of 1/5. \$\endgroup\$
    – Mike
    Sep 11, 2017 at 21:23
  • \$\begingroup\$ @next-hack, This is actually an older schematic, my bad. In reality, this was for a National Instruments DAQ box, but I changed it to an Arduino. The post has an update of the new schematic. \$\endgroup\$
    – jojoguy10
    Sep 11, 2017 at 21:24
  • \$\begingroup\$ Are you using the NPN or the PNP pressure switch? I think you have to order one or the other. \$\endgroup\$
    – jonk
    Sep 11, 2017 at 21:24

1 Answer 1


Here is the final (working) schematic: Final Schematic

In the end, I actually ended up using an NI DAQ box (USB-6255). This would still work with an Arduino though.

Thanks for all the help! Joe


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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