This project demonstrates using LavinMQ for an IoT live demo at conferences. It contains two main parts:
arduino/
→ Arduino sketches (C/C++ code for the IoT device).landingpage/
→ A simple landing page built with Bootstrap, CSS, JavaScript, and HTML.
Iot-demo-page/ ├── arduino/ # Arduino sketches (C/C++ code for IoT device) ├── landingpage/ # Landing page (Bootstrap, CSS, JS, HTML) ├── MQTT_subscriber.py # MQTT subscriber script (Python) └── README.md # Project documentation
- C
- C++
- CSS
- JavaScript
- HTML
- Python
- Arduino board
- DHT temperature & humidity sensor
- USB-C cable
- Jumper wires (red = power, black = ground, yellow = data)
- Arduino IDE
- Python 3.x
-
Connect the DHT sensor to the Arduino board with jumper wires:
- Red → Power
- Black → Ground
- Yellow → Data
-
Connect the Arduino to your PC with a USB-C cable.
-
Open the Arduino sketch from the
arduino/
folder in Arduino IDE.- Make sure to open and upload the entire sketch folder (not just a single
.ino
file). - Select the correct board from the Board menu.
- Upload the sketch to the board.
- Make sure to open and upload the entire sketch folder (not just a single
-
Open Serial Monitor from Arduino IDE.
- Unplug and replug the USB-C cable.
- The IP address of the board will appear.
-
On your PC, connect to the IoT access point (Demo_wifi)
-
Open a browser and go to: http://
-
A mini portal will open:
- First, enter and save MQTT details (create a LavinMQ instance on CloudAMQP).
- Then go back, enter and save your WiFi details.
- Close the portal and wait 1 minute for the IoT device to connect to your WiFi.
- Once connected,
Demo_wifi
will disappear from available networks. - The device will start publishing sensor data to LavinMQ.
👉 WiFi and MQTT credentials are stored on the board, so next time you just need to power it on.
You can consume the messages in two ways:
- Start a local HTTP server from the
landingpage/
folder:
cd landingpage
python3 -m http.server 8000
-
Open a browser and go to: http://localhost:8000/index.html
-
View temperature, humidity, and trend charts in the page
Run the Python MQTT subscriber from the project root:
python3 MQTT_subscriber.py
This will print temperature and humidity readings directly in your terminal.
- Ideal for conference demonstrations.
- Shows how IoT devices publish sensor data via MQTT → LavinMQ.
- Provides both web visualization and terminal output.