Coder Social home page Coder Social logo

migueltc13 / hc-sr04 Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 973 KB

Basic sensor alarm system made with ESP8266 and HC-SR04.

License: GNU General Public License v3.0

C++ 98.51% Shell 1.49%
arduinoide blynk blynk-arduino blynk-mobile blynk-server customizable distance-sensor esp8266 esp8266-arduino esp8266-projects

hc-sr04's Introduction

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

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:

sudo chmod -R 777 /dev/ttyUSB0 

To run simply type:

./src/ttyUSB0.sh

Feel free to modify it to your respective USB port.


Or:

a.2) You can run the following commands:

groups

To see all available groups type:

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:

sudo usermod -a -G tty <USERNAME>

Then you should have access to tty without the use of sudo.


TODO

  • Sketch
  • Config file
  • Blynk LED
  • Blynk screenshot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.