Smart Window Using Smartphone & Arduino
by ALP Electronic Innovation in Circuits > Arduino
10129 Views, 86 Favorites, 0 Comments
Smart Window Using Smartphone & Arduino
Smart Window Using Arduino is a Home Automation tool to control any Window Shade/Blinds.
Requirements:
Arduino Uno
Arduino Motor Shield
Bluetooth module
DC motor
Smart window app
Watch VIDEO for demonstration.
What is Arduino?
Upload the Code to Arduino
/*
Upload below code.
*/
char varVal;
void setup() {
//Setup Channel B
pinMode(13, OUTPUT); //Initiates Motor Channel B pin
pinMode(8, OUTPUT); //Initiates Brake Channel B pin
pinMode (7, OUTPUT); // Down LED
Serial.begin(9600); // Start serial communication at 115200bps
}
// UP @ full speed
void go_up() {
digitalWrite(13, HIGH); //Establishes UP direction of Channel B
analogWrite(11, 255); //Spins the motor on Channel B at full speed
digitalWrite(8, LOW);
}
// DOWN @
void go_down(){
digitalWrite(13, LOW); //Establishes DOWN direction of Channel B
analogWrite(11, 100); //Spins the motor on Channel B at full speed
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
}
void stop_window(){
digitalWrite(8, HIGH);
digitalWrite(13, LOW);
digitalWrite(7, LOW);
}
// Read serial port and perform command
void windowCommand() {
if (Serial.available()) {
varVal = Serial.read();
}
if (varVal == 'f') { // UP
go_up();
} else if (varVal == 'b') { // DOWN
go_down();
} else if (varVal == 't') { // Stop
stop_window();
}
}
void loop() {
windowCommand();
}
Build the Circuit
Connect all LED's as shown.
Green LED - for Window Shade Up
Red LED- for Window Shade to stop from moving
Yellow LED - for Window Shade Down
VCC - connect to 3.3V of Arduino board
GND - connect to GND of Arduino board
TX - connect to RX of Arduino board
RX - connect to TX of Arduino board
Watch VIDEO for circuit construction.
Download "Smart Window" App
Sub steps:
1. Install the Smart Window app to your Android phone.
2. Turn ON your Android phone's Bluetooth.
3. Scan for new Device (Bluetooth).
4. Pair BT by using Pin 1234.
5. Open your Smart Window app.
6. Select Device (look for BT name).
7. Press Connect.
8. Test your Circuit.
Watch VIDEO for pairing demonstration.
Customised Your Window Shade/Blinds
Sub Steps:
1. Attached the Motor Shield to Arduino Uno.
2. Connect the Bluetooth Module at the top of the Motor Shield.
3. Connect all the LED (optional)
4. Attach the DC motor to Channel B of Motor Shield.
5. Put a supply voltage 9-12V battery or power supply.
DC Motor & Window Blinds
1. Attach the gear to your DC motor or used old printer motor.
2. Connect the DC motor with gear to Window blinds at the top right side (some Window shades on top left).
3. Make sure to test manually by rotating the motor clockwise/counterclockwise.
Watch VIDEO for demonstration.