. .

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #13
    Quote Originally Posted by davrich View Post
    I decided to upgrade my cheap proximity switches and makeshift wiring for some Pepperl & Fuchs ones.

    Seemed like a good idea, until now!

    The ones I’ve bought are PNP https://www.pepperl-fuchs.com/global...ils&prodid=514.

    I’ve hooked them all up and they light up when metal is placed in front of them.

    Problem is, in Mach 3 th fact that the switch is tripped doesn’t register.

    When I add my old Chinese cheap switch, it works fine.

    Seems that the issue is that my old ones were NPN and the new ones are PNP.

    can anyone tell me whether this is easily fixable by some tweaks to the wiring or am I better off just getting NPN sensors?

    If any more information is needed to answer the question I’ll fill the gaps.

    Thanks in advance
    Sorry in a late reply to this - only found this thread by looking for information on inductive sensors.

    For 3-wire sensors:-

    NPN are low-side switching, so the sensor goes low impedance to ground in the presence of metal. PNP are high-side switching, so the sensor goes low impedance to supply-voltage in the presence of metal.

    This has a bearing on how you wire these to your BoB, or whatever (for now, "BoB"). If the BoB's inputs are opto-coupled AND it presents both anode and cathode of the optocoupler input then you have a lot of flexibility, and either NPN or PNP can be made to work. For an NPN you'd connect the sensor output to the cathode of the optoisolator, and wire the anode to +5V (or +12V through a current limiting resistor). For a PNP, you'd wire the sensor output to the anode, and the cathode to ground (and if the sensor is powered by 12V, then probably have to include a current limiting resistor as well). More typically the BoBs (at least the couple I've come across) have the anodes of the optocouplers bonded to their own local 5V supply and you have to have low-side (i.e. NPN) switching - hence the NPN being the sensor of choice.

    If you're stuck with PNPs and a low-side switching BoB, you *could* frig it a couple of ways. One to include a NPN transistor that is switched from the sensor output from the PNP - very easy, costs pennies and easily knocked up on strip board. Or, you *could* use the high-side switch to reverse-bias the LED in the optoisolator (it's naughty, but can be done) - connect the sensor output via a 470R resistor to the BoB input, connect a 220R resistor to ground (this allows the PNP to pull the cathode voltage up to reverse bias the optoisolator). In theory the cathode would sit around 4V with the PNP sensor "ON" and that's enough to stop the LED in the optoisolator illuminating. The only problem with this method is On is Off, and vice versa, that you have to invert the input in Mach3. You might have to play with the value of the 2 resistors, but keep the ratio the same (the series resistor from the sensor output having about twice the resistance of the external resistor from the BoB input to ground).

    Something like

    Click image for larger version. 

Name:	Screen Shot 2018-02-18 at 12.31.49.png 
Views:	964 
Size:	22.4 KB 
ID:	23786

    (Note: I've not tried this, but it ought to work)

    One word of warning - if you removed the pull-down resistor, or disconnected the 0V to it, you're going to exceed the max reverse voltage on the optoisolator and destroy that input. Either don't do this!, or place a diode - anode on the BoB input, cathode to the BoB's 5V supply to clamp the input voltage to not much more than 5V
    Last edited by Doddy; 18-02-2018 at 01:39 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Proximity switch NPN or PNP
    By Matt81 in forum General Electronics
    Replies: 9
    Last Post: 19-04-2014, 11:38 AM
  2. Limit switch issues?!?
    By jonbabbz in forum General Electronics
    Replies: 10
    Last Post: 06-02-2014, 07:37 PM
  3. One limit switch per axis
    By EddyCurrent in forum General Electronics
    Replies: 17
    Last Post: 30-09-2013, 11:38 AM
  4. Proximity Sensors as Limit Switches ?
    By Lee Roberts in forum General Electronics
    Replies: 5
    Last Post: 03-10-2009, 07:04 PM
  5. Limit switch's - best configuration?
    By HiltonSteve in forum General Electronics
    Replies: 16
    Last Post: 13-08-2009, 01:26 PM

Bookmarks

Posting Permissions

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