# Ultrasonic Module not working on the PiDog

**URL:** <https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671>\
**Category:** Robotic kit for Raspberry Pi\
**Created:** [February 19, 2025, 12:58am UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671 "2025-02-19T00:58:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pjhammond](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@pjhammond](https://forum.sunfounder.com/u/pjhammond)\
**Post date:** [February 19, 2025, 12:58am UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/1 "2025-02-19T00:58:59Z")

</div>

I just built the PiDog and everything seems to be working but the ultrasonic module. I tried swapping it out with another I’ve had on hand and tired a different cable. The multimeter shows 3.3V when testing ground so the pins seem to be getting power. I tired using d2 and d3 with the test script. I know these pins work since the touch switch works using them.

The following is the output I get in the terminal:

paulhammond@raspberrypi:~ $ cd ~/pidog/examples  
paulhammond@raspberrypi:~/pidog/examples $ sudo python3 4\_response.py  
config\_file: /home/paulhammond/.config/pidog/pidog.conf  
robot\_hat init … done  
imu\_sh3001 init … done  
rgb\_strip init … done  
dual\_touch init … done  
sound\_direction init … done  
sound\_effect init … pinctrl set 20 op dh  
done  
ultrasonic init … fail  
Process sensory\_process:  
Traceback (most recent call last):  
File “/usr/lib/python3/dist-packages/gpiozero/pins/pi.py”, line 411, in pin  
pin = self.pins[info]  
~~~~~~~~~ ^^^^^^  
KeyError: PinInfo(number=7, name=‘GPIO4’, names=frozenset({‘BOARD7’, ‘BCM4’, 4, ‘WPI7’, ‘J8:7’, ‘GPIO4’, ‘4’}), pull=‘’, row=4, col=1, interfaces=frozenset({‘’, ‘dpi’, ‘spi’, ‘uart’, ‘i2c’, ‘gpio’}))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/usr/local/lib/python3.11/dist-packages/pidog-1.3.9-py3.11.egg/pidog/pidog.py”, line 583, in sensory\_process\_work  
trig = Pin(‘D1’)  
^^^^^^^^^  
File “/usr/local/lib/python3.11/dist-packages/robot\_hat/pin.py”, line 96, in **init**  
self.setup(mode, pull, active\_state)  
File “/usr/local/lib/python3.11/dist-packages/robot\_hat/pin.py”, line 134, in setup  
self.gpio = OutputDevice(self.\_pin\_num)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/usr/lib/python3/dist-packages/gpiozero/devices.py”, line 108, in **call**  
self = super(). **call** (\*args, \*\*kwargs)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/usr/lib/python3/dist-packages/gpiozero/output\_devices.py”, line 74, in **init**  
super(). **init** (pin, pin\_factory=pin\_factory)  
File “/usr/lib/python3/dist-packages/gpiozero/mixins.py”, line 75, in **init**  
super(). **init** (\*args, \*\*kwargs)  
File “/usr/lib/python3/dist-packages/gpiozero/devices.py”, line 553, in **init**  
pin = self.pin\_factory.pin(pin)  
^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/usr/lib/python3/dist-packages/gpiozero/pins/pi.py”, line 413, in pin  
pin = self.pin\_class(self, info)  
^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/usr/lib/python3/dist-packages/gpiozero/pins/lgpio.py”, line 126, in **init**  
lgpio.gpio\_claim\_input(  
File “/usr/lib/python3/dist-packages/lgpio.py”, line 755, in gpio\_claim\_input  
return \_u2i(\_lgpio.\_gpio\_claim\_input(handle&0xffff, lFlags, gpio))  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/usr/lib/python3/dist-packages/lgpio.py”, line 458, in \_u2i  
raise error(error\_text(v))  
lgpio.error: ‘GPIO busy’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/usr/lib/python3.11/multiprocessing/process.py”, line 314, in \_bootstrap  
self.run()  
File “/usr/lib/python3.11/multiprocessing/process.py”, line 108, in run  
self.\_target(\*self.\_args, \*\*self.\_kwargs)  
File “/usr/local/lib/python3.11/dist-packages/pidog-1.3.9-py3.11.egg/pidog/pidog.py”, line 590, in sensory\_process\_work  
raise ValueError(e)  
ValueError: ‘GPIO busy’  
distance.value: -1.0 cm, touch N  
distance.value: -1.0 cm, touch N  
distance.value: -1.0 cm, touch N  
distance.value: -1.0 cm, touch N

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [February 19, 2025, 10:29am UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/2 "2025-02-19T10:29:12Z")

</div>

From the error message, the problem mainly lies in the failed initialization of the ultrasonic sensor, which prevents subsequent GPIO operations from proceeding normally.  
Ensure that the ultrasonic sensor is properly connected to the GPIO pins of the Raspberry Pi.  
Check for loose or damaged connecting wires.  
Sometimes the state of the GPIO pins may remain occupied because they were not properly released by the previous program, restarting the Raspberry Pi can release all GPIO pins.

---

<div class="post-metadata">

**Author:** ![pjhammond](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@pjhammond](https://forum.sunfounder.com/u/pjhammond)\
**Post date:** [February 19, 2025, 8:13pm UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/3 "2025-02-19T20:13:12Z")

</div>

Hi, Thanks for your quick reply. I’ve done all of the above and get the same result. Not sure what to do next. I’m suspecting a hardware issue with the hat.

---

<div class="post-metadata">

**Author:** ![trebor](https://avatars.discourse-cdn.com/v4/letter/t/85f322/32.png) [@trebor](https://forum.sunfounder.com/u/trebor)\
**Post date:** [February 20, 2025, 7:45pm UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/4 "2025-02-20T19:45:01Z")

</div>

I have the same indication. Contacted the service they replied nicely with the check cable advice. I also tried with a new cable and another ultrasonic module (same as original) and it does not work. Contacted the service today…let’s see.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [February 21, 2025, 3:33pm UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/5 "2025-02-21T15:33:14Z")

</div>

We tested the program and it seems to be fine. You mentioned before that you measured GND to get 3.3v, is that the GND of the ultrasonic module? Did you reverse the GND and 3v3 of the cable?  
Also if you want to modify the pin test, you need to modify the pin of the touch module or not initialize the touch module, otherwise it will lead to “GPIO busy, in fact, you can run ultrasonic\_test. py in ‘~/pidog/test/’ directory, it will only initialize the touch module, but it will not initialize the touch module, it will not initialize the touch module. In fact you can run ultrasonic\_test.py in the “~/pidog/test/” directory, which will only initialize the ultrasonic module.

---

<div class="post-metadata">

**Author:** ![pjhammond](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@pjhammond](https://forum.sunfounder.com/u/pjhammond)\
**Post date:** [February 21, 2025, 7:16pm UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/6 "2025-02-21T19:16:27Z")

</div>

I ran the ultrasonic\_test.py in the ~/pidog/test directory and got the error output in the attached document. I noticed there is no ultrasonic.py file in the robot-hat folder (see screenshot).

(Attachment ultrasonic\_error.rtf is missing)

> **(attachments)**
>
> ![Screen Shot 2025-02-21 at 1.12.49 PM.png](https://canada1.discourse-cdn.com/flex029/uploads/sunfounder/original/2X/e/ec2d5266a74b17fd3f97eca2a76b4fec45f8bf0e.png)

---

<div class="post-metadata">

**Author:** ![pjhammond](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@pjhammond](https://forum.sunfounder.com/u/pjhammond)\
**Post date:** [February 21, 2025, 7:30pm UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/7 "2025-02-21T19:30:49Z")

</div>

Not sure if the attachment came through. Here is the error I get from running ultrasonc\_test.py. Also, as mentioned before there is no ultrasonic.py in the robot\_hat directory.

> > > %Run ultrasonic\_test.py  
> > > Traceback (most recent call last):  
> > > File “/usr/lib/python3/dist-packages/gpiozero/pins/pi.py”, line 411, in pin  
> > > pin = self.pins[info]  
> > > KeyError: PinInfo(number=7, name=‘GPIO4’, names=frozenset({‘J8:7’, 4, ‘WPI7’, ‘4’, ‘BCM4’, ‘GPIO4’, ‘BOARD7’}), pull=‘’, row=4, col=1, interfaces=frozenset({‘’, ‘uart’, ‘i2c’, ‘gpio’, ‘dpi’, ‘spi’}))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/home/paulhammond/pidog/test/ultrasonic\_test.py”, line 4, in   
ultrasonic = Ultrasonic(Pin(“D1”), Pin(“D0”))  
File “/usr/local/lib/python3.11/dist-packages/robot\_hat/pin.py”, line 96, in **init**  
self.setup(mode, pull, active\_state)  
File “/usr/local/lib/python3.11/dist-packages/robot\_hat/pin.py”, line 134, in setup  
self.gpio = OutputDevice(self.\_pin\_num)  
File “/usr/lib/python3/dist-packages/gpiozero/devices.py”, line 108, in **call**  
self = super(). **call** (\*args, \*\*kwargs)  
File “/usr/lib/python3/dist-packages/gpiozero/output\_devices.py”, line 74, in **init**  
super(). **init** (pin, pin\_factory=pin\_factory)  
File “/usr/lib/python3/dist-packages/gpiozero/mixins.py”, line 75, in **init**  
super(). **init** (\*args, \*\*kwargs)  
File “/usr/lib/python3/dist-packages/gpiozero/devices.py”, line 553, in **init**  
pin = self.pin\_factory.pin(pin)  
File “/usr/lib/python3/dist-packages/gpiozero/pins/pi.py”, line 413, in pin  
pin = self.pin\_class(self, info)  
File “/usr/lib/python3/dist-packages/gpiozero/pins/lgpio.py”, line 126, in **init**  
lgpio.gpio\_claim\_input(  
File “/usr/lib/python3/dist-packages/lgpio.py”, line 755, in gpio\_claim\_input  
return \_u2i(\_lgpio.\_gpio\_claim\_input(handle&0xffff, lFlags, gpio))  
File “/usr/lib/python3/dist-packages/lgpio.py”, line 458, in \_u2i  
raise error(error\_text(v))  
lgpio.error: ‘GPIO busy’

---

<div class="post-metadata">

**Author:** ![trebor](https://avatars.discourse-cdn.com/v4/letter/t/85f322/32.png) [@trebor](https://forum.sunfounder.com/u/trebor)\
**Post date:** [February 21, 2025, 8:44pm UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/8 "2025-02-21T20:44:10Z")

</div>

Same here. I get exactly the same error with the ultrasonic\_test.py in the /test directory. But there is also the ultrasonic init fail message. Also with a new module and cable. Contacted the service. So far no answer.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [February 25, 2025, 2:48am UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/9 "2025-02-25T02:48:57Z")

</div>

We are very sorry that we have not reproduced the problem you are experiencing.  
Confirm that the hardware module is connected correctly.  
What model of Raspberry Pi are you currently using, what system are you using, and what is the system version, please let us know so that we can reproduce the problem.

---

<div class="post-metadata">

**Author:** ![pjhammond](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@pjhammond](https://forum.sunfounder.com/u/pjhammond)\
**Post date:** [February 25, 2025, 4:02am UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/10 "2025-02-25T04:02:22Z")

</div>

I have verified all hardware is connected correctly according to the installation instructions. I am using a Raspberry PI 4. I swapped the PI 4 out with another one and still have the same issue. I reloaded the latest version of the Raspberry PI OS onto a new SD card and installed the required modules. As stated before, I tried a new ultrasonic module and cable. I verified both modules work using an Arduino Board. This leaves the robot hat module as the problem since I don’t have another one to test. I measured the voltage from ground to D0 and D1 and get a reading of only .6 volts. You won’t be able to recreate the issue if this is a hardware issue.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [February 26, 2025, 10:14am UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/11 "2025-02-26T10:14:40Z")

</div>

Please contact our after-sales email: [service@sunfounder.com](mailto:service@sunfounder.com)  
We will resend you a new RobotHat.

---

<div class="post-metadata">

**Author:** ![pjhammond](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@pjhammond](https://forum.sunfounder.com/u/pjhammond)\
**Post date:** [March 1, 2025, 11:32pm UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/12 "2025-03-01T23:32:45Z")

</div>

I discovered what the problem is. I installed the Python3 related packages listed in step 1 in the Installing All Modules section of the Quick Guide. I shouldn’t have done that since that is only for the Lite version OS. Perhaps extra wording could be added to warn people using the full version to skip this step. Anyway, I did a fresh install and now everything works.

---

<div class="post-metadata">

**Author:** ![Geoffrey](https://avatars.discourse-cdn.com/v4/letter/g/bc8723/32.png) [@Geoffrey](https://forum.sunfounder.com/u/Geoffrey)\
**Post date:** [April 24, 2025, 2:37pm UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/13 "2025-04-24T14:37:59Z")

</div>

I am having the same problem.

Could you share how to actually solve this problem? What did you install instead?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [April 25, 2025, 7:26am UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/14 "2025-04-25T07:26:05Z")

</div>

Dear Geoffrey,

May I ask which version of the Raspberry Pi system you’re currently using?

Here’s what you need to know about the installation process:

If you’re using the desktop version of Bookworm (64/32-bit), you don’t need to run this command during library installation:  
sudo apt install git python3-pip python3-setuptools python3-smbus

However, if you’re using the lite version of Bookworm (64/32-bit), then you will need to execute the above command.

For detailed instructions, please refer to our tutorial:  
PiDog Installation Guide

Let me know if you need any further clarification!

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [April 25, 2025, 7:26am UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/15 "2025-04-25T07:26:43Z")

</div>

> **[5. Install All the Modules(Important) — SunFounder PiDog Kit 1.0 documentation](https://docs.sunfounder.com/projects/pidog/en/latest/python/python_start/install_all_modules.html)**

 ![image (30)](https://canada1.discourse-cdn.com/flex029/uploads/sunfounder/original/2X/0/0a7b7c88b23454168d78a9398bfd7c61bed9c591.png)

---

<div class="post-metadata">

**Author:** ![pjhammond](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@pjhammond](https://forum.sunfounder.com/u/pjhammond)\
**Post date:** [April 25, 2025, 2:18pm UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/16 "2025-04-25T14:18:30Z")

</div>

I did a clean install without installing the Python 3 related packages because I was not using the Lite version of Bookworm. If you install it on the full version you’ll have the same problem as I did.

---

<div class="post-metadata">

**Author:** ![Geoffrey](https://avatars.discourse-cdn.com/v4/letter/g/bc8723/32.png) [@Geoffrey](https://forum.sunfounder.com/u/Geoffrey)\
**Post date:** [April 25, 2025, 10:46pm UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/17 "2025-04-25T22:46:41Z")

</div>

Yes, it worked for me as well. Thank you so much for sharing the solution.

1. I did a fresh install of the recommended Raspberry Pi OS
2. I followed all the steps in the “Install all the modules” part of the quick guide, except for the 1st step, do not run: _sudo apt install git python3-pip python3-setuptools python3-smbus_

Now back to enjoying this amazing robot dog!! 😃

---

<div class="post-metadata">

**Author:** ![Xus](https://avatars.discourse-cdn.com/v4/letter/x/59ef9b/32.png) [@Xus](https://forum.sunfounder.com/u/Xus)\
**Post date:** [September 30, 2026, 5:03pm UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/18 "2026-09-30T17:03:13Z")

</div>

Hola a todos, yo tengo el mismo problema con el modulo de ultrasonido. Hice una reinstalacion del S. O. de la raspberry pi(P4 (64btis)de 2Mb RAM), tal como dicen, y no instale el primer paso : _sudo apt install git python3-pip python3-setuptools python3-smbus._

Tambien conprobe el modulo ultrasonico, lo cambie por otro, ycambie los cables.

Sigue sin funcionar me da el siguiente fallo:

gos@PiGos:~/robot-hat $ cd ~/pidog/examples  
sudo python3 0\_calibration.py  
config\_file: /home/gos/.config/pidog/pidog.conf  
robot\_hat init … done  
imu\_sh3001 init … done  
rgb\_strip init … done  
dual\_touch init … done  
sound\_direction init … done  
sound\_effect init … done  
ultrasonic init … fail  
Exception in thread sensory\_thread:  
Traceback (most recent call last):  
File “/usr/local/lib/python3.13/dist-packages/pidog/pidog.py”, line 596, in sensory\_process\_work  
trig = Pin(‘D1’)  
File “/usr/local/lib/python3.13/dist-packages/robot\_hat/pin.py”, line 194, in **init**  
self.setup(mode, pull, active\_state)  
~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/usr/local/lib/python3.13/dist-packages/robot\_hat/pin.py”, line 240, in setup  
lgpio.gpio\_claim\_output(Pin.\_chip, self.\_pin\_num, 0, pull\_mode)  
~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/usr/lib/python3/dist-packages/lgpio.py”, line 781, in gpio\_claim\_output  
return \_u2i(\_lgpio.\_gpio\_claim\_output(handle&0xffff, lFlags, gpio, level))  
File “/usr/lib/python3/dist-packages/lgpio.py”, line 458, in \_u2i  
raise error(error\_text(v))  
lgpio.error: ‘GPIO busy’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/usr/lib/python3.13/threading.py”, line 1043, in \_bootstrap\_inner  
self.run()  
~~~~~~~~ ^^  
File “/usr/lib/python3.13/threading.py”, line 994, in run  
self.\_target(\*self.\_args, \*\*self.\_kwargs)  
~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/usr/local/lib/python3.13/dist-packages/pidog/pidog.py”, line 603, in sensory\_process\_work  
raise ValueError(e)  
ValueError: ‘GPIO busy’

¿Que puedo hacer?

Gracias

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [October 2, 2026, 6:09am UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/19 "2026-10-02T06:09:48Z")

</div>

Thank you very much for providing the complete error logs and for replacing the ultrasonic module and cable — this information helps us a lot in narrowing down the issue.

The lgpio.error: ‘GPIO busy’ in the log means the GPIO pin used by the ultrasonic module is already occupied, so the program cannot claim it. The error occurs during pin initialization, before any distance measurement begins, so we cannot yet conclude that the ultrasonic module is faulty.

The PiDog ultrasonic module uses GPIO17 (D0, Echo) and GPIO4 (D1, Trig). One likely cause is that 1-Wire is enabled on the system, since it uses GPIO4 by default and may conflict with the ultrasonic module. Please follow these steps:

Open the Raspberry Pi configuration tool:  
sudo raspi-config  
Go to Interface Options → 1-Wire and select No to disable it. Please keep I2C enabled, as PiDog needs it.

Reboot the Raspberry Pi:  
sudo reboot

After rebooting, do not start the control App or any other PiDog program — run only the ultrasonic test on its own:  
cd ~/pidog/test  
sudo python3 ultrasonic\_test.py  
Please send us the complete terminal output.

If the test works, please run the calibration program as well.

If ‘GPIO busy’ still appears, please send us the complete error from this test, along with the output of the following command, so we can further identify what is occupying the pin:  
sudo gpioinfo  
If the command is not found, please install it first:  
sudo apt install gpiod

In addition, please also confirm the wiring direction of the ultrasonic module (that GND and 3V3 are not reversed), and let us know your Raspberry Pi model, operating system type, and version number, so we can further reproduce and diagnose the issue.

Once we receive the above information, we will help you further determine whether this is a system configuration, wiring, or hardware issue, and follow up accordingly. Thank you again for your patience and cooperation — please feel free to contact us if you have any other questions.

---

<div class="post-metadata">

**Author:** ![Xus](https://avatars.discourse-cdn.com/v4/letter/x/59ef9b/32.png) [@Xus](https://forum.sunfounder.com/u/Xus)\
**Post date:** [October 12, 2026, 4:36pm UTC](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671/20 "2026-10-12T16:36:49Z")

</div>

> [@SunFounder\_Moderator](#):
>
> cd ~/pidog/test  
> sudo python3 ultrasonic\_test.py

Perdón por no contestar más pronto, no he podido.

He realizado el:

sudo raspi-config y he deshablitado 1-Wire y posteriormente reiniciado,y hecho la prueba, este es el resultado:

gos@PiGos:~/pidog/test $ sudo python3 ultrasonic\_test.py  
Distance: -1 cm  
Distance: 30.08 cm  
Distance: 21.84 cm  
Distance: -2 cm  
Distance: 33.67 cm  
Distance: 33.84 cm  
Distance: 31.4 cm  
Distance: 15.92 cm  
Distance: -2 cm  
Distance: 8.66 cm  
Distance: 10.08 cm  
Distance: 11.86 cm  
Distance: 24.27 cm  
Distance: 29.68 cm  
Distance: 33.28 cm  
Distance: 33.28 cm  
Distance: 36.66 cm

Funciona!!!

Gracias!!!

[Next page](https://forum.sunfounder.com/t/ultrasonic-module-not-working-on-the-pidog/2671.md?page=2)
