Simple Arduino and HC-SR04 Example

Google+ Pinterest LinkedIn Tumblr +
Copy the sketch to your Arduino and watch the blinky lights.



HC-SR04 Ping distance sensor]
VCC to arduino 5v GND to arduino GND
Echo to Arduino pin 13 Trig to Arduino pin 12
Red POS to Arduino pin 11
Green POS to Arduino pin 10
560 ohm resistor to each LED NEG and GRD energy rail
More data at:
Original code enhancements to the Ping sketch sourced from
Some code and wiring impressed by

#outline trigPin 13
#outline echoPin 12
#outline led 11
#outline led2 10

void setup()

void loop()

Read more


Leave a Reply

%d bloggers like this: