[solved] connecting ultra sonic sensor HC-SR04


#1

Hi,

I want to add an ultra sonic sensor to my gopigo.
Right now I tested a HC-SR04 sensor successfully directly with my raspberry pi (via GPIO).
Since the gopigo is blocking the GPIO’s of the Pi, it seems that I have to use the gopigo port A1 instead.
How do I have to connect my HC-SR04 sensor to port A1?
My sensor offers the following pins:
VCC
Trig
Echo
Gnd

Is there a chance to use this sensor, or do I have to buy another one?
Thanks

Vico


#2

Hey Vico,
The sensor port A1 is connected in the following way GND, VCC,A1,A1 so actually both the signal pins are connected to Analod port A1. We had tried various Ultrasonic sensors but found that the Grove Ultrasonic sensor worked the best with the GoPiGo http://www.dexterindustries.com/shop/ultrasonic-sensor/ . There are examples on the internet to convert the 4 pin sensor to a 3 pin one but we didn;t have much success with it. You can try that out if you want (just be a bit careful to wire it correctly).

-Karan


#3

Hi Karan,

thanks for your answer.
I just received the Grove ultrasonic sensor and attached it to port A1.
Using the function us_dist(15) I always get a distance of 675 cm, even if there is an object in front of it.
When I disconnect the sensor, the script delivers 0.
Do have any idea, what’s wrong?

Thanks + cheers

Vico


#4

Hi Karan,

i double checked the Grove Sensor and found a contact problem in the connecting cable - so it works now ,-)

Thanks + Cheers

Vico


#5

Good to know! Glad it’s working now!