Shop OBEX P1 Docs P2 Docs Learn Events
Inductive proximity sensor--how does it work? — Parallax Forums

Inductive proximity sensor--how does it work?

I have this device: QS18-05N-1 Proximity Switch.
I use it to detect the presence/absence of a steel ball, as shown at 53s in this video. Note that the ball is not magnetized.

I have two questions:
1. How does it work? I'd love someone to explain like I'm 5.
2. Does anyone know of a similar device that's shorter (in the vertical direction when oriented as in the video)?

I'm primarily interested in question 2 but I figure I should also try to learn something!

Comments

  • JonnyMacJonnyMac Posts: 9,617
    edited 2026-01-22 22:56

    There's a link to the datasheet right on the sales page. In that datasheet you'll find a circuit diagram -- I clipped and edited.

    That device is NPN/Open-Collector. What this means is that pin 4 (black wire) is either floating (like an open switch) or connected to ground. If you want to monitor that with a microcontroller like the Propeller, connect a pull-up (e.g., 10kl) to pin 4 and the other side to 3.3v. When the sensor is idle, the Propeller input pin will see a high; when the sensor is active, that pin will go low. Easy peasy. Note that the sensor is powered by 12v, and the ground on the sensor and the microcontroller must be connected together for this to work.

  • evanhevanh Posts: 17,046
    edited 2026-01-22 23:06

    https://www.balluff.com/en-us/blog/the-basic-operating-principle-of-an-inductive-proximity-sensor

    https://www.baumer.com/int/en/service-support/function-principle/working-principle-and-technology-of-inductive-sensors/a/Know-how_Function_Inductive-sensors

    "... creating an alternating electromagnetic field that emerges from the active surface of the sensor. Any metal object approaching the front will induce eddy currents draining energy from the oscillator."

    As for size and shape, it looks like you've got it sitting sweet as is. I wouldn't change what you've got.

    Here's a Q&A along the lines of Jon's answer - https://www.ifm.com/gb/en/gb/landing-page-uk/proximity-sensors-explained-types-applications-and-benefits

  • mparkmpark Posts: 1,326

    @JonnyMac said:
    There's a link to the datasheet right on the sales page. In that datasheet you'll find a circuit diagram -- I clipped and edited.

    Thanks, I did manage to wire it up. I was actually hoping for more insight into the mysterious "Proximity Sensor main circuits" box :smiley:

    @evanh said:
    "... creating an alternating electromagnetic field that emerges from the active surface of the sensor. Any metal object approaching the front will induce eddy currents draining energy from the oscillator."

    Ah, that is the sort of information I was hoping for. Thank you!

    As for size and shape, it looks like you've got it sitting sweet as is. I wouldn't change what you've got.

    Well, I would much prefer something that takes up less vertical space, so if anyone has any leads, LMK!

  • AribaAriba Posts: 2,695

    @mpark said:

    Well, I would much prefer something that takes up less vertical space, so if anyone has any leads, LMK!

    How about this one?
    https://dfrobot.com/product-2025.html

    Sensing distance is 4mm (I think the one you use has 5mm), but it's quite small.

    Andy

  • RaymanRayman Posts: 15,972

    I'm guessing there's an RF coil inside and it monitors for a change in the resonant frequence of the LC circuit...

    I'm imagining it's like those old AM radio kits where you move a ferrous part in and out of a coil to change frequency...

  • mparkmpark Posts: 1,326

    @Ariba said:
    How about this one?
    https://dfrobot.com/product-2025.html

    Whoa, Andy, that's perfect! Since I want the detector to be underneath the "detectee", this will take up only 6mm of vertical space.
    Assuming, that is, that the little crosshair symbol indicates the detection area.

    @"R Baggett" said:
    smallest, cheapest with 4 MM sense distance in my goto parts list is https://www.automationdirect.com/adc/shopping/catalog/sensors_-z-_encoders/inductive_proximity_sensors/small_rectangular/aps4-12m-z-d

    That's the front-sensing version; I'd go for the top-sensing version so it would be 12mm "tall" in my application; a good second option.

    Thanks everyone!

  • TubularTubular Posts: 4,770

    Sounds like you found a solution, but I remembered a PE kit article from Parallax which had a metal detector, check out ~page 180,
    https://media.digikey.com/pdf/Data%20Sheets/Parallax%20PDFs/Propeller_Education_Kit_Labs.pdf

  • mparkmpark Posts: 1,326

    @Tubular said:
    Sounds like you found a solution, but I remembered a PE kit article from Parallax which had a metal detector, check out ~page 180,
    https://media.digikey.com/pdf/Data%20Sheets/Parallax%20PDFs/Propeller_Education_Kit_Labs.pdf

    Very interesting--thanks for that!

  • just an observation. It looks like your prox arrangement is working just fine in the video. Maybe more accuracy isn't needed, but from a microcontroller standpoint inductive proxes are very slow and tend to have a granularity at their oscillator frequency, (Usually 4 KHZ).

    If you find more precision is needed, you could go for a 'guitar pickup' strategy with a very small magnet and coil or hall-effect sensor. Even non ferrous balls will pick up an eddy current as they pass and 'blip' the coil or sensor. Anything that will work with an inductive prox will work that way. Then the granularity is in your microcontroller, and propeller 1 or 2 is pretty fast...

  • @"R Baggett" said:
    ....
    If you find more precision is needed, you could go for a 'guitar pickup' strategy with a very small magnet and coil or hall-effect sensor. Even non ferrous balls will pick up an eddy current as they pass and 'blip' the coil or sensor. Anything that will work with an inductive prox will work that way. Then the granularity is in your microcontroller, and propeller 1 or 2 is pretty fast...

    Hi, this is interesting!
    Do you have an example of such setup with schematics? I ask, because a Guitar pickup has a very high number of windings and still has only about 50mV amplitude? Movement of the string perhaps 2mm at 4mm distance to the pickup. Some sort of amplifier would be needed?

Sign In or Register to comment.