Electronic – How to connect a Inductive Proximity Sensor Switch NPN DC6-36V to PIC18F4550 5V

12v5vopto-isolatorpicproximity-sensor

I have got a LJ12A3-4-Z/BX Inductive Proximity Sensor Switch NPN DC6-36V with this Specifications:

  • Model: LJ12A3-4-Z/BX
  • Theory: Inductive Type Sensor
  • Wire Type: Cylindrical DC 3 Wire Type
  • Output Type: NPN
  • Detecting Distance: 4mm
  • Supply Voltage: DC6-36V
  • Current Output: 300 mA
  • Response Frequency: 100Hz
  • Detect Object: Iron

(I use 12V or 8V to supply one sensor)
enter image description here

this should be connected to this ports of a pic (one sensor per limit):

enter image description here

what do I need optocouplers etc.?

Best Answer

You can use an optocoupler as follows:

schematic

simulate this circuit – Schematic created using CircuitLab

Choose an optoisolator that has more that sufficient CTR such as a TLP291-4(GB,E).

You can get such optoisolators 4 to a package, so only two would be required. The 12V supply that powers the proximity detectors does not need to share a ground (and probably should not share a ground) with the microcontroller.

Edit: If you want a through-hole package, one suitable type is the TLP624-4(F) enter image description here

Related Topic