Danya Dilshad
Published © GPL3+

Home Automation using Bolt IoT and Google Assistant

Want to control your room lights without the effort of going to the switch board? It's absolutely easy with Bolt IoT and Google Assistant!

IntermediateFull instructions provided2 hours682
Home Automation using Bolt IoT and Google Assistant

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
2 channel Relay
×1
LED lights
×1
LED Light Bulb, Frosted GLS
LED Light Bulb, Frosted GLS
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud
Bolt IoT Android App
Bolt IoT Android App
Maker service
IFTTT Maker service
Assistant SDK
Google Assistant SDK

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires

Story

Read more

Schematics

Home-automation circuit diagram

Circuit diagram for reference to make circuit connection

Code

Home-automation

JavaScript
This creates a user friendly interface on the Bolt app to easily control the lights using App.
singleButton({name:"LED On", action:"digitalWrite",
pin:"1", value:"LOW"})
singleButton({name:"LED Off", action:"digitalWrite",
pin:"1", value:"HIGH"})
singleButton({name:"Light Bulbs On", action:"digitalWrite",
pin:"2", value:"LOW"})
singleButton({name:"Light BULBS Off", action:"digitalWrite",
pin:"2", value:"HIGH"})

Home-automation

HTML
If you wish to stylize the page with better alignments use the code below. You can use different colors for button background and text color by changing the color code.
<!DOCTYPE html>
<html>
    <head>
        <title>Bolt IoT Platform</title>
        <script type="text/javascript" src="https://cloud.boltiot.com/static/js/boltCommands.js"></script>
        <script>
        setKey('{{ApiKey}}','{{Name}}');
        </script>
        <style>
            .onbutton{ 
                background-color: #5EEEC6  ; 
                border-radius: 30px;
                color: #000000 ;
                padding: 20px 47px;
                text-align: center;
                text-decoration: none;
                display: inline-block;
                font-size: 20px;
                margin: 4px 2px;
                cursor: pointer;
            }
            .offbutton{
                background-color: #F29F47 ;
                border-radius: 30px;
                color: #000000 ;
                padding: 20px 47px;
                text-align: center;
                text-decoration: none;
                display: inline-block;
                font-size: 20px;
                margin: 4px 2px;
                cursor: pointer;
                
            }
        </style>
    </head>
    <body>
        <br><br><br><br><br><br><br><br><br><br><br>
        <center>
            <h3>LED</h3>
        <button class="onbutton" onclick="digitalWrite(1, 'HIGH');">ON</button>
        <button class="offbutton" onclick="digitalWrite(1, 'LOW');">OFF</button>
        <br><br>
        <h3>Light Balls</h3>
        <button class="onbutton" onclick="digitalWrite(2, 'HIGH');">ON</button>
        <button class="offbutton" onclick="digitalWrite(2, 'LOW')">OFF</button>
        </center>
    </body>
</html>

Credits

Danya Dilshad
1 project • 1 follower
Contact

Comments

Please log in or sign up to comment.