/esp32_mqtt_pms5003

Contains Code and Solutions for Internet of Things.

Primary LanguageCOtherNOASSERTION

ESP32 MQTT PMS5003

The Internet of Things (IoT) course at the Berliner Hochschule für Technik deals with various aspects and technologies to create the implementation of sensors, devices and software applications for a resource-saving, interoperable system landscape. With this in mind, the focus in the practical education is set on MQTT. MQTT is a communication protocol standardized by OASIS, especially for IoT applications. In the following, the use of MQTT is realized experimentally by means of a particle sensor and a microcontroller. The network and MQTT broker required for MQTT are provided by the laboratory and are not the subject of this repository. The aim is to read out the particle sensor data at regular intervals and send it to the broker using a separate topic.

Contributors

Contributor Alias Contact
Merlin Seela IAmAMerlin Twitch
Thomas Zimmermann Zimpto

Dependencies

The folder dustlib contains code written by Aleksander Kurczyk. We are not owner of this code in any form or do we want to be. We included the code here for simplicity. All credit goes to the original creator.

The project is based on mqtt5 an example project from esp-idf.

For Licensing check out the individual code repositories as well as our License.

How to use this repository

Obtain the Source Code

You can acquire the Source Code by simply installing git, opening a terminal and executing git clone https://github.com/merlinseela/ESP32_MQTT_PMS5003.git. It will download the source code.

Acquire Required Software and Hardware

Note: This is not binding but if you decide to get other Software and/or Hardware the Code most likely will not work without adjustments.

This project was build using Visual Studio Code and ESP-IDF Extension by Espressif.

Hardware:

Instructions

  1. Setup the Hardware as shown in this map.

Hardware-Schema

Note: It is assumed you have a working MQTT-Broker running.

  1. Download and install Visual Studio Code.
  2. Open Visual Studio Code.
  3. Open the Extension Tab and search for ESP-IDF. Install the Extension.
  4. In the Menu choose File -> Open Folder. Navigate to the Source Code Folder you cloned earlier and open it.
  5. Open the Command Palette in VS-Code and Search for ESP-IDF: SDK Configuration Editor and select the corresponding entry. A new Tab should open. (Note:May take a while due to server configuration.)
  6. In the Configuration search with keyword wifi and enter the WiFi SSID and WiFi Password which hosts the MQTT Broker.
  7. In the Configuration search with keyword broker and enter the Broker URL of you MQTT-Broker.
  8. Assuming you already connected your ESP open the command Palette again, search for ESP-IDE: Select Port to Use and select the right port.
  9. Open the Command Palette again and search for ESP-IDF: Build, Flash and Start a Monitor on your Device and execute it. Note: If asked which Protocol to use, select UART.

If everything was setup right the application should be build, flashed and monitored on the PC while also sending data via MQTT to your Broker.

Happy Coding!