Smart Fan
Smart Fan
The assignment of this week to Design and program a smart device that perform a certain function or solve a problem: program Arduino UNO to read signals from multiple input components (Sensor, Switch, or variable resistor) to control multiple action components (Motor, Buzzer, LED...etc) using Arduino C (Text Code).
When the whether get Hot we need a fan and it will be great if it a smart fan reads the degree and turn on and off and change its speed automatically .
I will Make a Personal Desk Fan Degree Rotation 3 Speeds according to the distance of the person from it
when the person is closer the speed of fan becomes slow and when he get farther the speed get faster and faster until he not exists near it the fan stops.
Software :
1- TinkerCad Portal : to build and simulate the circuit online
2- The open-source Arduino Software (IDE) : to write code and upload it to the Arduino board.
Materials :
1- Breadboard
2- Jumpers to connect the component
3- Arduino Board + USB cable
4- Three resistors 220 Ohm.
5- one resistors 10K Ohm.
6- Ultrasonic Sensor
7- LCD Liquid Crystal I2C
8- DC motor
9- DC Motor Driver (L298 Module)
10- LDR Module
11- Three LEDs
12- 9V adapter
13- On/Off switch
Tinkercad portal
Arduino IDE
Step 1 : Test Ultrasonic Sensor
Design a circuit of Arduino board and Ultrasonic Sensor as shown in the picture.
Make it in actual Arduino Board and Breadboard.
then write a c code to show the Value of the sensor in the serial monitor.
Component of Ultrasonic Sensor Circuit
Code image of ultrasonic with Serial Monitor
Ultrasonic Sensor Circuit
Circuit of Ultrasonic Sensor
Video of ultrasonic with Serial Monitor
Step2 :
add a LED and resistor 220 Ohm to the circuit and write C code take the input from ultrasonic sensor , The LED will turn on if any object become in distance less than 10 cm from the sensor and turn off if the distance become more than 10 cm.
Component of Ultrasonic Sensor Circuit
Code image of ultrasonic with LED
Ultrasonic Sensor simulation
Ultrasonic Sensor and LED Circuit
Video of ultrasonic with LED
Step 3 :
add 2 more LEDs and 2 resistors 220 Ohm to the circuit and write C code
If any object in a distance less than 5cm from the ultrasonic sensor the LED1 turn on.
and if the distance more than 5 cm and less than 10 cm the LED1 and LED2 turn on.
and if the distance more than 10 cm and less than 15 cm the LED1 , LED2 and LED3 turn on.
and if distance more than 15 cm a the LED1 ,LED2 and LED3 turn off.
Code of Ultrasonic Sensor and 3 LEDs
Circuit of Ultrasonic Sensor and 3 LEDs
Circuit of Ultrasonic Sensor and 3 LEDs
Step 4: Test DC motor and Driver
Design a circuit of a DC Motor with a DC Motor Driver (L298 Module) and 9v Adapter as Power source as shown in the picture.
Do it in actual component.
Write a C code to test a multiple speed ( 3 Speeds ) of the DC motor ( 50 , 100 , 250 )
Code image of ultrasonic with Serial Monitor
Circuit of DC motor and L298 Driver
Circuit of DC motor and L298 Driver
Video of DC motor and L298 Driver
Step 5 : Test LCD Liquid Crystal I2C
Design the circuit from Arduino Uno and LCD Liquid Crystal I2C as shown in the picture.
Use the Example of "Hello World" in Arduino IDE to test the LCD and it works fine.
insert LCD Liquid Crystal I2C Library
the code of "Hello World" Example
Circuit of LCD Liquid Crystal I2C
LCD Liquid Crystal I2C
Circuit LCD Liquid Crystal I2C
Step 6 : Test LDR Module
Design the circuit from Arduino Uno and LDR Module as shown in the picture.
Write a C Code to Use the LCD Liquid Crystal to show the value of LDR in Celsius degree.
Code of LCD Liquid Crystal and LDR
Circuit of LDR Module
LCD show the value of LDR in Celsius degree.
Step 7 : Integration :
integrate the DC Motor Circuit with Ultrasonic sensor and 3 LEDs Circuit.
Write a C code to do :
If any object in a distance less than 5cm from the ultrasonic sensor the LED1 turn on and the DC motor turn on in speed 50.
and if the distance more than 5 cm and less than 10 cm the LED1 and LED2 turn on and the DC motor turn on in faster speed 100.
and if the distance more than 10 cm and less than 15 cm the LED1 , LED2 and LED3 turn on nd the DC motor turn on in fastest speed 255.
and if distance more than 15 cm a the LED1 ,LED2 ,LED3 and the DC motor turn off.
Code of ultrasonic and DC motor and LEDs circuit
DC Motor Circuit with Ultrasonic sensor and 3 LEDs Circuit.
ultrasonic and DC motor and LEDs circuit
Step 7 :Enclosure
to make the enclosure i get a small Cardboard Box to insert the electrical component in it .
Cardboard Box
Take dimensions of the LCD liquid Crystal
prepare the LDR module
Put the LCD and LDR in its places in the cardboard
Put the Ultrasonic sensor in the cardboard
integrate the LDR &LCD circuits in the enclosure
integrate the Motor & LEDs circuits in the enclosure
Step 8 :The Final circuit and the final smart fan.
integrate the all component of smart fan as shown in the shown picture.
then Write the final Code as shown Below
to do the last actions and show the degree Celsius in LCD.
The final Code of smart fan
Video of final Smart Fan
The smart Fan complete Circuit
The smart Fan
Final Smart Fan
We divided into teams , I participate with Michael Henry in a programming activity to program a Smart Temperature Indicator circuit using Arduino C Language.
We helped each other in writing the code from scratch and line by line and after Write the code we found some error in the syntax of the code and we practice to find the bugs in the code and it was fantastic time .
thanks for him and to our instructor Amani Ayman for helping me to Write and find the errors in our code.
I will use the Ultrasonic Sensor and DC motors and Motor Driver (L298 Module) circuits and code it with C code in the final project.
Automatic garage door by password
after watching EOweek Self-Practice Videos I made a small Project of an automatic garage door open when we write the correct password in a keypad and a green LED turn on and when we write a wrong password in the keypad a Red LED turn on and the door not opened
as shown in the video.
Video of Automatic garage door
Title of Media