- This repository contains the code for an Android application that interacts with an IoT system using an ESP32-C3 microcontroller. The app allows users to control 220V lights remotely and monitor temperature using a DS18B20 sensor via MQTT over TCP.
- Demo Video Link
- Remote control of 220V lights via MQTT
- Real-time temperature display from DS18B20 sensor
- User-friendly interface
-
Hardware:
-
Software: Android (Java/Kotlin), ESP-IDF Visual Studio Code Extension, MQTT Explorer
-
Setting Up Mosquitto MQTT Broker on Google Cloud's Compute Engine:
- Create a virtual machine (VM) on Google Cloud Platform with Ubuntu 20.04 Server.
- Connect to your VM using SSH.
- Install Mosquitto MQTT Broker:
sudo apt update sudo apt install -y mosquitto mosquitto-clients
- Enable Mosquitto to start on system boot and start the Mosquitto service:
sudo systemctl enable mosquitto sudo systemctl start mosquitto
- Verify that Mosquitto is running:
sudo systemctl status mosquitto
-
Wiring Diagram:
-
Installing VS Code and ESP-IDF Extension:
- Download Visual Studio Code
- Follow the instructions in the following repository to install the ESP-IDF extension: vscode-esp-idf-extension.
- Clone the following repository to set up ESP32-C3: IoT-ESP32-C3-MQTT-TCP-RemoteLed-DS18B20
git clone https://github.com/toandevnguyen/IoT-ESP32-C3-MQTT-TCP-RemoteLed-DS18B20.git
- Open the project in VS Code.
- Configure MQTT broker settings in the application code.
- Build and flash the code to the ESP32-C3 module.
-
Mobile App Setup:
- Clone the repository: RemoteLights220V-DS18B20
git clone https://github.com/toandevnguyen/RemoteLights220V-DS18B20.git
- Open the project in Android Studio.
- Configure MQTT broker settings in the application code.
- Build and run the app on an Android device.
- Here are some screenshots of the app interface:
- Clone the repository: RemoteLights220V-DS18B20
- Use the app to connect to the IoT system.
- Control the 220V lights and view real-time temperature data.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.