SIGN IN

Home Automation Project with Bolt IoT

Vinayak Shantaram JoshiJan 18, 2019
Home Automation Project with Bolt IoT

Overview

Had a busy day at work today? Exhausted, right? We know how it feels coming back home after such a long tiring day from work. Imagine being able to control the lights, fan or AC at just the tip of your fingers -- click a button and things just work. This project demonstrates how to control a light bulb via cloud-based buttons using the Bolt IoT platform and a relay module.

Hardware Components

ComponentQuantity
Bolt WiFi Module1
Relay Module (Generic)1
Jumper Wires (Generic)As needed
Bulb1
Bulb Holder1
Mobile Charger1
2-Pin Socket1
Screwdriver1
Wire Stripper1

Software Requirements

Hardware Setup

Step 1: Gathering Components

Collect all the required items before beginning assembly.

Gathering Components

Step 2: Assembling the Hardware

  1. Connect the 5V supply pin and GND of the Bolt to the 5V and GND pins of the relay module.
  2. Connect any one of the digital pins (0-4) of the Bolt to the IN/REL pin of the relay module.
  3. Connect a wire from the bulb holder to the COM pin of the relay module.
  4. Connect a wire from the NO pin of the relay module to the 2-pin socket.
  5. Connect the remaining terminal of the bulb holder to the other terminal of the 2-pin socket.
Home Automation Circuit Schematic

Important: Check all the connections carefully before proceeding.

Warning: Playing with high voltages is dangerous, so be careful.

Step 3: Connecting Bolt to Cloud

Create an account on cloud.boltiot.com and link your Bolt device following the provided instructions.

Software Setup

Step 1: Uploading Code

  1. Visit cloud.boltiot.com and login
  2. Click the "Product" tab and create a product
  3. Configure the product
  4. Upload the following code with a .js extension:
singleButton({name:"On", action:"digitalWrite",
pin:"0", value:"HIGH",bgcolor:"green",
shape:"rectangle",align:"left","text_color":"white" })

singleButton({name:"Off", action:"digitalWrite",
pin:"0", value:"LOW", bgcolor:"red",
shape:"rectangle", align:"left", text_color:"black"})

Note: Make sure the correct digital pin is used in the code. Save the configuration before proceeding.

  1. Link the Bolt to the product
  2. Click "View this device"
  3. Use the On/Off buttons to control the lamp
Home Automation Output - On/Off Buttons

Step 2: Testing

  1. Power up the Bolt device and verify cloud connection
  2. Connect the bulb holder to AC power supply using the 2-pin socket
  3. Login to cloud.boltiot.com
  4. Navigate to the product and click "View the action" button
  5. Control the bulb using the ON/OFF buttons over the internet
Testing the Home Automation System

Conclusion

The system uses a simple API (Application Program Interface) call that turns the state of the digital pin to HIGH or LOW. The relay switches based on the pin state. When the relay is in the OFF state, it breaks the circuit between the bulb and the power supply, causing the bulb to turn off. When the relay is in the ON state, it completes the circuit connection, turning the bulb on. This project can be extended to control multiple appliances by adding more relay channels and buttons.

Subscribe to our Newsletter

Get the latest IoT tutorials, projects, and updates delivered to your inbox.