Reconnaissance with NodeMCU and Ultrasonic Sensor (HC-SR04) with real time notifications from https://ntfy.sh
This project utilizes an ESP8266 microcontroller and an ultrasonic sensor to detect nearby objects. When an object is detected within a specified range, it sends an alert message over Wi-Fi.
- Arduino IDE
- ESP8266WiFi library
- ESP8266HTTPClient library
- WiFiClientSecure library
- Clone this repository.
- Open the project in Arduino IDE / VS CODE.
- Install the required libraries if not already installed:
- ESP8266WiFi
- ESP8266HTTPClient
- WiFiClientSecure
- Update the following variables in
main.cpp
(/src):ssid
: Your Wi-Fi network name.password
: Your Wi-Fi password.- Adjust
echoPin
andtrigPin
if your sensor is connected to different GPIO pins. - Adjust
http.begin
andpayload
with your ntfy.sh topic and your message.
- Upload the sketch to your ESP8266 board.
- Open the Serial Monitor to view sensor readings and debug messages.
- Ensure the board connects to Wi-Fi successfully.
- Observe the board's behavior when objects are detected within 20 cm of the sensor.