12V PLC sensor to 3.3V input


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2006
    Location
    China
    Posts
    266

    Default 12V PLC sensor to 3.3V input

    Hi,

    I need to connect a 12V powered PLC proximity sensor that has a normally open NPN output to a pic running on 3.3V. Obviously it is not just to connect it straight to a pin since it will need some level converting.

    Does anyone have a nice solution for this that is already tested and proven. I was thinking optocoupler but I dont really have the need for an electrical isolation between them so is there any better way?

    Thanks!!

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: 12V PLC sensor to 3.3V input

    If I'm not mistaken having an NPN sensor means that the output is open collector so all you'd need to do is pull it up to 3.3V thru a resistor (say 1k) and connect it to the PIC input. (Edit: Or use the internal pullup if available).
    If the sensor actually outputs 12V when "active" a simple voltage divider will do. Sensor->2k7->1k->GND, then connect the PIC input across the 1k resistor.

    /Henrik.

  3. #3
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Re: 12V PLC sensor to 3.3V input

    Tack för dina förslag!

    I had to mix a litle from both your ideas. The sensor seems to have a really weak internal pullup to 12V so as soon as I connect the resistor divider the voltage drops alot. And without the divider the PIC gets 12V on the pin.

    So I ended up introducing a new pullup resistor to 12V to the output .. and then a resistor divider from that. Weird but working

  4. #4
    Join Date
    Aug 2012
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Re: 12V PLC sensor to 3.3V input

    Is this a 2-wire or 3-wire proximity. As for 3-wire nothing wrong to use resistor devider but for 2-wire, the sensor will not get enough voltage across it or minimum current to function properly.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts