The problem
Most homes still switch lights, fans and appliances one wall switch at a time. The MQTT Smart Home Control Android App with Room-wise Device Dashboard replaces that walk-around routine with one phone screen that groups every device by room and switches it over MQTT. Without a room-wise view, a single flat device list becomes confusing once a home passes about 10 devices: the bedroom fan sits next to the kitchen geyser, names collide, and switching the wrong load becomes easy. Separate remote apps per device make it worse, with different logins, different interfaces and no shared schedule. This project solves the organisation problem first and the control problem second: four rooms, 24 named devices, one topic tree, and a dashboard that always shows the real on-off state reported back by each device. It is built for a student home demo, where the broker, the relay endpoints and the phone all sit on one local Wi-Fi network.
Taps a switch in the room-wise dashboard.
Follow the working sequence
How it works
The MQTT Smart Home Control Android App works as a publisher and subscriber on a single MQTT topic tree, with a local broker between the app and the ESP32 relay boards. When the user taps a switch, the app publishes a short command such as ON or speed 3 to that device's command topic, for example home/living/light1/set, at QoS 1 so delivery is confirmed at least once. The subscribed ESP32 receives the command, drives its relay or dimmer, then publishes the new state back on the matching status topic, for example home/living/light1/status, as a retained message at QoS 0. The app subscribes to every status topic, so the dashboard shows the state the device actually reported rather than the state the user last requested. Schedules run the same way: on schedule the app publishes the command and the device answers with its status. Offline, commands queue locally and retained status messages re-sync the dashboard on reconnect.
Builder note from the demo build: the first topic layout used one flat list of 24 devices, and the 23:00 all-lights-off rule then needed 24 separate publishes. The tree was changed to home/room/device/set, so the same rule is now a single wildcard publish to home/+/light1/set — the topic design is part of the project, not an afterthought.
- The user opens the app, which connects to the local Mosquitto broker on port 1883 with a persistent session, a 60-second keep-alive and a last-will message on home/app/status.
- The app subscribes to every device status topic (home/room/device/status) and reads the retained messages, so the dashboard opens showing each device's last reported state.
- Tapping a switch publishes a command (ON, OFF or a fan speed) to that device's command topic at QoS 1, and the broker confirms delivery.
- The ESP32 subscribed to that topic drives its relay or dimmer, then publishes the new state back on its status topic as a retained message.
- The app receives the status message and updates the toggle, the room total and the live power estimate only after the device has confirmed.
- At a scheduled time the app publishes the scheduled command the same way, and a 45-minute timer switches the geyser off automatically after it starts.
Tech stack:
- Kotlin · Android Studio
- MQTT · Eclipse Mosquitto broker
- ESP32 · Arduino framework
- 4-channel relay boards
- Room database (local app storage)
- Material Design 3 UI
- Java · Gradle build
- Git
Requirements
- Android phone running Android 8.0 (API level 26) or higher for the app
- Wi-Fi router with a local network the phone, broker and ESP32 boards all join
- Raspberry Pi 3/4 or a spare laptop running the Mosquitto MQTT broker
- 4 ESP32 development boards, one per room, with 4-channel or 8-channel relay boards
- 5 V DC power supplies for the ESP32 boards and relay boards
- Demo loads: LED bulbs, a table fan, a plug-in appliance and a 230 V AC supply for the relay outputs
- Android Studio with the Android SDK for building the app from source
- Mains wiring for relay outputs must be done by a qualified electrician; the student demo uses low-power loads only
| Parameter | Value |
|---|---|
| Platform | Android 8.0 (API level 26) or higher (design target) |
| Broker | Eclipse Mosquitto on local Wi-Fi, port 1883 (design target) |
| Protocol | MQTT 3.1.1, QoS 1 commands, QoS 0 retained status |
| Keep-alive | 60 s |
| Rooms | 4 (Living Room, Bedroom, Kitchen, Study) |
| Devices | 24 relay-switched loads (design target) |
| Command round-trip | Under 200 ms on local Wi-Fi (design target) |
| Schedules | 5 rules, daily or weekday, with 45-minute geyser auto-off |
| Relay endpoints | ESP32 dual-core 240 MHz (datasheet value) with 4-channel relay boards |
| Network | Local Wi-Fi only; no cloud account needed |
Project features
The MQTT Smart Home Control Android App is built around four capabilities that matter most in a real home: room-wise organisation, reliable MQTT control, honest state feedback and time-based automation. The room-wise dashboard groups 24 devices across 4 rooms, so each switch sits where the user expects it and the live power estimate updates as devices change. MQTT control uses one topic tree with QoS 1 commands, retained status and a last-will message, so the app knows within seconds whether the broker and the devices are reachable. State feedback is two-way: every toggle waits for the device's own status message before the dashboard settles, instead of assuming the command worked. Scheduling adds five daily rules, including a 23:00 all-lights-off rule, with a 45-minute auto-off on the geyser. Together these four capabilities turn a collection of relay boards into a home system a student can demonstrate room by room.
- [Room-wise device dashboard] Four rooms — Living Room, Bedroom, Kitchen and Study — each with 6 named devices, so every switch sits in the room it belongs to and the dashboard never becomes one long flat list.
- [MQTT QoS 1 command publishing] Each tap publishes a short command such as ON, OFF or speed 3 to that device's own topic (home/living/light1/set) at QoS 1, so the broker confirms delivery at least once.
- [Retained two-way state feedback] Every device answers on its status topic with a retained message, so the dashboard shows the state the device actually reported, and a freshly opened app reads the last state immediately.
- [Time-based schedules with auto-off] Five daily rules switch devices on and off by time, including a 23:00 all-lights-off rule and a 45-minute auto-off on the geyser, so routine switching needs no manual taps.
- [Offline command queue and re-sync] Commands tapped while the phone is offline queue locally and publish on reconnect, and retained status messages re-sync the dashboard without the user re-checking every room.
- [Live power estimate] The dashboard totals the rated wattage of switched-on devices into an estimated live load, so the student can show which rooms draw power at any moment.
- [Broker connection panel] A dedicated view shows broker address, client ID, keep-alive, last-will message, QoS levels and a live message log, so broker problems are visible instead of silent.
- [Fan speed and dimmer control] Fans expose a 3-step speed slider and lights expose on/off with dimmer-ready topics, so the demo shows more than binary switching where the hardware supports it.
What is included
- Complete Android app source code (Kotlin) with room-wise dashboard, schedules and MQTT connection panel
- ESP32 relay firmware for 4 rooms with the home/room/device topic tree
- Mosquitto broker setup guide for Raspberry Pi and laptop
- Wiring diagram and component list for the relay boards and demo loads
- Working demo build of the app (APK) for the viva demonstration
- Project report PDF (background, MQTT theory, architecture, methodology, results)
- Project abstract PDF
- PPT presentation for final review
- Viva Q&A preparation document (MQTT, QoS, retained messages, Android architecture, ESP32 interfacing)
- Demonstration guidance for the room-by-room switching demo
Timeline
- Weeks 1–2: MQTT study, topic-tree design and broker setup on Raspberry Pi
- Weeks 3–4: Android app UI — room tabs, device cards, toggles and power estimate
- Weeks 5–6: MQTT client integration, QoS 1 publishing, retained status subscription and offline queue
- Week 7: ESP32 relay firmware per room and end-to-end switching tests
- Week 8: schedules, auto-off timer and broker connection panel with message log
- Weeks 9–10: demo build, documentation, report, PPT and viva preparation
Support
- Broker setup guidance for Raspberry Pi and laptop, including the Mosquitto configuration used
- Wiring diagram and component list supplied with the relay boards
- Setup guidance for first run, including the broker connection check and topic test procedure
- Viva Q&A document covering MQTT, QoS levels, retained messages, Android architecture and ESP32 interfacing
- Guidance on the room-by-room demonstration for the final review
Limitations & prerequisites
- The app controls devices only on the local Wi-Fi network; remote control from outside the home needs a cloud broker or VPN, which is an optional extension, not part of the base build.
- Command round-trip under 200 ms is a design target on local Wi-Fi; congested networks, weak signal or a busy broker slow responses, and the app shows the last confirmed state rather than guessing.
- The power estimate totals rated wattage of switched-on devices; it is not a measured energy reading and does not replace a plug-in energy meter.
- Relay outputs switch 230 V AC loads, so mains wiring must be done by a qualified electrician; the student demo uses low-power loads and the relay boards must be enclosed before any mains load is connected.
- The app does not include voice control, cloud dashboards or user accounts in the base build; these are optional customisations.
- If the broker goes down, no command reaches any device until it restarts; devices keep their last relay state and the app shows the broker as disconnected.
Frequently Asked Questions
Is this project suitable for a final-year project?
Yes — it fits Computer Science, IT and Android programmes, demonstrating Android app development, MQTT messaging, embedded interfacing with ESP32 relay boards and a complete client-broker-device system. Students present the working app, the room-wise dashboard and the live switching demo as evidence of a finished system.
How does MQTT control actually work here?
The app publishes a short command such as ON to a topic like home/living/light1/set at QoS 1, the broker confirms delivery, and the ESP32 subscribed to that topic drives its relay. The ESP32 then publishes its new state back on home/living/light1/status as a retained message, so the app shows the state the device reported.
What hardware do I need besides the phone?
A Wi-Fi router, a Raspberry Pi or spare laptop running the Mosquitto broker, and 4 ESP32 boards with relay boards — one set per room. Demo loads are ordinary LED bulbs, a fan and a plug-in appliance, all switched through the relay boards. Mains wiring for relay outputs must be done by a qualified electrician.
What happens if the Wi-Fi or broker goes down?
Commands tapped while offline queue inside the app and publish automatically on reconnect, and retained status messages re-sync the dashboard. While the broker is down, devices keep their last relay state and the app shows the broker as disconnected instead of pretending the command worked.
Can I add more rooms or devices later?
Yes — adding a room or a device is a small job, not a redesign. A new device needs one more topic pair under home/room/device and one more card in the app, while a new room needs one more ESP32 and relay board. The topic tree is designed so additions need no change to the broker or to existing devices.
What will I receive with the project?
The complete Android app source code, ESP32 relay firmware for 4 rooms, Mosquitto broker setup guide, wiring diagram and component list, a demo APK, the project report PDF, abstract PDF, PPT for final review and a viva Q&A document, plus guidance on demonstrating the room-by-room switching.
Components & software requirements
- Kotlin · Android Studio
- MQTT · Eclipse Mosquitto broker
- ESP32 · Arduino framework
- 4-channel relay boards
- Room database (local app storage)
- Material Design 3 UI
- Java · Gradle build
- Git
Requirements
- Android phone running Android 8.0 (API level 26) or higher for the app
- Wi-Fi router with a local network the phone, broker and ESP32 boards all join
- Raspberry Pi 3/4 or a spare laptop running the Mosquitto MQTT broker
- 4 ESP32 development boards, one per room, with 4-channel or 8-channel relay boards
- 5 V DC power supplies for the ESP32 boards and relay boards
- Demo loads: LED bulbs, a table fan, a plug-in appliance and a 230 V AC supply for the relay outputs
- Android Studio with the Android SDK for building the app from source
- Mains wiring for relay outputs must be done by a qualified electrician; the student demo uses low-power loads only
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.