Connect with us

Analogue Proximity Sensor

Discussion in 'Sensors and Actuators' started by Gryd3, Nov 24, 2014.

Scroll to continue with content
  1. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    Does anyone know of a way or a circuit to present an analogue output for the proximity of an object?

    IR would be an option, but can an IR phototransistor be operated in a linear region?
    I thought of using multiple IR LEDs and detectors, but the proximity to each other would cause problems.
    I have seen an Ultrasonic 'Ping' sensor used in many projects, but this would require a microprocessor, and would not actually be 'analogue'.

    If anyone has any ideas, it would be much appreciated.
    If I can't find an analogue solution, then I will most likely need to go to a digital solution.
     
  2. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,268
    Nov 28, 2011
    You don't need a microprocessor to go the ultrasonic route if you get clean reflections. You just need an oscillator to generate the tone bursts and reset a capacitor ramp, which you sample when the reflection is detected.

    You can be tricky with the detection amplitude to give it a crude AGC to prevent triggering on weak reflections, but it really needs a good clear reflection to work properly in my experience.

    I designed a circuit to do this many moons ago, but I've looked through my archive and I can't find it :-( But there should be designs available out there on teh interwebs.
     
  3. Harald Kapp

    Harald Kapp Moderator Moderator

    10,022
    2,136
    Nov 17, 2011
    What distance do you consider?

    An IR based sensor could generate an analog signal, but probably not a very linear one. Also the signal will depend on factors like reflectivity of the object to be sensed an environmental lighting.
    A radar based sensor could be used, but the ones I've seen typically are set up for digital (threshold based) operation. It may be possible to modify such a sensor to give an analog signal.
    For very short distances a capacitive sensor can be used. However, the signal will depend on the conductivity of the object to be sensed.
    Although the web page for this ultrasonic sensor mentions the use of a microcontroller for measuring distance, I don't see any reason why you shouldn't be able to use this sensor in an analog setup. I imagine this setup:
    • a clock source to repeatedly trigger the emission of a sound burst (ping), e.g. as simple as a 555 timer.
    • a constant current source charging a capacitor where the capacitor is discharged by the triggger impulse for the ping-emitter
    • a track-and-hold circuit that follows the voltage on th capacitor and is triggered by the ping-receiver
    The voltage on the capacitor will be reset to 0V on emission of the ping. It will then rise linearly with time due to the constant charging current. Once the ping's echo is received, the receiver triggers the track and hold and the voltage at the output is directly proportional to the time from emission of the ping to reception and therefore to proportional to distance. No microprocessor required :)

    Edit: If you can live with a discontinuous output voltage, you could simply turn off the current source (instead of using a separate track-and-hold). The capacitor will hold the voltage until it is discharged for the next measurement.
     
    Last edited: Nov 24, 2014
  4. Harald Kapp

    Harald Kapp Moderator Moderator

    10,022
    2,136
    Nov 17, 2011
    Argh, again 4 minutes :D
     
  5. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    The device in question will be using a bar graph driver... so an analogue voltage range is ideal... hopefully linear(ish)
    The idea is to have LEDs light up as the person approaches the picture... (Will be wall mounted)
    I would like to have it detect between roughly 3-1 feet
     
  6. Harald Kapp

    Harald Kapp Moderator Moderator

    10,022
    2,136
    Nov 17, 2011
    I think radar or ultrasound would be ideal for this range (just an opinion). An LM3914 will control an LED bargraph display from an analog input voltage that can be derived as Kris and I described above.
     
  7. Frenoy Osburn

    Frenoy Osburn

    64
    24
    Nov 20, 2014
    There are some ultrasonic modules which give you an analog voltage corresponding to the distance.

    The one linked below has a range of 6.45m with an analog output of 9.8mV/in for a 5V supply.
    There are few more with greater and lesser ranges.

    https://www.sparkfun.com/products/639
     
    Harald Kapp and KrisBlueNZ like this.
  8. Harald Kapp

    Harald Kapp Moderator Moderator

    10,022
    2,136
    Nov 17, 2011
    Good job, Frenoy.

    @Gryd3: If you want to build your own sensor electronics anyway, here's how it can be done:
    [​IMG]
    • The 555 generates short pulses spaced approx. 20ms apart.Each pulse discharges C3 which will then be re-charged by R6. I used a simple resistor instead of a current source. This introduces a certain non-linearity which may not be important for your project.
    • B1 is a behavioural source to model the delay of the returning ping. The ".step" and ".param" statements compute the time delay for distances of 0.1m...0.5m in increments of 0.1m. The resultinmg signal is shown as light blue pulses (output of B1).
    • Switch S1 and capacitor C4 form a primitive sample and hold circuit.
    • The red trace in the top diagram is the voltage on C3. The non-linear charge curve is clerly visible.
    • The dark blue traces show the sampled voltage which varies with distance but otherwise stays rather constant.
    Note that the top diagram shows the superposition of 5 simulations, 1 for each distance. The variation can be seen in the dark blue traces only.
     

    Attached Files:

    Last edited: Nov 24, 2014
  9. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    Thank you all a ton!
    I figured I'd be stuck with a microcontroller for this.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-