Artcile on IR distance measurement


Closed Thread
Results 1 to 17 of 17
  1. #1
    Join Date
    Oct 2004
    Posts
    448

    Default Artcile on IR distance measurement

    Hi everyone, I realize this sounds vague, with very sketchy details, so please bear with me.

    Somewhere a long time ago, I'd seen an article on a technique to measure the distance to an obstacle using IR; it was to do with either pic basic or the Stamp, I just can recollect.

    Basically, it described a technique wherein you use just one source, and one detector (3 pin demodulator). You begin by modulating the transmitter at its optimum frequency (38 KHz?) and keep transmitting a single character, and keep reading the pings. You then keep reducing the modulation frequency till reliable pings stop. The difference between the ideal frequency and the one at which you no more get a ping would then be a function of the distance.

    No amount of Googling has yielded any success.

    Does anybody remember this at all?

    Would be great if someone has a copy, or a vector to this, folks.

    Thanks,

    Anand Dhuru

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    This might be it. Good for 6 inches.
    http://rentron.com/PicBasic/infrared..._detection.htm
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Boy, that was it, and that was fast, Dave!

    Thanks so much.

    I thought I had pretty much most of Bruce's articles Scrapbooked in my Firefox, but somehow this one I did not.

    Now to see if this range can be increased to a couple of feet. Might not be difficult since the whole environment, including the reflector can be in a tube, isolated from the ambient. Yup, thats right, my quest for the 'perfect' liquid level detector continues.

    Thanks again.

    Regards,

    Anand

  4. #4
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    You may want to look at Parallax's Robotics with the Boe-Bot (student guide), chapter 8.

    Chapter 8: Robot Control with Distance Detection
    In Chapter 7, we used the infrared sensors to detect whether an object is in the Boe-Bot’s way without actually touching it. Wouldn’t it be nice to also know how far away the object is? This is usually a task for sonar, which sends a pulse of sound out and records how long it takes for the echo to come back. The time it takes for the echo to come back can then be used to calculate how far away the object is. There is, however, a way to accomplish distance detection with the very same circuit you used in the previous chapter.

  5. #5
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Perfect!

    Between the 2 pointers you've given I should be able to figure out something.

    Thank you so much!

    Regards

    Anand

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    For liquids you mayuse Ultrasonics too.

    Ioannis

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Sonar would be a lot better option if you're trying to determine distance between the waters surface and sensor.

    A really cheap option is to attach a float to a shaft, and attach the other end of the shaft to a potentiometer. Water level can be determined by an A/D reading from the pot.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  8. #8
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Sure, Ioannis, Bruce, sonar would be great. But I'm apprehensive about the longevity of the sensor in the damp humid ambiance this application is likely to subject the sensor to.

    Actually, I'd started a thread some time back specifically to do with measuring the level of water in a container.

    A lot of great suggestions got thrown in. I'm afraid this thread is turning out to be an extension of that.

    I had a fair degree of success with a resistor ladder, with stainless steel screws at the nodes being exposed to water.

    Also toyed with the idea of a 'smart' sensor; a pic epoxied at one end of a tube with 10 inputs dipped in the tank, sending the data serially to the control unit, and operating on phantom power.

    However, if it can be improved any further, I'd love that. And hence the query on IR.

    Bruce, the float driven pot might not be very convenient as the depth of different installations varies. And the mechanical jugglery involved in customizing each installation is daunting.

    Till then, if anyone's interested in any specifics, just so that they dont re-invent the wheel, please feel free to ask.

    Regards,

    Anand

  9. #9
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Anand,

    If this is for commercial application, they make sonar tank level sensors specifically designed to operate in wet environments. I mentioned this alternative since I've installed a ton of these in large water tanks for the state.

    The pot + float thing I built one day for my own water tank in my sprinkler system. The float switches I had been using cost around 30-bucks each, and seem to be designed to self-destruct after about 1 year in operation...

    My cobbled-together one has lasted 5+ years, and cost me around $3.

    I've never tried reflecting IR off the waters surface, but I might have to try it some day. If it does work, I'm curious if maybe some of the Sharp IR distance measuring modules would be something to look at?

    The only draw-backs I see with IR in this environment would be lens fogging or specular reflections from the water surface from ambient light.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  10. #10


    Did you find this post helpful? Yes | No

    Default

    Back to the IR, I use this sensor quite often and it works great. Pretty cheap too. The output isn't linear though if it matters to you.

    http://www.acroname.com/robotics/par...P2Y0A02YK.html

  11. #11
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Tobias View Post
    The output isn't linear though if it matters to you.

    http://www.acroname.com/robotics/par...P2Y0A02YK.html
    Yes, that does look promising, though I wish the range was at least a foot or two more.

    I could always use a lookup table. Or, I've noticed in a lot of exponential curves the reciprocal of a reading often fits on a straight line, ready to be used in an algorithm. (I'm no mathematician, so please forgive me if this sounds absurd). Will have to confirm it is so for this sensor in Excel.

    Thanks,

    Anand Dhuru

  12. #12
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default

    The Sharp IR distance sensors IIRC are meant for small distances less than a couple of feet. I had tried to work with one of these sensors and found the range to be severely limited. I found success with the PING from parallax and subsequently rolled my own PINGer using some locally available Ultrasonic sensors http://robokits.co.in/shop/index.php...roducts_id=100 I didn't get too great a range, but, straight line performance was better than 5 feet.

    Regarding the doubts about sensor reliability, you do get the sealed sensors that are meant for liquid measurement applications. The site which will give you a good handle is Maxbotix. This link shows a sensor meant for such http://www.maxbotix.com/MB7067__XL-MaxSonar-WRC1.html

  13. #13
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Bruce asked if this is a commercial product.

    If yes, do not try making your own sensor. In similar cases I used the MicroflexC US sensor. A great product with 4-20mA output. Powered from the 2 lines.

    http://www.hycontrol.com/level_measu...onic_level.php

    The other option ruce gave with the pot, wll not be very linear, though very cheap.

    Ioannis

  14. #14
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    A pressure sensor at the bottom of the tank in an extra fitting. 0.43 psi/foot.
    Dave
    Always wear safety glasses while programming.

  15. #15
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Unless the sensor is well isolated with a special cable too, this is also a good option (Classic 4-20mA too).

    But in general is in my opinion, better not to immerse anything electronics in the water. Keep them out, in an controlled place.

    Ioannis

  16. #16
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    Unless the sensor is well isolated with a special cable too, this is also a good option (Classic 4-20mA too).

    But in general is in my opinion, better not to immerse anything electronics in the water. Keep them out, in an controlled place.

    Ioannis
    That is where snubbers come in handy to isolate the sensor. But a good stainless steel sensor should work with water just fine. I have used this type of thing with products ranging from a pH of 1 to 13.

    Many options. What are the tank dimensions?
    Dave
    Always wear safety glasses while programming.

  17. #17
    Join Date
    May 2010
    Location
    Chile
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Just to add a drop ,

    I've built a proximity sensor from IR led + IR-VIs Phototransistor for the pic.

    Really a low parts count solution and works like charm in the range of 2-30cm if you apply 2 or 3 layers of filtering.

    Anyway, stay away from light reflection methods if you need an accurate linear response according to distance, or be prepared for resolution problems and lookup tables

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

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