Week 8
Voice Controlled Home Automation
Ideation
Tell us about your assignment's idea for this week. Why do you care about this idea? What inspired you? (Please include images or links to sources of inspiration)
This week’s assignment was to communicate wirelessly with a Smart Circuit via a Graphical User Interface (GUI) on your phone or PC.
One of my dreams is to live in a smart and automated home, so I chose to mimic the smart home idea in a simple way.
This video inspired me to control through vocal commands :
Tool Chain
Which software/machines/materials did you use in the assignment? Why?
Softwares:
Tinkercad: to build the virtual circuit
Arduino IDE: to upload the code to the Arduino board
Arduino BlueControl mobile app: to communicate wirelessly to the bluetooth module
Electric Components:
Breadboard, jumpers to connect the component
1 servo motor: to control the movement of the door
Bulb & 1-channel relay module: to mimic the lighting system
DC brushless fan & LM7805 regulator: to mimic the cooling system
Bluetooth module: for the wireless communication
Arduino Uno: to read the input wireless signals from the bluetooth module, and control the action components
5V adaptor: for power supply
Others:
Cardboard - scissors- ruler - tape
Design/Preparation Process
Explain the design and/or preparation process of your assignment. How did you use the tool or software to design and/or prepare your assignment before fabrication/implementation?
Designing the virtual circuit on Tinkercad
I bring these components on Tinkercad
Action components: Light bulb, DC motor & servo motor
the Bulb was connected to the relay module to control the voltage supply (I followed this tutorial to wire it correctly on tinkercad: https://www.instructables.com/Simulating-a-Relay-Activated-Lamp-in-TinkerCAD/)
DC motor was used instead of the brushless DC fan, it was connected with a MOSFET for voltage control
ESP8266 WiFi Module was used to simulate the Bluetooth module
Then, I built & tested the virtual circuit as shown in the following simulation
Development/Implementation Process
Explain the development/implementation process of your assignment. How did you use the machine/tool to manufacture or implement the design of your assignment?
Building the physical circuit
All components are wired to the Arduino board & breadboard just like the virtual wiring
I test the wiring & function of each component individually, the whole circuit was built
-The bulb & the relay were wired just like this tutorial (https://lastminuteengineers.com/one-channel-relay-module-arduino-tutorial/); It's controlled by Arduino pin 5
The bulb was connected between the COM (common) terminal of the relay and the NC (normally) terminal
The module’s VCC pin was connected to the positive rail on the breadboard, the GND pin was connected to the negative rail on the breadboard ground, and the IN input pin was connected to digital pin #6 of Arduino
-the fan & the 5v regulator (which is used as MOSFET) were wired https://proteshea.com/control-dc-fan-with-n-channel-mosfet-and-arduino-uno/; It's controlled by Arduino (Pin 9)
Left pin of the regulator to the common GND on the breadboard, the mid-pin to Arduino pin 9, and the right pin to the black wire on the fan. The red wire of the fan gets connected to the positive rail on the breadboard.
-the servo motor was connected and controlled by Arduino (pin 6):
VCC of the servo was connected to the positive pins on the breadboard
GND pin of the servo was connected to the common ground on the breadboard
OUT pin of the servo was connected to pin 5 of the Arduino
then I wrote the code that controls their function and tested it with the serial monitor
Finally, the Bluetooth module was wired as follows:
-VCC pin of the HC-05 was connected directly to the 5V pin of the Arduino board
-GND pin was connected to the common ground on the breadboard
-TXD pin of HC-05 to the RXD pin of the Arduino UNO (PIN 0)
-RXD pin of HC-05 to the TXD Pin of the Arduino UNO (PIN 1)
Programming the smart Home system using Arduino IDE software
The first part includes the used libraries & the definition of the components' pins & the variables
This part includes the setting of the output pins, starting communication with the serial monitor, and the orders that execute only one time such as the initial value of the servo motor, lamp & fan
Here, the incoming data from the serial monitor or wirelessly through the bluetooth module is stored in the incomungData variable
A specific order is executed according to the value of the incomingData
-The bulb is turned on if the incomingData equals "1"
-The fan is turned on if the incomingData equals "2"
-The servo/door is moved/opened if the incomingData equals "3"
-The bulb is turned off if the incomingData equals "4"
-The fan is turned off if the incomingData equals "5"
-The servo/door is moved/closed if the incomingData equals "6"
-Both bulb & fan are turned on if the incomingData equals "7"
-Both bulb & fan are turned off if the incomingData equals "8"
Click here to find the code file.
Then, It was tested using the serial monitor & uploaded successfully on the Arduino UNO board
Vocal commands configuration through Arduino BlueControl mobile app
from the setting icon, vocal commands configuration is opened
Then, I type the vocal command to pronounce for each order, and the data to send through the Bluetooth
Making the enclosure & Mounting the Components
A cardboard box was used to host this circuit
Testing the final output
Overcoming Challenges
What kinds of challenges or problems did you face while doing the assignment, tutorials, or exercises? How did you solve them? Did you ask for help from an instructor or peer? Please provide a link to the tutorial or article that you used to solve your problem (if any)
in Tinkercad there is no Bluetooth module, so I use only Tinkercad to connect the Arduino to the other components & to control them by the serial monitor. Also, there is no fan, so I used a DC motor instead
When I connected the bulb to the relay, it didn't work, so I checked the connections from this tutorial and it worked properly https://lastminuteengineers.com/one-channel-relay-module-arduino-tutorial/
I connected the brushless DC fan directly to the Arduino board, but it did not work. When I searched Google, I found that it must be connected to a regulator (MOSFET) first (check this tutorial: https://proteshea.com/control-dc-fan-with-n-channel-mosfet-and-arduino-uno/), so I connected it to the LM7805 regulator & it worked properly
Final Project
How can you use the skills and knowledge that you've acquired this week in your final project?
Wireless communication & troubleshooting skils
WOW!
My team won Makeathon #2 competition
We programed, assembled, and wirelessly controlled a Micro Robot Arm.