Smart door
A smart door is a door that you can control through your mobile phone.
Smart door with servo motor
Smart fan
A smart fan is a fan which you can control through your smart phone.
Smart fan with mobile app
The source of ideas links:
https://www.hackster.io/raghavdaboss/arduino-controlled-servo-door-lock-1c2239
https://www.robotique.tech/robotics/control-a-fan-with-smartphone-and-arduino/
I used Arduino IDE to write the code.
I used, servo motor, fan, and breadboard.
I used Arduino as a brain.
I wired the system in Tinkercad.
Arduino IDE
Tools
I used Arduino IDE to write the code on which the servo motor works when the hand is on button 1 and the hand is off on button 2 via Bluetooth module and smartphone.
The action component is a servo motor and the application is an Arduino BlueControl.
Furthermore, when put your hand on button 3 the fan works and will off put your hand on button 4 via Bluetooth module and smartphone.
The action component is a fan and the application is an Arduino BlueControl.
Arduino BlueControl
Explain the code:
First: Define variables, libraries, and the initial position of servo motors.
Second: Define void loop: starts of serial communication, inputs, and outputs (servo motor and fan are outputs).
Third: Define void setup: when you put your hand on the smartphone app at button one the servo motor rotates and if you press button two the servo motor returns to its initial position.
Furthermore, when you press on button three the fan works, and when press it on button four the fan off.
Arduino code:
char incomingData = '0';
#include <Servo.h>
int motor = 8;
Servo myservo;
// object to control a servo
int pos = 0; // variable to store the servo position
void setup() {
Serial.begin(9600);
myservo.attach(9);
pinMode(motor, OUTPUT);
// attaches the servo on pin 9 to the Servo object
}
void loop() {
while (Serial.available() == 0)
;
incomingData = Serial.read();
if (incomingData == '1' ) {
//for (pos = 0; pos <= 180;
pos += 180; // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
}
else if (incomingData == '2' ) {
//for (pos = 180; pos >= 0;
pos = 0; // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
}
else if (incomingData == '3' ) {
digitalWrite(motor, HIGH); }
else if (incomingData == '4' ) {
digitalWrite(motor, LOW); }
}
Wiring system in TinkerCAD
Connecting servo motor to the system
Connecting the fan to the system
Connecting Bluetooth module to the system
Snipping of the system
During this week, I worked with the team which made a great effort and we helped each other. We Build a Robot Arm System using Arduino.
The system contents of three servo motors and enclosure of it using smart phone and Bluetooth module.
Robot Arm
When I got stuck, I asked Ahmed or Farida to help me.
Challenge
When I did my assignment, I faced a challenge during connecting the Bluetooth module to Arduino. I forgot to disconnect the receive and transmit inputs of Arduino while uploading the code. So after checking the problem, I disconnect Rx and Tx during the coding of the Arduino.
We can avoid this problem when we do the assignment.
Focusing on how to combine multiple outputs via Bluetooth module, and smartphone and connecting it with the Arduino are the skills and knowledge that I have acquired this week in my final project.
The coolest thing I have learned this week is combining multi-outputs via Bluetooth and smartphone to the Arduino.
Uploading Bluetooth modules and trouble-shooting in general are something that I will never forget from this week.