Ultrasonic Sensor Circuit Diagram
This circuit can be very confusing, so be careful! You can see the labels above each pin on the sensor:
- VCC = 5V
- Trig = the GPIO pin you assigned to your trig variable
- Echo = the GPIO pin you assigned to your echo variable
- GND = Resistor then Ground