Connect HC-SR04 Ultrasonic to gopigo


I want to connect the HC-SR04 Ultrasonic sensor to gopigo, using a grove cable.
The grove cable has these colors: black red white yellow

What is the correspondence to the ultrasonic pins:
vcc (this should be red? )
trig ?
echo ?
ground (this should be black? )

I guess i need to cut this cable on one hand to connect to the proper pins
Please let me know. Do you have any documentation about this.


Hi Marian,
We have had a customer ask us the same question a while back. Here is the link to the discussion:

Do let us know if you need any more help.


I am having a similar issue that the other forum post did not solve. I am using a Raspberry Pi 1 B. The only tutorials I found regarding connecting the HC-SR04 to the GoPiGo use an Arduino (, or connect directly to the Raspberry Pi GPIO pins (

How can I connect the HC-SR04 to the RPi 1 B even though all of the GPIO pins are used up by the GoPiBo board? I could not find any tutorials on how to convert the 4 pins to 3 pins directly into the GoPiGo a1 port, only to Arduino.

Hi glasermrk,
The pins on the Grove A1 and D10 ports are shorted together so you can use a grove cable and connect the white and yellow wires to the Echo and Trig pins to connect the sensor the Grove port. We have tried this before and it works on some sensors and not on some other sensors. The Grove ultrasonic sensor works the best with the GoPiGo. To connect the ultrasonic sensor to the Raspberry Pi header you’ll have to solder headers to the extra GPIO footprint on the GoPiGo and then connect the sensor to it.