Electronic – arduino – Ultrasonic sensor doesn’t work inside case

arduinorange-detectorsensorultrasound

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?

Best Answer

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.