Introduction: Make Voice Controlled Light Bulb Using Relay and Evive
We’ve controlled lights with touch, we’ve controlled them with a Smartphone. How about controlling them with voice?
Presenting to you the voice-activated light bulb! This project is a smaller version of the bigger home lighting automation projects that is ideal for beginners who wish to make IoT projects and educators who wish to introduce IoT and home automation to their students.
To make this project, we’re going to use the evive IoT kit and code it using PictoBlox - a graphical programming software based on Scratch with advanced capabilities. You can download it from HERE.
Ready to automate light control? Ready. Set. Go!
Step 1: List of Supplies
Hardware
- evive
- Relay
- HC05 or HM10
- Bulb
- Bulb Holder
- MDF Parts
- Electric Wires
- Jumper Cable
- Nuts and Bolts
Software
Note: All the above hardware components can be found in evive IoT Kit. Also, you can use either HC05 or HM10 if you have installed Dabble in your Android phone. But you have to use HM10 if it is installed on an iOS device.
Step 2: Fixing the Bulb Holder
Note: Before we begin to assemble, you can even use strong cardboard to make the box instead of the MDF sheet or no box at all. As the main aim is to understand the working of the relay and how to control it using a Smartphone.
Let's start by fixing the bulb holder on to the top plate. If you are working with cardboard, you can either fix it by making the hole in the cardboard or can simply glue to the top plate. (Fig 1)
As the bulb will need an external power supply, connect electrical wires to it. How will you connect? Take a small piece of electrical wire and insert it into one of the two slots(any slot) of the bulb holder. (Fig 2)
Next, take the other electrical wire with a plug on the other side and fix it's one of the two wires(any wire) into the remaining slot.
As the wiring is done under the plate, bring the free ends of both the wires on the top. (Fig 3)
Step 3: Why Relay?
Before we attach the relay, let's first understand how does a relay works and why are we using it here?
Relay is an electromechanical device which acts as a switch. When the relay is ON, the circuit it is connected to is closed and when it is OFF, the circuit is open.
We are adding the relay in this project as it will act according to the command received by the brain("evive") which we will send from our Smartphone via Dabble.
Step 4: Attaching the Relay
We will be attaching the relay on the top plate.
Now, we will be inserting the two free wires into the two terminals out of the three terminals of the relay.
We are going to use COM(common) and the NO(Normally Open) terminal for the connection. NO terminal will keep the circuit open till the signal is not received to close the circuit.
Insert the electrical wires into these terminals.
Note: You can insert any wire into any terminal(COM or NO).
Step 5: Completing the Box
Attach all the other side to the top plate using M3 nuts and bolts.
Or simply make a box out of the cardboard by fixing all the sides together using a Hot Glue.
Step 6: Making the Connections
Now, it’s time to connect the relay to evive- our Arduino based embedded platform which will act as the brain that will receive the signals from Smartphone via Dabble and give commands to relay accordingly.
Connect:
VCC of the relay to +5V of evive
GND of the relay to GND of evive
OUT of the relay to Digital Pin 2 of evive
Now, as we need to control our appliance using Voice Commands which will be sent via Bluetooth. But how will we connect the Bluetooth of our Smartphone with evive? By attaching Bluetooth Module (HC05 or HM10) to evive.
Finally, connect the light bulb to the power supply to complete the making of our Voice Controlled Light Bulb.
Step 7: Writing the Graphical Code and the Logic
To make the project simpler. We are going to code it in PictoBlox- a scratch based graphical programming language, where we need to just drag and drop a few blocks to create a complete script.
Before writing the code let's first understand how will our system work.
We are going to use the terminal module of Dabble to send the data to evive. Thus, dabble terminal block needs to be used in the code.
Now, as soon as we write or speak "lights on" the bulb will glow, as we will set the signal pin of the relay "ON" which in turn will close the circuit. Turning the bulb ON.
Similarly, on receiving "lights off", the signal pin of the relay will be set to "OFF" and the bulb will turn OFF.
Write the following script and upload it to your hardware. Or download the code given below:
If you want to display the status of the bulb on the evive TFT display: upload the following code
Attachments
Step 8: Conclusion
With this, your voice-activated light bulb is all set to light up your life!