Project tutorial
Control a Fan with Your Mobile Phone

Control a Fan with Your Mobile Phone © CC0

I want to show you how to control your room's fan with just your mobile phone and also you can use the same idea to control all house fans.

  • 10,212 views
  • 0 comments
  • 4 respects

Components and supplies

About this project

How I made it

  • Install 1sheeld app on your android smart phone
  • Connect 1sheeld board to Arduino Uno board
  • Connect LED to pin 13 and ground
  • Connect fan Vcc to pin 6 and G to ground of the test board.
  • Connect temperature sensor to pin A0 as shown
  • Upload (1sheeld Slider library) into Arduino IDE
  • Write the code on Arduino IDE
  • Connect Arduino board to PC and upload the code into Arduino board
  • Connect power source to Arduino board (USB cable OR Battery)
  • Take care about upload mode and running mode on the 1 shield board
  • Connect 1sheeld mobile app to 1sheeld board
  • Open the serial monitor from Arduino IDE to see the change in the temperature
  • Select the required tool from 1sheeld mobile app (Slider).
  • Make a hot temperature beside the temperature sensor to light up the LED once it reach to 30 degree
  • Move the slider UP and Down and notice the change in the speed of the fan

Finally this video describes the project. Thanks and any comments are welcome.

Code

Control room's Fan by your mobile phoneArduino
Upload the code on Arduino IDE, then burn it to Arduino board.
/*Write the code on the Arduino program and upload it to the Arduino.*/

#define CUSTOM_SETTINGS

/* Include 1Sheeld slider library. */

#define INCLUDE_SLIDER_SHIELD

/* Include 1Sheeld library. */

#include

/* Define a variable to hold the value of the slider. */
int value;

/* A name for the fan on pin 3. */
int MotorPin = 3;

int LedPin=13;

int TempLevel;

/* A name for the temperature sensor LM 35 on pin A0. */
const int TempSensor=A0;

void setup()

{

/* Start communication. */

OneSheeld.begin();

/* Set the motor pin as output. */
pinMode(MotorPin,OUTPUT);

/* Set the LED pin as output. */

pinMode(LedPin,OUTPUT); }

void loop()

{

/* Read analogvalues from temprature sensor */
TempLevel=analogRead(TempSensor);

TempLevel=TempLevel*0.4828125;

/* Print the temperature on the serial monitor */

Serial.print("Temprature = ");

Serial.print(TempLevel);

Serial.print("C");

Serial.println();

if(TempLevel>30)

{

digitalWrite(LedPin,HIGH);

}

/* Always get the value of the slider and output it as PWM to pin 3 to control the fan speed . */

value = Slider.getValue();

analogWrite(MotorPin,value);

}
CREDITS

Schematics

Control room's Fan by your mobile phone
Use fritzen as a simulation tool
13321150 10206961112289418 1119285043 o

Comments

Similar projects you might like

Control a Fan with Your Mobile Phone

Project showcase by Khloud Mohamed

  • 4,265 views
  • 0 comments
  • 7 respects

Control your Light System Using Smart Phone

Project tutorial by Ahmed Yassin

  • 58,107 views
  • 7 comments
  • 71 respects

Voice Controlled Robot using your Smart Phone

Project tutorial by Ahmed Yassin

  • 6,663 views
  • 0 comments
  • 13 respects

How To Control Arduino From Mobile Phone

Project showcase by lubosrusnak

  • 18,827 views
  • 0 comments
  • 14 respects

Control Robot Arm with your Android Phone

Project tutorial by Ammar Atef Ali

  • 16,946 views
  • 0 comments
  • 27 respects

Universal Remote Control using Arduino, 1Sheeld and Android

Project tutorial by Ashraf Nabil

  • 11,107 views
  • 5 comments
  • 18 respects
Add projectSign up / Login