Smart Home Display IOT

29 Jun 2019

This is a DIY smart display that you can embed in to your wall. You can control your smart appliance, set timer to control it, get weather info, and act as a cool clock. Let’s get straight into how I made it.

preview

Architecture

Hardware

It consists of

  • Frame
    • Front panel
    • Back panel
    • Processing Unit Cover
    • Relay Cover
  • Display (7 inch 800x480 resolution)
  • Processing Unit - Raspberry Pi
  • Relay circuit (4 channel)

Panel and display are snapped together. Processing Unit and display are secured using screws. Processing unit and relay cover are attached using 3 mm screws.

Software

Chromium-browser is used in a kiosk mode where it render the UI from a backend server. Python with the help of Flask to serve both static pages and a REST API service. JS will invoke REST APIs to control and view stats of appliances.

architecture

REST API Service

  1. List room names

    GET /api/

         {
         "rooms":["room1","room2"]
         }
    
  2. List all appliances in a given room

    GET /api/{room_name}

         {
           "Fan 1": {
             "power-control": {
               "enabled": true, 
               "level": 100
             }, 
             "status": true, 
             "timer": -1, 
             "type": "fan"
           }, 
           "Light 1": {
             "power-control": {
               "enabled": false, 
               "level": 100
             }, 
             "status": true, 
             "timer": -1, 
             "type": "light"
           }, 
           "Light 2": {
             "power-control": {
               "enabled": false, 
               "level": 100
             }, 
             "status": true, 
             "timer": -1, 
             "type": "light"
           }
         }
    
  3. Change appliance properties

    POST /api/{room_name}/{appliance_name}

         {
         "status":true,
         "timer":10,
         "power-control":{
                 "level":50
                 }
         }
    
  4. Scan wifi APs

    GET /api/wifi_scan

         {
           "result":["WiFi-1","WiFi-2"]
         }
    
  5. Connect to an AP

    POST /wifi_connect

         {
           "ssid":"WiFi-1",
           "passkey":"password"
         }
    
  6. Disconnect already established connection

    POST /api/wifi_disconnect

         {
         }
    
  7. Get current ip

    GET /api/ip

         {
           "ip": "192.168.1.5"
         }
    

UI features

These shows the features that are supported.

CAD Design

I have used fusion 360 to model the parts.

3D printing

Thanks to Sumit Goyal for helping out with 3D printing and beautifully painting the parts.

preview preview

Final preview

preview preview




Comments