General

Using Multiple A02YYUW Sensors

userHead Chatham.Sturgis 2023-03-07 03:41:02 207 Views1 Replies

Hello. I am trying to use multiple A02YYUW Ultrasonic Sensors on a robot for a project. The provded refernece code works for one sensor, but we have not been able to use multiple at the same time. I first tried using a Raspberry Pi 4, but when I tried to reference the library provided by the company, I got a permission denied error. I then tried editing the test code, which did not work either. Then, I tried an arduino. Using the Software Serial library, which is used by the arduino code on the product wiki, I can get one sensor to give readings. However, when I add a second instance to add in the second sensor, it does not provide readings. I am trying to use 4 total sensors and get readings from each sensor in one code. I would prefer not to use multiple Arduinos if possible. Thank you for the help.

2023-03-07 10:19:47

Hi

To use multiple A02YYUW Waterproof Ultrasonic Sensor(SKU:SEN0311), multiple serial port(UART) is required. However, arduino just have one softserial.

You may need board like Arduino MEGA2560, which have 4 serial port. You can initial two serial ports and connect them to the sensor seperatedly.

Hope it can help.

 

userHeadPic NeloKin