0% found this document useful (0 votes)
26 views

Sending Data From HC-SR04 To Thing Speak

Collecting the data from the sensor and sending it to Things- peak server.

Uploaded by

Santhosh K.M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Sending Data From HC-SR04 To Thing Speak

Collecting the data from the sensor and sending it to Things- peak server.

Uploaded by

Santhosh K.M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab Report 2

Interfacing HC-SR04, sending data to Thing Speak and controlling Servo via
website.

Experiment 2 - Collecting the data from the sensor and sending it to Things-
peak server.

Objective

The distance measured is collected from the sensor and the aim is to now send the data to ThingSpeak
server.

Procedure

• First connect the VCC and GND pins of the sensor with the respective terminals of the ESP32.
• We have to connect the trigger and echo pin of the sensor with GPIO pins ESP32 . We used the
pin 5 as trigger and pin 18 as the echo.

• Connect to the ThingSpeak server through mqtt protocol by using the username and password.
• We have to make a channel on the website where the data can be visualised on a graph
• Since we are writing on the field of the channel the write API keys are included in the code.
• The code is then loaded on the microcontroller and output is then displayed on the serial monitor.

Figure 1: Circuit diagram

1
Observation

The data collected is send to the server based through mqtt protocol and is displayed on the screen
through a graph. The thingspeak has by default a delay of 15 seconds on plotting the data on the screen.

Conclusion

The data is sent using the MQTT protocol to the ThingSpeak server which acts a database and allows
interoperability as we can use the data from various sensors at one place and use the data.

You might also like