k4nk3i
Posts: 10
Joined: Sun Dec 17, 2017 1:00 pm

HELP connecting an Ultrasonic Sensor to a R-Pi 4

Wed Jul 28, 2021 9:38 pm

Hi,

I am working on a project involving a Ultrasonic Sensor but I have problems to get data. I hope I someone will be able to help.

The material:

  • Raspberry pi 4

I have enabled UART in /boot/config.txt with the following two lines at the end

Code: Select all

enable_uart=1
dtoverlay=disable-bt

And finally, I have followed the instruction given here (https://wiki.dfrobot.com/A02YYUW%20Wate ... %20SEN0311)

I have created a python script as explained, but when I run it, I get the following output:

Code: Select all

Traceback (most recent call last):
  File "demo_get_distance.py", line 21, in <module>
    from DFRobot_RaspberryPi_A02YYUW import DFRobot_A02_Distance as Board
ImportError: No module named DFRobot_RaspberryPi_A02YYUW

It looks like the module DFRobot_RaspberryPi_A02YYUW is not found or not recognised. One more thing, I can hear the sensor making a small noise, which indicate that it is at least receiving power and sending ultrasound.

I hope someone can help me resolve this issue. I need to get this working for a project.

Thanks

k4nk3i
Posts: 10
Joined: Sun Dec 17, 2017 1:00 pm

Re: HELP connecting an Ultrasonic Sensor to a R-Pi 4

Wed Jul 28, 2021 10:11 pm

I got it working :)

I was just missing some files

Return to “Automation, sensing and robotics”