Automatic and Remote Control Pedestal fan Arduino (smart fan)
Hello everyone. In today’s project tutorial, Automatic and Remote Control Pedestal Fan Arduino (smart fan), we will be answering the following questions.
Have you ever wondered if you could turn your home-standing fan into a smart fan?
Do you want to be able to control your pedestal fan using a remote control? perhaps add a display screen?
Do you want to see the temperature of your room displayed on this fan? Or perhaps you want to use the room temperature to control the speed of the fan?
Won’t it be awesome to reverse engineer your pedestal fan and build an automatic and remote control pedestal fan Arduino (smart fan) that would use the room temperature in the room to automatically control the speed of the fan and then lets you control the fan speed at your own will with just any remote control lying around?
Well, it is very possible and we will do this project tutorial today. Well stay tuned and ensure you read to the end because in this tutorial: we will be discussing how to achieve all of these functionalities inside the automatic control fan. But first, a brief introduction.
What is a Pedestal Fan?
This is an electric and oscillating fan supported by an adjustable, detachable stand with its head above the surface and is adjustable. The sole function of this is to circulate cool breeze around our room. The downside of this electrically powered fan is that its speed regulator control is manually operated.
What Is Home Automation?
Home automation is a step toward what is referred to as the “Internet of Things,” it is fun to build and easy if you have the right tools. Home automation is an aspect of IoT called domotics. There are a plenty variety of home automation systems that are available out there and these are equipped with making one’s life easier and more comfortable. Some popular home automation systems include:
-A home security system that is responsible for monitoring your home and will send out alerts if there is an issue, like a broken window or a theft
-An energy management system also helps in saving money spent on energy consumption by simply turning off the devices when they are not in use and adjusting the temperature regulators like thermostats.
-A home entertainment system that can allow one to control his/her home’s lighting, music, and television from any location. These and so many others.
However, for this project tutorials, our focus is the use a traditional standing fan, a temperature sensor, an Arduino board (standalone version), a TV remote, and other modules to build a smart fan that can measure accurately the temperature of the room, control the speed of the fan in “Auto Mode” using this temperature ranges while offering the user the choice to still override this using a TV remote control to set their own fan speed. Enough said already; let’s dive into designing the project.
Components parts for Automatic and Remote Control Pedestal fan Arduino (smart fan)
Power Supply rated 5V, ≥ 2A or you can build your own here
16MHz crystal oscillator (Newark part number 16C8140)
10nF capacitors
A 10kΩ pull-up resistor
A reset push button.
Dallas temperature sensor DS18B20, maxim part number, 1534C4:
A 4.7KΩ pull-up resistor
Infrared receiver TSOP1738
IR remote controller or any old TV remote(that’s an IR Transmitter)
560Ω 5-band resistor
1µF ceramic capacitor
Generic jumper wires: male and female type.
16 × 2 Liquid Crystal Display
10KΩ potentiometer (trimmer)
56OΩ precision resistor
LCD connector wires’
Header pins
5V 4-channel Relay Module
A standing fan
What is an Infrared (IR) Signal and an IR Receiver Module?
Infrared radiation that produces Infrared signals or radiations (IR) are actually beams of light, it is that portion of the electromagnetic spectrum that extends from the long wavelength, or red, end of the visible-light range to the microwave range. Invisible to the eye, it can be detected as a sensation of warmth on the skin. Most of the radiation emitted by a moderately heated surface is infrared; it forms a continuous spectrum. Molecular excitation also produces copious infrared radiation but in a discrete spectrum of lines or bands. Everything which produce heat, emits infrared like our human body. Infrared have the same properties as visible light, like it can be focused, reflected and polarized like visible light. IR devices are those photonic components that contains semiconductor materials that are sensitive to IR radiations. They are divided into IR transmitter Light Emitting Diode (LED) and IR Receivers.
IR receiver is a sensor that is responsible for capturing the IR signal sent out by the IR emitter or in the case of this project the home TV remote. This exact part used here is shown in the component list to be the common TSOP1638. It has 3 pinout configuration and can be used either with a programmable device or non-programmable device. In this Automatic and Remote Control Pedestal fan Arduino (smart fan) project, it is used with a programmable microcontroller Atmega328P chip.
Configuring the IR Receiver Using Arduino.
The IR Receiver TSOP1738 pinout
This component as earlier mentioned, is the famous infrared receiver TSOP1738 that has three terminals with the Pin 3 connected to the HIGH of the PSU (+5 Vcc) supply and the Pin 2 connected to the ground terminal(or LOW) of the PSU while the Pin 1 is the output pin. It is called the data pin (or terminal) Do. To stop the sensor (TSOP1738) from sending fluctuation signals to the MCU due to IR impulses from random sources, a very low capacitive capacitor is connected from the data pin to the ground. This is between 100nF to 33µF. This is shown below.
Decoding HEX Value Codes From the IR Receiver on Automatic and Remote Control Pedestal fan Arduino (smart fan) project.
Since this project isn’t based on a non-programmable Remote Control Home Appliance, there is a need to show the IR signals received by the Arduino on the serial monitor. The connection is shown above and the components are assembled on a breadboard.
A Brief Explanation Of Hex Codes.
The Decimal number system is also known as Base 10, since it’s comprised of ten numerals (symbolized by 0 through 9). Although we can only represent up to the number 9 by a single decimal digit, it’s possible to reference up to ten items by using zero ( 0) as an index to refer to the first ( 1st) item; thus, the numeral 9 would refer to the tenth ( 10th) item. With two digits we can refer to 100 items (zero through 99). In terms of the number of digits, 10 n (where n is the number of digits) equals the maximum number of items we can refer to. Therefore, the decimal equivalent of the largest binary number we can represent in 6 bits ( 111111 ) can be found as the sum of the first six powers of 2; starting with 2 to the power of zero (2 ^0): 20 + 21 + 2 2 + 23 + 24 + 25 = 1 + 2 + 4 + 8 + 16 + 32 = 63.
Or, by simply using the formula: 2n – 1 = 64 – 1 = 63.
To convert any binary number to hexadecimal, that is, base 16, simply order the bits into as many four-bit groups as possible, from the least significant position to the most significant position with any remaining group of only 3, 2, or 1 bits at the far left. Then convert each group to a single hex digit of 0 through 9 or A through F . So, to convert our 6-bit number of 111111 (63 decimal) to hex, we simply group the bits as: 111111 which is easily converted to: 3F hex. An 8-bit or 1-byte hexadecimal number can contain a maximum value of 255 decimal. A 10-bit binary number cannot exceed: 11 11111111 or 3FF or 1023 decimal. But, the maximum number of Cylinders we can reference in 10 bits is 1024, since we begin counting from zero.
A 32-bit unsigned integer value can be from 0 to 2(32-1). That is, from 0 to 2147483647. Similarly, 64-bit unsigned integer value can be from 0 to 2(64-1). Now, 32-bit hex value can be from 0 to 0x7f f f f f f f There will be only 8 digits i.e. 7 f f f f f f f because 1 digit corresponds to 4 bit. Hence 8 digits correspond to 8×4 = 32 bits. So, this means the digits which are followed by 0x are hexadecimal. There are two important aspects to the beauty of using Hexadecimal with computers: First, it can represent 16-bit words in only four Hex digits, or 8-bit bytes in just two.
Program Code to Decode the IR Signals off the Remote Controller
//include the IR remote library
#include <IRremote.h>
//state the IR input to the MCU
#define RECV_PIN A1
//make it recognised to IR Lib
IRrecv irrecv(RECV_PIN);
//ask it it get results and save it
decode_results results;
void setup() {
//enable the IR
irrecv.enableIRIn();
}
void loop(){
if(irrecv.decode(&results)) {
irrecv.resume();
//print the remote results in HEX codes
Serial.println(results.value, HEX);
}