Hello there,
I try to use the HC-SR04 ultrasonic sensor with the 40-pin GPIO extension header on the Jetson Nano. I didn’t find any guides at the internet, so because I’m a complete beginner with pins and co., I would be glad about any kind of help!
So for those who don’t know: this is the HC-SR04 ultrasonic sensor, originally build for Arduino:
It has four pins: VCC (for power 5V), GND (Ground), Trig and Echo (for signals). So first: How do I connect it? I have female to female jumper cables, can I connect the sensor directly to the Jetson with them? And which pins do I have to connect it with? There are 2 pins for 5V, 8 for GND and lots of others, so I don’t know which ones to use.
I have to communicate with the sensor via Python, so I can simply use the Jetson.GPIO-library, right? Or do I have to setup some communication systems like I2C or UART first? And if I do, how?
I’m also wondering about how the commands in Jetson.GPIO work. Can somebody link a guide or something to it? So far I know, I have to send a HIGH signal on the Trig pin and wait for a HIGH from Echo to come back. Then from measuring the time difference, you can calculate the distance. How can I accomplish this?
Thanks in advance!