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

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ค. 2024
  • 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

  • @SideStreetLeather
    @SideStreetLeather 11 หลายเดือนก่อน

    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.

  • @Europayacht
    @Europayacht หลายเดือนก่อน

    Not one word to little nor to many. 100% on the spot. Thanks a lot!!!

  • @strugglebusbonsai
    @strugglebusbonsai ปีที่แล้ว +1

    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!

  • @brendanowen7563
    @brendanowen7563 ปีที่แล้ว +2

    Thank you for such a clear awesome video. It was very well set out.

  • @grottyboots
    @grottyboots ปีที่แล้ว

    Excellent video! I look forward to more!

  • @KeithHeilner
    @KeithHeilner 4 หลายเดือนก่อน

    Thumbs Up! New Subscriber. Fantastic tutorial. Direct and to the point.

  • @marelyruiz1321
    @marelyruiz1321 หลายเดือนก่อน

    Thank you, you are awesome and your tutorial is amazing.

  • @edinetgrunhed6000
    @edinetgrunhed6000 11 หลายเดือนก่อน

    thank u i learn a lot thank any books from your channel

  • @temyraverdana6421
    @temyraverdana6421 ปีที่แล้ว

    Thanks a lot for this amazing tutor

  • @gripperrod
    @gripperrod 9 หลายเดือนก่อน +1

    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

  • @LegalizeAdulthood
    @LegalizeAdulthood ปีที่แล้ว +7

    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.

  • @JoseMartinez-ls8mj
    @JoseMartinez-ls8mj 2 หลายเดือนก่อน

    Thanks

  • @timwolf6885
    @timwolf6885 ปีที่แล้ว

    I thought you were going to release a video about using the WiFi capabilities of the Pico W in C?

  • @zf3d
    @zf3d 3 หลายเดือนก่อน

    I vote to see similar project with LoRa such as TTGO :)

  • @iNireus
    @iNireus ปีที่แล้ว

    Have you thought how you could do this with Alexa?
    Alexa replacing the pi part, on voice asking for temperature etc

  • @alexpr0gressive
    @alexpr0gressive 10 หลายเดือนก่อน

    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.

  • @franciscosousa3730
    @franciscosousa3730 3 หลายเดือนก่อน

    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?

  • @hieuao2509
    @hieuao2509 6 หลายเดือนก่อน

    What about soil moisture sensor ? It’s not have library how i can do it

  • @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

  • @terlumunjoseph6779
    @terlumunjoseph6779 6 หลายเดือนก่อน

    hi i dont own a rapberry what other ways can i run a server instead of using raspberry

  • @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 ;-)

  • @k2nnethtan949
    @k2nnethtan949 ปีที่แล้ว

    Do you have micropython version?

  • @codecraft-studio
    @codecraft-studio 5 หลายเดือนก่อน

    can I use esp8266 instead of esp32

  • @AmitSharma-bm2qj
    @AmitSharma-bm2qj ปีที่แล้ว

    Please make this architecture with ESP IDF and accelerometer sensor

  • @norberthartmann5075
    @norberthartmann5075 4 หลายเดือนก่อน

    nicht anzusehen - youtube baut jedes bild einzeln auf ..... :-( :-(

  • @AmitSharma-bm2qj
    @AmitSharma-bm2qj ปีที่แล้ว

    Make this project using ESP IDF