How to Monitor Ultrasonic Distance With ESP8266 and AskSensors IoT Cloud

About: IoT Maker, co-founder of asksensors.com

This instructable presents how to monitor the distance from an object using ultrasonic HC-SR04 sensor and ESP8266 node MCU connected to the AskSensors IoT cloud.

Step 1: Material We Need

We will need the following Hardware:

  • ESP8266 Node MCU
  • Ultrasonic HC-SR04 Sensor
  • Bread Board
  • Jumper wires
  • Micro USB cable

Step 2: Build Your Hardware

Connect the ultrasonic sensor to the ESP8266 node MCU:

  • HC-SR01 TRIG pin to ESP8266 D1 pin
  • HC-SR01 ECHO pin to ESP8266 D2 pin
  • HC-SR01 VCC pin to 5V (you can also try with 3.3V)
  • Ground to ground

Step 3: AskSensors Setup

Step 4: Download the Code

Download the code from the AskSensors github Page.

Decompress it and fill the following informations:

const char* wifi_ssid = "....................";             // SSID
const char* wifi_password = "....................";         // WIFI 
const char* apiKeyIn = "..................";      // API KEY IN

Step 5: Run the Code

Connect the ESP8266 to your computer and upload the code.

Now, Go to your AskSensors dashboard.

Open your sensor page and add a new graph to visualize your data stream in real time as shown in the enclosed figure.

Share

Recommendations

  • Comfort Food Challenge

    Comfort Food Challenge
  • Safe and Secure Challenge

    Safe and Secure Challenge
  • Epilog X Contest

    Epilog X Contest

Discussions