A smart IoT-based distance and obstacle detection system using the HC-SR04 Ultrasonic Sensor, ESP32 Microcontroller, and SG90 Servo Motor. The project leverages ThingSpeak for cloud data visualization and a Flutter-based mobile app for real-time monitoring, making it ideal for IoT applications such as distance measurement, obstacle detection, and smart home automation.
This project integrates an ultrasonic sensor with an ESP32 microcontroller to measure distances and angles. The data is uploaded to ThingSpeak, enabling cloud-based analytics and remote monitoring. A Flutter-based mobile app provides users with real-time visualization of sensor readings locally.
Key applications include:
- Accurate Distance Measurement: Uses the HC-SR04 Ultrasonic Sensor.
- Motor Control: Rotates the SG90 Servo Motor based on sensor readings.
- Cloud Integration: Real-time data upload to ThingSpeak for remote visualization.
- Mobile App: Intuitive real-time data visualization using a Flutter-based application.
- IoT-Ready Design: Compact, efficient, and scalable for various use cases.
- Arduino IDE: For programming the ESP32 and sensor control.
- ThingSpeak: IoT analytics platform for data storage and visualization.
- Flutter: For creating a user-friendly mobile application interface.
- ESP32: Microcontroller for data processing and communication.
Pin | Connection to ESP32 |
---|---|
VCC | 5V |
GND | GND |
TrigPin | GPIO 5 |
EchoPin | GPIO 18 |
Wire Color | Connection to ESP32 |
---|---|
Red (VCC) | 3.3V |
Brown (GND) | GND |
Orange (Control) | GPIO 16 |
- Ensure the ESP32 is powered via USB or an external source (e.g., power bank).
- Servo motors may require additional power to avoid overloading the ESP32.
- Assemble the hardware components as per the circuit connections.
- Verify connections to avoid short circuits.
- Create an account on ThingSpeak.
- Set up a new channel and note down the Channel ID and Write API Key.
- Clone this repository.
- Open the provided Arduino code in the Arduino IDE.
- Update the code with your Wi-Fi credentials and ThingSpeak API Key.
- Upload the code to the ESP32 using a USB connection.
- Download the mobile app from the repository link or compile it using Flutter.
- Launch the app and start monitoring sensor data in real time.
- View real-time and historical data on the ThingSpeak dashboard.
- Analyze data trends for distances and angles.
- Intuitive and interactive real-time sensor data display.
- Easily monitor environmental changes through the app.
- AI Integration: Adding predictive algorithms for obstacle detection.
- Enhanced Visualization: Web-based dashboards for broader access.
- Multiple Sensor Support: Integrating additional sensors for extended functionality.
- Energy Optimization: Improving power efficiency for long-term deployments.
This project is licensed under the MIT License. See the LICENSE
file for more details.
Contributions are welcome! Feel free to open an issue or submit a pull request.
For inquiries or feedback, reach out to:
[Jashanpreet Singh]
[[email protected]]