A02 UART Controlled distance sensor issue
![userHead](https://dfimg.dfrobot.com/dfPortrait2.png)
Hi everyone,
I need help making an A02 UART controlled distance sensor to work with a Raspberry Pi 2.
I have enabled UART by following the procedure to enable the serial ports BCM 14 and 15.
I have confirmed that the TX and RX connectors are connected o the right ports. Swapping them still gets me the error below.
When I connect the sensor and run the sample demo script from DFRobot I only get the following results:
“No data!”
Is there something I have not done?
I found the solution to this.Since this is a UART-controlled sensor, all I had to do is send an initiate bit to the controller to get a reading. Works flawlessly with a very simple script. This is a great sensor, will definately work in my implementation now!! Thanks for the resolution effort Jenna, I appreciate you!
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
I just noticed something interesting.If I disconnect and then reconnect the sensor I get a single measurement like below
I checked from the vendor I bought this from and I see this description for my particular sensor
My sensor is the UART controlled one. Is there something I need to modify to allow me to trigger a distance measurement?I will appreciate any help I can get.
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
Hi Jenna,Thanks for the pointers. I changes all these but still get “No data”
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
Hi!
We updated the library and tested fine with Raspberry 4B and Raspberry 3B.
Please update the library, change the file according to the following figure, and restart the Raspberry Pi.The configuration for Raspberry 4B and Raspberry 3B is the same.
If there is still no data, please modify and save the file as shown below, and restart the Raspberry Pi.
![](https://dfimg.dfrobot.com/nobody/makelog/c63b1f074dae038ab18c6bb381abe400.jpg)
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
Hi! After entering the cmd command “ls /dev -al ” , does it return such a result? If you have a USB-to-TTL-to-serial module, you can try to connect a PC and a Raspberry Pi 4, and check the data transmission and reception through the serial debugging assistants of the two platforms.
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
Just bumping this if anyone has ideas on how I can use a A02YY UART Controlled distance sensor with a Raspberry PI4.
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
Also is there a way to check if the sensor is detected on the ports I have connected it to?
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
Just to confirm that I have the UART CONTROLLED version not the AUTOMATIC version, so could there be something I am meant to do like send a trigger pulse?
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
Thanks, @embeddedprogrammer.I have tried the above but with no success. I still get the “No data” response.Any thing else I can try?
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
You have to enable UART in /boot/config.txt with the following two lines at the end
enable_uart=1dtoverlay=disable-bt
and use python3 demo_get_distance.pynot python2 demo_get_distance.py to start the program
you may need to install pyserial
![userHeadPic](https://dfimg.dfrobot.com/6089c874aa9508d63a41376e/shop/123c58593b7c63b7bb61b829ea4ae97a_50x50.jpg)