Giter Site home page Giter Site logo

noamv7 / iot-ultrasonic-sensor-project Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 12.85 MB

Arduino and ESP8266 project measuring distance with ultrasonic sensor, connecting to AWS IoT and Arduino IoT Cloud for remote monitoring and control.

C 15.98% C++ 84.02%
arduino arduinocloud aws esp8266 ghidra grafana iot micropython mqtt timestream ultrasonic-sensor

iot-ultrasonic-sensor-project's Introduction

Project README

Overview

This project consists of two Arduino sketches for distance measurement using an ultrasonic sensor, with data communication facilitated through AWS IoT and Arduino IoT Cloud. The main.ino sketch is designed for AWS IoT, while the Untitled_mar02a.ino sketch is tailored for Arduino IoT Cloud.

AWS IoT (main.ino)

The AWS IoT sketch connects an ESP8266 to WiFi, synchronizes time using NTP, and publishes distance data to AWS IoT using MQTT. The distance is measured by an ultrasonic sensor (HC-SR04), and the AWS IoT platform is utilized for remote monitoring.

Arduino IoT Cloud (Untitled_mar02a.ino)

The Arduino IoT Cloud sketch employs an ultrasonic sensor to measure distance, controlling an LED based on the measured distance. Additionally, it communicates with the Arduino IoT Cloud to update variables such as ultraSonic, led, and message. The sketch includes functions generated by the Arduino IoT Cloud Thing for handling variable changes from the IoT Cloud Dashboard.

Prerequisites

AWS IoT (main.ino)

  1. Arduino IDE with ESP8266 board support.
  2. Required libraries: ESP8266WiFi, WiFiClientSecure, PubSubClient, ArduinoJson.
  3. AWS IoT account with endpoint, certificates, and Thing Name configured.

Arduino IoT Cloud (Untitled_mar02a.ino)

  1. Arduino board compatible with Arduino IoT Cloud.
  2. Arduino IoT Cloud account - Arduino IoT Cloud.
  3. Required libraries installed using the Arduino Library Manager.

Hardware Setup

AWS IoT (main.ino)

Connect the ultrasonic sensor as per the defined TRIGGER_PIN and ECHO_PIN in the sketch.

Arduino IoT Cloud (Untitled_mar02a.ino)

Connect the ultrasonic sensor and LED according to the specified pins in the sketch.

Configuration

AWS IoT (main.ino)

  1. Modify the secrets.h file with WiFi credentials, AWS IoT endpoint, and certificates.
  2. Adjust time zone, ultrasonic sensor pins, and MQTT topics as needed in main.ino.

Arduino IoT Cloud (Untitled_mar02a.ino)

  1. Open the thingProperties.h file and update it with your IoT Cloud credentials and Thing properties.
  2. Set up the Arduino IoT Cloud Dashboard with widgets for message, ultraSonic, and led variables.

Usage

  1. Upload the respective sketch to your Arduino or ESP8266 board.
  2. Monitor the serial output for debugging information.
  3. Use the IoT Cloud Dashboards for AWS IoT and Arduino IoT Cloud to interact with variables and observe real-time changes.

Troubleshooting

If encountering issues:

  • AWS IoT: Check WiFi connection, AWS IoT credentials, and certificates.
  • Arduino IoT Cloud: Verify hardware connections, IoT Cloud credentials, and library installations.

Refer to official documentation and community forums for assistance.

Additional Notes

  • AWS IoT: AWS IoT platform is utilized for remote monitoring and MQTT communication.
  • Arduino IoT Cloud: LED control and variable updates based on ultrasonic sensor measurements.
  • Customize sketches based on requirements.

Note: Basic familiarity with Arduino, ESP8266, AWS IoT, and Arduino IoT Cloud is assumed. Refer to respective documentation for assistance.

iot-ultrasonic-sensor-project's People

Contributors

noamv7 avatar

Watchers

 avatar

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.