How can I convert -24v NPN output to +5v?


Results 1 to 8 of 8

Thread: How can I convert -24v NPN output to +5v?

  1. #1
    Member Azalin's Avatar
    Join Date
    Mar 2014
    Location
    Turkey
    Posts
    1131
    Downloads
    0
    Uploads
    0

    Default How can I convert -24v NPN output to +5v?

    Hello,

    I want to use an NPN proximity sensor as homing switch. I fed the sensor with an external 24v power supply so as the sensor is NPN the output is -24v. The BOB wants +5v on the limit switch input.

    So I need to convert the -24v coming from the sensor to +5v. Is there a practical way to achieve this or should I give up and use a PNP sensor?

    Thanks in advance.

    Best,
    Suat

    Similar Threads:
    Suat
    Proud father, C# developer, Model heli pilot, newbie free time machinist for hobby


  2. #2
    Member john-100's Avatar
    Join Date
    Mar 2007
    Location
    uk
    Posts
    2083
    Downloads
    0
    Uploads
    0

    Default Re: How can I convert -24v NPN output to +5v?

    which BOB are you using ?

    depending on the BOB you may be able to add a pullup resistor of about 200 to 300 ohms
    between the BOB input and +5V

    with the -24V power supply terminal connected to the BOB's common / ground
    the sensors open collector NPN output will ground the BOB's input when triggered

    when the sensor output is off
    the pullup resistor will pull the BOB's input towards +5V
    the exact voltage depends on the BOB's input circuit

    if for example the BOB's input circuit is a 74HC14 CMOS IC with a 10K pull down resistor to ground
    a 200 ohm pull up resistor will pull the input up to +5V



    John



  3. #3
    Member Azalin's Avatar
    Join Date
    Mar 2014
    Location
    Turkey
    Posts
    1131
    Downloads
    0
    Uploads
    0

    Default Re: How can I convert -24v NPN output to +5v?

    Hi John,

    The bob is a cnc4pc M16. Can I use a pull up resistor?

    Sent from my MI 5s Plus using Tapatalk

    Suat
    Proud father, C# developer, Model heli pilot, newbie free time machinist for hobby


  4. #4
    Member Azalin's Avatar
    Join Date
    Mar 2014
    Location
    Turkey
    Posts
    1131
    Downloads
    0
    Uploads
    0

    Default Re: How can I convert -24v NPN output to +5v?

    I don't know what a pull up resistor is but from what I understand from this video a pull up resistor is basically a resistor

    Please correct me where I'm wrong. The guy on the video says

    ((external voltage (24 in my case)) - (target signal voltage (5v)) / R <= 5mA

    I don't know what where did he get the 5mA from. Maybe it is the current value of the NPN sensor output? If so mine is 200mA. So my calculation is:

    (24-5) * 200 = 3800 OHMs

    Is this calculation correct?

    This is the sensor by the way. In the description says the output current is 300mA but I read 200mA on mine:

    https://www.aliexpress.com/item/M8-L...27424c4dih2urY





    Suat
    Proud father, C# developer, Model heli pilot, newbie free time machinist for hobby


  5. #5
    Member KH0UJ's Avatar
    Join Date
    Jul 2016
    Location
    Philippines
    Posts
    660
    Downloads
    0
    Uploads
    0

    Default Re: How can I convert -24v NPN output to +5v?

    Opto isolators also can be used if you want just to switch +5VDC on and off using GND and -24VDC trigger, if you want a simplest form just use a 24VDC mini relay to switch the 5VDC on and off



  6. #6
    Member coherent's Avatar
    Join Date
    Apr 2003
    Location
    Arizona, USA
    Posts
    540
    Downloads
    2
    Uploads
    0

    Default Re: How can I convert -24v NPN output to +5v?

    I went through this same issue a while back. Was a pain trying to figure out correct resistor values and wiring. Do like Khouj mentioned... its a simple, easy solution. I used a multi channel relay board. That way you can run the relays with 5 volts from your breakout board and then run 24 volts on the other side of the relay (or whatever voltage you want up to 250v) to power your NPN sensors. Really easy to wire and setup. Worked like a charm and the multi channel relay boards are very cheap on Amazon and Ebay etc. Get one with a couple extra relays and you'll be ready in case you want to add something else down the road. The relay boards have isolation and dip switches that allow you to set each relay up any way you want.



  7. #7
    Member john-100's Avatar
    Join Date
    Mar 2007
    Location
    uk
    Posts
    2083
    Downloads
    0
    Uploads
    0

    Default Re: How can I convert -24v NPN output to +5v?

    if the cnc4pc M16 BOB was like the C10

    then you would only need to set the pull up / pull down jumper to pull up

    How can I convert -24v NPN output to +5v?-c10-inputs-sensor-jpg


    I have only just downloaded the cnc4pc M16 manual
    and its not clear what the board has fixed pull up or pull down resistors on the inputs

    the RJ45 connector has 0V, +5V and 4 inputs for the limit switch kit they sell

    if the cnc4pc M16 has fixed 4K7 pull up resistors
    the I would expect the sensors will work with the black wire connected to the cnc4pc M16 input
    and the blue wire to the cnc4pc M16 0V / GND


    if the cnc4pc M16 has fixed 4K7 pull down resistors

    then an external pull up resistor of 200 to 300 ohms
    should over ride the effects of the 4K7 pull down resistor

    How can I convert -24v NPN output to +5v?-c10-inputs-external-pull-sensor-jpg


    John

    Last edited by john-100; 11-20-2018 at 07:12 PM.


  8. #8
    Member john-100's Avatar
    Join Date
    Mar 2007
    Location
    uk
    Posts
    2083
    Downloads
    0
    Uploads
    0

    Default Re: How can I convert -24v NPN output to +5v?

    Hi Azalin

    I have had another look at the M16 and M8 LJ8A3-1-Z/BX data sheet

    the cnc4pc M16 manual has very little detail but I expect its input circuit is going to be like the C25 BOB

    How can I convert -24v NPN output to +5v?-c25-npn-sensor-jpg



    looking at the data for the M8 LJ8A3-1-Z/BX sensor

    it looks like the output is not an open collector output as expected as the diode( LED) and 10K resistor high lighted in the red box
    provides a low current path between the positive supply and output terminal

    with a 24v supply about 2mA will flow to ground via the NPN output transistor while its conducting
    ( if you connect a test meter set to mA across the black & blue sensor wires you should measure a 2mA current when the sensor switches off)

    when the sensor switches off about 2mA will flow into the BOB input and via the IC's protection circuit to the BOB's +5V supply

    a 200 ohm pullup resistor will divert some of this current and help to protect the BOB
    how many sensors are you connecting to a single input ?

    if you add either a 4.7V 1W zenner diode (eg 1N4732A) across the BOB input terminals

    or add a diode to the input to block current from flowing into the BOB
    you can use a silicon diode 1N400 to 1N4007 or a SCHOTTKY diode such as 1N5819RL has a smaller voltdrop
    How can I convert -24v NPN output to +5v?-npn-sensor-m16-bob-input-protection-jpg

    John



Tags for this Thread

Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

How can I convert -24v NPN output to +5v?

How can I convert -24v NPN output to +5v?