https://github.com/migueltc13/hc-sr04
Basic sensor alarm system made with ESP8266 and HC-SR04.
https://github.com/migueltc13/hc-sr04
arduinoide blynk blynk-arduino blynk-mobile blynk-server customizable distance-sensor esp8266 esp8266-arduino esp8266-projects esp8266wifi hc-sr04 hc-sr04-ultrasonic-sensor opensource sublime-text-3 vscode
Last synced: 13 days ago
JSON representation
Basic sensor alarm system made with ESP8266 and HC-SR04.
- Host: GitHub
- URL: https://github.com/migueltc13/hc-sr04
- Owner: migueltc13
- License: gpl-3.0
- Created: 2021-07-04T23:51:53.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-26T11:40:13.000Z (about 2 years ago)
- Last Synced: 2025-04-14T18:09:46.931Z (13 days ago)
- Topics: arduinoide, blynk, blynk-arduino, blynk-mobile, blynk-server, customizable, distance-sensor, esp8266, esp8266-arduino, esp8266-projects, esp8266wifi, hc-sr04, hc-sr04-ultrasonic-sensor, opensource, sublime-text-3, vscode
- Language: C++
- Homepage:
- Size: 950 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# HC-SR04 Sensor Alarm
***Distance detection system made with HC-SR04 Ultrasonic Sensor and micro-controller ESP8266.
***
- Circuit controlled by Wi-Fi with the Blynk app/website.
- Trigger distances are customizable in centimeters (cm).
- Delay times are customizable in milliseconds (ms).Still in progress...
---
A special thanks to the ***ESP8266 Community*** for the board driver for the ESP8266 in Arduino IDE and also to ***Volodymyr Shymanskyy*** for the Blynk library used in this project for Wi-Fi connectivity.
---
## Installation
You can use multiple IDEs, such as Arduino IDE (Genuino), to transfer the code to the micro-controller ESP8266.
There are also plugins to use in IDEs like VSCode, Sublime-text, etc.After compiling the .ino main file the code can be sent to the ESP and the installation/programming phases are over.
---
## Components
- 1x - ESP8266
- 1x - HC-SR04
- 1x - LED*
- 1x - 1k Resistor*
- 4x or 6x(*) - Jumper Wires(*) Optional - Can be replaced with other components.
---
### Circuit Sketch
![]()
---
### Issues & Solutions
***a) Port closed or access denied in the USB connection.***
a.1) There's a shell file "ttyUSB0.sh", located in the "src" dir made to open the USB0 port to enable the ESP connection, fixing issue ***a)***.
That executes the following command:
```bash
sudo chmod -R 777 /dev/ttyUSB0
```
To run simply type:```bash
./src/ttyUSB0.sh
```Feel free to modify it to your respective USB port.
---
***Or:***
a.2) You can run the following commands:
```bash
groups
```To see all available groups type:
```bash
compgen -g
```Most of them are self-explanatory, in this case, you want to add yourself to either the tty group or dial-out, which you would do by:
```bash
sudo usermod -a -G tty
```Then you should have access to tty without the use of sudo.
---
### TODO
- [x] Sketch
- [ ] Config file
- [ ] Blynk LED
- [ ] Blynk screenshot