1
\$\begingroup\$

I am wondering whether or not it is possible to use an Arduino ultrasonic sensor in a closed box (30 cm x 30 cm.)

I have been told that the walls will cause the signal to bounce all over the place and the sensor will get messed up, but I am not sure if this is accurate. Please let me know if this is possible.

Also, if ultrasonic sensors don't work, I believe the best alternative would be a laser sensor.

Unfortunately, I noticed that laser sensors require SDA and SCL pins. My ATmega64 microcontroller only has one of each of these pin types, yet I need three laser sensors. Is there any workaround for this problem?

\$\endgroup\$
3
  • 2
    \$\begingroup\$ Those SDA and SCL pins are for the I2C bus, which is a multi-slave bus. There won't be a problem in connecting multiple sensors assuming they have different addresses. \$\endgroup\$ – Christopher Moore Dec 2 '20 at 20:43
  • \$\begingroup\$ Pulsed or CW ultrasound? Pulsed ultrasound will work, you'll just see additional echoes from the walls, which you can ignore. \$\endgroup\$ – user1850479 Dec 2 '20 at 21:14
  • \$\begingroup\$ The key question for ultrasound is if the range to your intended target exceeds the sensor module's ringing-limited minimum. If it does, your closed box is mostly a problem in terms of the fact that with no closer target you will read the short distance to the opposite wall. In any case with such a sensor, you need to wait for echos of one reading to all but completely die out before you can meaningfully take another by triggering a new transmission. \$\endgroup\$ – Chris Stratton Dec 2 '20 at 21:46
0
\$\begingroup\$

You can also bit bang the I2c node if you wish to use it on a port independent of the single hardware I2C port.

However, I2c is a multi-node bus so you can connect multiple devices to it as long as they have separate addresses and as long as the bus speed is adequate for the data from all equipped devices.

\$\endgroup\$

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.