Skip to main content

Day 3: Smart Switch Device Architecture and MQTT

info

For day 3 prep, go to Day 3 Resources

Schedule: May 28, 2025 (9:30-12:00)

Session Timeline

00:0000:1500:3000:4501:0001:1501:3001:4502:0002:1502:30Architecture Overview Circuit Design Break Software Stack MQTT Deep Dive Day 3 Schedule

Smart Switch Architecture

SoftwareCommunicationHardware

Power Supply

ESP32/ESP8266

Relay Module

Status LED

Reset Button

WiFi Module

MQTT Broker

Backend Server

Mobile App

Detailed Agenda

1. Product Architecture Overview (9:30 - 10:05)

Design Goals

  • Remote control capability
  • Real-time status updates
  • Power consumption monitoring
  • Offline functionality
  • Security features

System Requirements

  • Hardware specifications
  • Software requirements
  • Network requirements
  • Security requirements

2. Circuit Design Walkthrough (10:05 - 10:40)

AC Input

Power Supply Unit

Microcontroller

Relay

AC Output

Status Indicators

User Input

Components Overview

  • Microcontroller selection
  • Power management
  • Relay control
  • Safety considerations

3. Break (10:40 - 10:55)

4. Software Stack Selection (10:55 - 11:25)

Application LayerCommunication LayerDevice Layer

ESP32 Firmware

FreeRTOS

MQTT Client

MQTT Broker

Node.js Backend

React Native App

Technology Stack

  • ESP32/ESP8266 firmware
  • MQTT protocol
  • Backend server (Node.js)
  • Mobile app (React Native)

5. MQTT Deep Dive (11:25 - 12:00)

MQTT Protocol Overview

AppBrokerDeviceAppBrokerDeviceConnectSubscribe to commandsConnectSubscribe to statusPublish commandForward commandPublish statusForward status

Key MQTT Concepts

  • Publish/Subscribe pattern
  • Quality of Service (QoS)
  • Topic design patterns
  • Retained messages
  • Last Will and Testament

Learning Outcomes

  • Understanding IoT device architecture
  • Circuit design principles
  • MQTT protocol mastery
  • Software stack integration

Prerequisites for Day 4

  • Development environment setup
  • MQTT broker access
  • React Native environment
  • Basic networking knowledge

Resources

  • Circuit diagrams
  • MQTT documentation
  • Code examples
  • Testing tools