Hi, I received a Pico-4WD-v2 as a present (it’s awesome!) and just finished assembling it.
Everything seems to work as expected and I can control it through the app, except the ultrasonic sensor seems to be getting no input at all.
I tried replacing the cable to no avail.
I’m good with software but complete beginner with hardware.
How do I proceed to find and fix the problem?
Do you mean the ultrasonic sensor is not working properly?
- Please confirm the wiring is correct according to the assembly diagram
- Please follow the tutorial to run the code and provide the printed information to us.
5. Detecting Distance — SunFounder pico_4wd_car documentation
Yes the Ultrasonic sensor is not working properly.
I took extra care into installing it according to instructions.
Yellow wire is in pin 6, White wire in pin 7.
I followed the tutorial and run ultrasonic.py
but all I get is a reading of -0.034
no matter what I put in front of it.
The sonar.py
script moves the servo as expected but always gives [1, 1, 1, 1, 1, 1, 1]
You can try to modify the pinout of the code (as shown in the picture) and change the wiring to yellow wire on pin 8 and white wire on pin 9.
If you modify the wiring pins and code pins, the sensor still does not work, the sensor module may be damaged, we will arrange for a new sensor to be sent to you.
I moved the wires to pins 8 and 9, modified the code accordingly and ran the test again, the reading is still a constant -0.034
.
Since we are on the Chinese Dragon Boat Festival holiday, we will get back to you on the 25th. We are sorry for the inconvenience caused to you.
Any news on this?
Let me know
I’m sorry to reply to you so late.
It is possible that the ultrasonic sensor is damaged, we suggest replacing it with a new one.
Please contact our after-sales department at service@sunfounder.com to have a new ultrasonic sensor reissued.
Hi, picar-x: in ezblock it was misreading the distance at test ultrasonic module
I changed the values in the code from D0 and D1 to D2 and D3 and it started reading the values normally
Right, because our assembly wiring is wired to D2 and D3.
The APP example is the default D0 and D1 codes, so you just need to change D0 and D1 to D2 and D3.