รถเข็นของคุณว่างเปล่า!
Measuring Distance Using Ultrasonic Sensor
INTRODUCTION
In this project I’m using an ultrasonic sensor that can precisely measure the distance to show how a beep sound come out when a car is reversed. You will noticed that when the car is too near to the barrier behind the car, it will give a continuous beep sound. Let’s figure out how it works!
HARDWARE PREPARATION
This tutorial use :
You can make the hardware connection based on the diagram and table below.
CONNECTION | |
---|---|
Ultrasonic Sensor : VCC | Maker UNO: 5V |
Ultrasonic Sensor : GND | Maker UNO: GND |
Ultrasonic Sensor : Trig | Maker UNO: pin 11 |
Ultrasonic Sensor : Echo | Maker UNO : pin 12 |
SAMPLE CODE
This is the sample code used for this tutorial. Try it!
[gist https://gist.github.com/atifahsuad/3a645860332b537f8bb82ae20383bc3c/]
Reference
Thank you
Thank you for reading this tutorial and we hope it helps your project development. If you have any technical inquiry, please post at Cytron Technical Forum.