our assignment this week was to design and program a smart device that can work remotely with graphical user interface (whether PC or android)
with at least two action components .
i wanted to design an app controlled fan that works from an android app with simple functions such as turning on and off, and maybe display errors when the wrong value is entered.
the software used to interpret the programing to arduino is arduino ide , and the software used to design the circuit is fritzing
Arduino ide
fritzing
the components used in this project are :
1 x buzzer
3 x 220 ampere resistor
1 x RGB LED lamp
1 x breadboard
1 x 5v adapter
1 x relay module
1 x fan
1 x Bluetooth module
20x male\male electric wire jumpers
android phone with the arduino app installed
Arduino Uno
for this assignment i wanted to make a smart fan that does simple functions :
first i designed the circuit with the Arduino for programing using fritzing and assigned:
the buzzer to pin 9
the lRGB led to pins 6,5and3
trig to 11
echo to 10
relay module signal to 13
tx and rx pins to 0 and 1 respectively
fan +ve polarity to to the common pin in the relay module
and the power supply +ve polarity to the normally open pin in the relay module
circuit design
i decide to use the relay module to power the fan separately as it needs exactly 5 volts to operate
assembled circuit
i started writing the code by defining the pins numbers
and the value entered by the phone
and defined which pins are input and which are output
then i wrote the codes for when the fan turns on and off:
if '1' is entered: the led turns green , the fan turns on and the buzzer makes a small beep sound.
if'0' is entered : the led turns yellow as for standby , the fan turns off and the buzzer makes two small beeps.
and if a wrong value is entered : the led turns red and flashes with the fast beeping sound of the buzzer
Arduino complete code:
i added the code to arduino by using arduino ide then tested the circuit by connecting the bluetooth module to the arduino app on my phone and it worked properly
final project
lama , mohab and i, we made a robotic arm in the latest makeathon and it was such a joy , we struggled a bit with the bluetooth module and programing the servo motors , fortunately israa came and helped us on how to send the commands properly from the phone app to the arduino.
the arduino was lagging a lot as i was trying to upload the code ,turns out it lags when the rx and tx pins are connected ,and the arduino gets slow and confused, so i had to make sure to disconnect the pins while uploading the code to avoid the lagging
the skills i learnt will help me better decide whether to control the device remotely if needed and how to utilize it in a better way
making the robotic arm was so cool and so is controlling the arduino remotely