• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

PNP Inductive Sensor and wiring

Scheduled Pinned Locked Moved
Duet Hardware and wiring
6
28
8.1k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    ajcraig99
    last edited by 20 Sept 2018, 09:49

    The above wiring didn't work, I took the sensor to work and had one of the electrical guys test it and it only changes about 0.3v when triggered so It seems to be a dud sensor.

    I picked up an NPN sensor and tested it on the bench with a 9v battery and it goes from 0v to virtually -7v when triggered so have tried to use this one.
    Unfortunately I am still unable to get this one working and I can't work out what I am doing wrong.
    It seems to work perfectly (judging by the LED and voltage measurements) until the probe output is connected to z_probe_in or ground, then it just stays triggered.

    Sensor: LJ12A3-4-Z/BX

    It was listed as normally open.

    I have tried to illustrate what I've tried below.

    0_1537436588467_wtf.jpg

    1 Reply Last reply Reply Quote 0
    • undefined
      sigxcpu
      last edited by 21 Sept 2018, 23:27

      Your NPN sensor is most likely open collector. That means you need a pull-up resistor to V+ from its output. Then, to protect the Duet add a diode when connecting the signal wire.

      https://mertarauh.com/2017/01/18/dont-trust-the-internet-and-how-to-add-an-inductive-proximity-sensor-to-your-3d-printer-the-proper-and-easiest-way/

      undefined 1 Reply Last reply 22 Sept 2018, 00:33 Reply Quote 0
      • undefined
        ajcraig99 @sigxcpu
        last edited by 22 Sept 2018, 00:33

        @sigxcpu

        Thanks,

        So I read through that page and measured the resistance between each wire.
        results in the image below, If I use the 10k value as R1, should I be wiring it up like the bottom diagram?

        0_1537576403841_wiring2.jpg

        1 Reply Last reply Reply Quote 0
        • undefined
          dc42 administrators
          last edited by dc42 22 Sept 2018, 07:01

          See the wiki page on connecting Z probes. You don't normally need the pull-up resistor.

          Duet WiFi hardware designer and firmware engineer
          Please do not ask me for Duet support via PM or email, use the forum
          http://www.escher3d.com, https://miscsolutions.wordpress.com

          undefined 1 Reply Last reply 22 Sept 2018, 09:17 Reply Quote 0
          • undefined
            ajcraig99 @dc42
            last edited by 22 Sept 2018, 09:17

            @dc42

            I have read the wiki countless times. I should be able to plug it straight in with a reversed diode on the signal wire for protection.
            I don't know why sigxcpu suggest I install a pull-up resistor, I don't know what an open collector is but I have read through the link he/she posted and am still none the wiser but am willing to try anything.

            I have the new NPN sensor wired up currently as per the wiki and my image below.

            With the Z_PROBE_IN disconnected, The LED is on when not sensing and turns off when near a metallic object. Indicating I have a NC sensor.
            with the Z_PROBE_IN connected, The LED is on regardless of it sensing or not, It dims very slightly when near a metallic object. The duet does not sense a change when using M558 P1 or P4

            0_1537607725908_current.jpg

            1 Reply Last reply Reply Quote 0
            • undefined
              sigxcpu
              last edited by 22 Sept 2018, 18:14

              Maybe @dc42 says that pull-up is not required because Duet already has one. Basically, you connect brown (+) to V+ (do more than 5V because those senors like more), blue (-) to GND just like in your schematics. The black (output) wire is connected through a diode (put the line of the diode towards your sensor).

              When the sensor is not activated the signal line of the Duet stays at Duet's 3V3 because of the internal pull-up. When sensor is triggered, the last NPN transistor shorts the signal (its collector) to ground (its emitter).

              In theory, no diode will be required, but if the sensor has also an internal pull-up (not open collector) it will push its V+ with higher voltage towards Duet's signal and nasty things can happen.

              Measure the voltage on Duet's signal pin when triggered and not triggered in your last schematic. Untriggered should be ~3.3V and triggered should be ~0V.

              1 Reply Last reply Reply Quote 0
              • undefined
                ajcraig99
                last edited by 25 Sept 2018, 06:16

                Update:

                I spent way to long thinking I was more stupid than I am trying to get this to work.
                Ordered another sensor, exact same model number and it works perfectly. I think I might be using the wrong diode though because it reads 715 when triggered instead of 1000 but it still seams to work so I'm happy.

                Thanks for everybodys patience. 🙂

                1 Reply Last reply Reply Quote 0
                • undefined
                  Jeremy Watkins
                  last edited by 6 Oct 2018, 13:35

                  Not to hijack the thread, but I am also trying to wire an inductive sensor on my older Duet Wifi (I think I am version 1.01). My dilemma is my sensor is a PNP NO DC6-36V, but my fans are 5v fans (can't easily switch them either because I am using a specialized 20mm centrifugal fan due to size constraints on my effector). So I am pretty sure that rules out connecting to the always on fan connections. I have found an abundance of cheaper 5V DC NPN sensors on Amazon which would fit my physical setup, but I am not sure if I would need to use a different diode than a BAT43 or BAT85. The sensor I am considering is a LJ12A3-4-Z/BX-5V.

                  undefined 1 Reply Last reply 6 Oct 2018, 15:29 Reply Quote 0
                  • undefined
                    dc42 administrators @Jeremy Watkins
                    last edited by 6 Oct 2018, 15:29

                    @jeremy-watkins, if using a 5V NPN sensor then you don't need the diode.

                    Duet WiFi hardware designer and firmware engineer
                    Please do not ask me for Duet support via PM or email, use the forum
                    http://www.escher3d.com, https://miscsolutions.wordpress.com

                    undefined 1 Reply Last reply 6 Oct 2018, 16:26 Reply Quote 0
                    • undefined
                      Jeremy Watkins @dc42
                      last edited by 6 Oct 2018, 16:26

                      @dc42 Thanks, I'll give that a try then! Brown to V-FAN with the jumper on 5v, blue to GND, and black to Z PROBE IN. No voltage divider needed either?

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Unless otherwise noted, all forum content is licensed under CC-BY-SA