Simple ESP32 IoT Sensor Node Tutorial: WiFi Enabled MQTT Sensor Data Node

  Переглядів 43,169

Learn Embedded Systems

Learn Embedded Systems

День тому

This tutorial will create an internet of things sensor node based on an ESP32 development board. This node will use the MQTT protocol to send sensor data over WiFi to a Raspberry Pi based IoT server. This tutorial will allow you to collect any kind of sensor data you like, send it over your network to a MQTT server and visualise it on a Grafana dashboard.
This system consists of a series of sensor nodes that send sensor data in a JSON message over the network to a Raspberry Pi via MQTT. MQTT is a network protocol where a client pushes data to a broker, such as mosquitto, and the broker pushes that data to any client that has subscribed to that topic. A topic categorises the data that is sent. Any client that is subscribed to "home/sensor" will be forwarded this MQTT message containing the sensor data. On the Raspberry Pi server, NodeRED will subscribe to this topic, interpret the json message data and then send the data to a database to be stored and used. InfluxDB will store all the sensor data. Then a Graphana front end will query the database in order to display the data we want to see and do a whole host of other things. This is all explained in our Raspberry Pi IoT server tutorial linked below.
Helpful links:
Source code: learnembeddedsystems.co.uk/es...
Raspberry Pi IoT Server Tutorial: • Raspberry Pi IoT Serve...
ESP32 Dev Board: s.click.aliexpress.com/e/_DcG...
Timestamps
00:00 Introduction
00:41 System Overview
01:40 How does this work?
02:58 Payload format
03:16 Required libraries
03:36 Hardware setup
03:51 Arduino IDE implementation
04:28 Programming
10:00 Conclusion
You can find more embedded systems tutorials and projects on our website learnembeddedsystems.co.uk
-- Equipment we use regularly --
The following links are affiliate links where we may make a small percentage on qualifying sales through these links. Use the respective UK or US links listed.
Budget Soldering Iron: UK: amzn.to/3pQpvUu US: amzn.to/3bBawIJ
Breadboards: UK: amzn.to/3solZCe US: amzn.to/3dGsHiS
Jumper Cables: UK: amzn.to/37JfToi US: amzn.to/3r384S9
Camera: UK: amzn.to/3qKLwFr US: amzn.to/3pK0V7C
Lens: UK: amzn.to/380lQxp US: amzn.to/3knH3WL
Tripod: UK: amzn.to/37H0Nzw US: amzn.to/3byKHsV
All videos and tutorials on this channel and mentioned websites are for educational purposes only.

КОМЕНТАРІ: 31
@Europayacht
@Europayacht 10 днів тому
Not one word to little nor to many. 100% on the spot. Thanks a lot!!!
@SideStreetLeather
@SideStreetLeather 10 місяців тому
Thanks for the ESP32 video series. This is making the temp and weight measuring the logging of my school's beehives much easier to set up.
@strugglebusbonsai
@strugglebusbonsai Рік тому
This is an awesome tutorial! I'm developing a system that monitors seeds that are planted and this is exactly what I needed. Thank you s much!
@marelyruiz1321
@marelyruiz1321 7 днів тому
Thank you, you are awesome and your tutorial is amazing.
@grottyboots
@grottyboots Рік тому
Excellent video! I look forward to more!
@brendanowen7563
@brendanowen7563 Рік тому
Thank you for such a clear awesome video. It was very well set out.
@KeithHeilner
@KeithHeilner 3 місяці тому
Thumbs Up! New Subscriber. Fantastic tutorial. Direct and to the point.
@temyraverdana6421
@temyraverdana6421 Рік тому
Thanks a lot for this amazing tutor
@edinetgrunhed6000
@edinetgrunhed6000 10 місяців тому
thank u i learn a lot thank any books from your channel
@LegalizeAdulthood
@LegalizeAdulthood Рік тому
Since you've got the sensor and the server in the same room (and connected by USB cable), a good follow-on video would be showing how to connect the BME680 directly to the Pi and use a daemon to periodically read the sensor via the Pi's header pins.
@LearnEmbeddedSystems
@LearnEmbeddedSystems Рік тому
Will look into it! Cheers for the suggestion :)
@gripperrod
@gripperrod 9 місяців тому
Great video, it worked for me, I had a couple of issues, firstly I was just testing this with analogue input from a pin and some of the ESP32 analogue pins are disabled when wifi is operational. That took a while to sort! The only other issue was that I somehow didn't connect the nodes in node red, once that was sorted worked fine. I'll be using this for a battery operated weather station powered by a rather large 10w solar panel (since I want it on all the time) and a lipo . I've used Andreas Spiess's design with a power path. I'll be using the data in Home Assistant and also want to design a wall mounted retro display to show current weather with an arrow for wind direction etc. It's all a bit of a mammoth project since I knew very little when I started, this video has been a big help though.
@LearnEmbeddedSystems
@LearnEmbeddedSystems 9 місяців тому
I'm happy that this video played a part in your project! Best of luck with your project and would be interested to hear how the retro display turns out!
@zrxav
@zrxav Рік тому
Excellent video, thank you very much for your hard work! Could you please consider doing this IoT node but written in a Python-based enviroment? Such as Circuit python which already has Adafruit's libraries for most of the ICs/boards and protocols you're using or would you be so kind to point me towards a documentation that helps me make the JSON doc you've made in python? I have to be honest I've been following along your IoT server + IoT Node videos using an UnexpectedMaker S3 and I've been doing okay, I've collected the data from the sensors, connected to the wifi and published a message to the broker, but the only idea I have to submit the Json file is to create a dictionary, but afterwards I'm not sure I'll be able to publish it correctly nor I know how to monitor the Mosquitto container to see if the generic print I published is sitting where it should be, please help As for the server side is pretty straight forward and I just have to make sure the information is getting correctly to sensor_data DB before finishing up the Grafana setup
@timwolf6885
@timwolf6885 Рік тому
I thought you were going to release a video about using the WiFi capabilities of the Pico W in C?
@iNireus
@iNireus Рік тому
Have you thought how you could do this with Alexa? Alexa replacing the pi part, on voice asking for temperature etc
@JoseMartinez-ls8mj
@JoseMartinez-ls8mj Місяць тому
Thanks
@zf3d
@zf3d 2 місяці тому
I vote to see similar project with LoRa such as TTGO :)
@alexpr0gressive
@alexpr0gressive 9 місяців тому
I would like to use the netsgpclient to collect data from my solar micro inverter. How can I have another client from netsgpclient to receive serial data via an lc12s 2.4ghz module? The two programs work by themselves but how can I merge them? I need a wifi mqtt serial gateway I guess.
@hieuao2509
@hieuao2509 5 місяців тому
What about soil moisture sensor ? It’s not have library how i can do it
@franciscosousa3730
@franciscosousa3730 2 місяці тому
Am I able to create my own IoT app (web app in my case) and connect it to the MQTT server? If so, what programming language should I use to do it?
@gregruthenium
@gregruthenium Рік тому
Can you please do a tute that includes both BME680 and SPS30 sensors with Node -Red and Grafana
@LearnEmbeddedSystems
@LearnEmbeddedSystems Рік тому
I don't currently have any SPS30 sensors but I'll look into it.
@gregruthenium
@gregruthenium Рік тому
@@LearnEmbeddedSystems How about If I send you one ;-)
@sanjeevjoshi6441
@sanjeevjoshi6441 Рік тому
it worked fine for a few hours and then started returning this error ( rc=-2Attempting MQTT connection...failed ) what might be the issue
@k2nnethtan949
@k2nnethtan949 Рік тому
Do you have micropython version?
@terlumunjoseph6779
@terlumunjoseph6779 6 місяців тому
hi i dont own a rapberry what other ways can i run a server instead of using raspberry
@codecraft-studio
@codecraft-studio 5 місяців тому
can I use esp8266 instead of esp32
@norberthartmann5075
@norberthartmann5075 3 місяці тому
nicht anzusehen - youtube baut jedes bild einzeln auf ..... :-( :-(
@AmitSharma-bm2qj
@AmitSharma-bm2qj Рік тому
Please make this architecture with ESP IDF and accelerometer sensor
@AmitSharma-bm2qj
@AmitSharma-bm2qj Рік тому
Make this project using ESP IDF
Raspberry Pi IoT Server Tutorial: InfluxDB, MQTT, Grafana, Node-RED & Docker
12:32
Learn Embedded Systems
Переглядів 195 тис.
Easy Home Server Dashboard - Cleanly Organise Your Homelab!
6:04
Learn Embedded Systems
Переглядів 3,3 тис.
Não pode Comprar Tudo 5
00:29
DUDU e CAROL
Переглядів 68 млн
What is an MQTT Broker Clearly Explained
10:11
Opto Video
Переглядів 184 тис.
How to Get Started with MQTT
13:38
Opto Video
Переглядів 391 тис.
#419 ESP32 Audio Tutorial with lots of examples
13:48
Andreas Spiess
Переглядів 220 тис.
12 Useful & Interesting ESP32 Projects for Beginners!
9:41
ToP Projects Compilation
Переглядів 563 тис.
ESP32 Guide 2024 | Choosing and Using an ESP32 Board
41:06
DroneBot Workshop
Переглядів 197 тис.
Monitor Room Temperature Remotely with Arduino & MQTT
15:23
Gary Explains
Переглядів 19 тис.
MicroPython - MQTT tutorial on ESP32
31:44
Bhavesh Kakwani
Переглядів 9 тис.