I have a very strange error. My ultrasonic sensor, when both speakers are sticking out of my case, doesn't work at all. It's a black case. It gives very "near" readings. But it does work when outside. Why could this be an issue?

  • 4
    \$\begingroup\$ Please add a picture of your setup. \$\endgroup\$ – jippie Feb 24 '13 at 9:51
  • 2
    \$\begingroup\$ Maybe you are getting leakage out the back of the transducer bouncing inside the enclosure. You could try making a transducer cutout in a piece of comparable material so it is just a wall with no box. Also try a box with the transducer end completely open, and a box filled with deadening material. When you understand the cause you can engineer around it. \$\endgroup\$ – Chris Stratton Feb 24 '13 at 14:30

It is likely that the transducer and receiver are being coupled together by the enclosure, so that the signal being received first is the vibration through the enclosure rather than an external object. I would recommend enlarging the holes so they are not in physical contact with the enclosure.

You may also be getting similar problems if the board is secured very rigidly to the base of the enclosure, in that case maybe consider using some o-rings between the mounting hardware and the enclosure. But try step 1 first if the holes are tight fitting.

  • \$\begingroup\$ Yes, oh my this might be the case. \$\endgroup\$ – Raaj Feb 24 '13 at 7:57

The sensor consists of a transmitter and a receiver, and it measures the time delay between a transmitted signal and the same signal being received. The further an obstacle which reflects the signal the higher the delay. If you put the sensor in a closed housing then the US signal will reflect back immediately when it bounces on the housing. It's normal that you get a "near" reading.

Always mount transmitter and receiver so that they have a free view towards the environment, So you need holes in the housing.

  • \$\begingroup\$ but the two speakers are sticking out of a hole \$\endgroup\$ – Raaj Feb 24 '13 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.