Week 8 - Journal
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)
The idea was to create a smart home circuit that allows the user, specially freelancers like me who work from home and don't like to get up and interrupt their flow of work, to control some basic functions in their home from their computer.
Tool Chain
Which software/machines/materials did you use in the assignment? Why?
Software
Arduino IDE for coding
Processing for GUI on PC
Fritzing for wiring and simulation
Hardware
Arduino UNO board as a brain
HC-05 module for wireless communication
piezo buzzer as a speaker
DC Fan
Resistor 1k ohm for a voltage divider
2 resistors 330 ohm for a voltage divider
Jumper wires for connections
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?
Connecting circuit on Fritzing
Connect +ve fan terminal to pin 8.
Connect -ve fan terminal to common ground on breadboard
Connect +ve buzzer terminal to pin 9.
Connect -ve buzzer terminal to common ground on breadboard.
Connect two 330 ohm resistors with 1k ohm resistor to create a voltage divider to limit the voltage from the Tx of the Arduino to 3.3 volts to be transmitted to the HC-05.
Connect the Tx of the bluetooth module with the Rx of the Arduino.
Connect the 5v and ground pins of the Arduino to the breadboard.
Preparing Processing script
After pairing the bluetooth module with computer, I opened control panel>change bluetooth settings>COM ports to check which port to write in the Processing script.
"COM6" is the outgoing serial data to HC-05.
I sat two buttons in the processing to control the fan and the buzzer.
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?
Hardware connection
I connected the circuit similarly to the simulation connections.
Coding
Code initialisation
Defining pins
Defining Notes used for the song.
Defining the melody.
creating variables.
setup function
Initialise the serial connection to be used for bluetooth communication.
Setting pins mode.
Giving initial values to pins.
Loop function
Waiting for serial input.
setting up the melody.
Checking for user input.
checking for user input before playing another note so that the code works simultaneously.
Circuit demo
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)
Problem 1
I wanted to simulate the circuit before implementing on hardware but I couldn't find the HC-05 module on Tinkercad. Even when I searched online, I found projects using a wifi module not a bluetooth module and it wasn't supported anymore due to security issues.
I decided to use Fritzing and I found that it has simulation feature and searched how to enable it online but after I enabled it I found out there are certain components that can't be simulated including Arduino and HC-05.
I eventually ended up coding and troubleshooting on Arduino IDE and the Arduino board itself.
Problem 2
I created a "switch case" to check the incoming data and decide which function to perform but it created a problem for me because I couldn't perform two functions at the same time for example, if I turn on the music then try to turn on the fan, it doesn't perform the order until it finishes the whole melody playing and I couldn't turn off the music before finishing the melody.
Final Project
How can you use the skills and knowledge that you've acquired this week in your final project?
Title of Media
WOW!
What is the coolest thing that you've learned this week? What is something that you will never forget from this week?
Title of Media
Weekly Digest [OPTIONAL]
Tell us about any other cool things that you've made this week: in the Hands-on activity, tutorial examples, exercises, or any other cool mini-project that you tried out aside from the assignment.
Title of Media