
Building an Ultrasonic Parking Sensor
Measure distance with sound. An HC-SR04 ultrasonic sensor sends out a pulse of sound and times its echo, and the Arduino turns that into a distance in centimetres. Wire it to a buzzer that beeps faster as something gets closer — a car parking sensor, a reversing aid, or a doorway proximity alarm.
Зааварчилгаа
Wire the sensor and buzzer
Wire the sensor and buzzer
Push the HC-SR04 and the active buzzer into the breadboard. Wire the sensor: VCC to Arduino 5V, GND to GND, Trig to pin 9, Echo to pin 10. Wire the buzzer: + to pin 8, - to GND.
Энэ алхмын материал:
Arduino Uno R31 ширхэг
HC-SR04 Ultrasonic Distance Sensor (5-Pack)1 ширхэг
Идэвхтэй чимээлэгчийн модуль1 ширхэг
Breadboard1 ширхэг
Jumper Wires (Male-to-Male)1 баглааConnect and open the IDE
Connect and open the IDE
Plug the Arduino into your computer with the USB cable, open the Arduino IDE, and select Arduino Uno and its serial port.
Энэ алхмын материал:
USB-B Cable1 ширхэгШаардлагатай багаж:
Arduino IDE суулгасан компьютерUpload the parking-sensor sketch
Upload the parking-sensor sketch
Paste this sketch and upload. It measures the distance and beeps faster the closer an object is. Open the Serial Monitor to see the distance in centimetres.
Test and set the range
Test and set the range
Move your hand toward the sensor — the buzzer beeps faster as you get closer and nearly solid when very near. Change the 50 in the sketch to set how far away it starts reacting, and the * 6 to change how quickly the beeping speeds up.
Mount it
Mount it
Fix the sensor facing outward on a bracket or in a small box and power the Arduino from a USB power bank or a 9 V adapter. Aim it at your parking spot, garage wall or doorway.
Материал
6- Arduino Uno R3 SMD10% комисс1 ширхэг$27.06
- Ultrasonic Sensor - HC-SR0410% комисс1 ширхэг$4.16
- 1 ширхэгТүр орлуулагч
- Breadboard - Classic10% комисс1 ширхэг$9.50
- 1 баглаа$5.01
- SparkFun Cerberus USB Cable - 1.8 meter10% комисс1 ширхэг$5.69
Шаардлагатай багаж
2- Түр орлуулагч
- Breadboard - Classic10% комисс$9.50
Холбоотой загварууд
Эдгээр загварууд мэдлэг хуваалцдаг — арга техник, материал эсвэл зарчим
CC0 Нийтийн домэйн
Энэ загвар CC0 дор гаргагдсан. Та зөвшөөрөл авахгүйгээр хуулах, өөрчлөх, түгээх, ашиглах боломжтой.
Загвараар дамжуулан бүтээгдэхүүн худалдаж авч Бүтээгчийг дэмжээрэй Бүтээгчийн шимтгэл Борлуулагчаар тогтоосон, эсвэл энэ загварын шинэ хувилбар үүсгэж орлогоо хуваахын тулд өөрийн загварт холбоос болгон оруулна уу.

