Introduction: Automatic Fan/Air Conditioning System

Receive! In this Instructable I will walk you through and through how to build your very ain smart Lover/Air conditioner System. This Instructable deals with a window fan, which is accustomed cool mastered rooms in the heat of summer. The finish of this project is to create a system that bequeath automatically monitor and regulate the temperature of a room by controlling a common window fan. To boot, the power to control the fan wirelessly with a smartphone will be implemented using a Esp8266/NodeMCU Wifi Growing board on with the IoT app, Blynk. The main control system utilizes an Arduino and a few other components. Rent's cause into it!

Pace 1: Gathering Components

For this Instructable, you will need:

- Arduino Uno (comes with USB data cable) - Buy out Here (Amazon) (other similar boards like the Arduino Mega will work as cured)

- 16x2 LCD Display (therein project, I use a display without a 16 pin module transcriber. If you have the adapter, Arduino has tutorials on how to wire the module adapter adequate to an Arduino Uno)

- DHT11 Temperature/Humidity Sensor (3 pin) - Corrupt Hera (Amazon) - there are two versions: a 3 personal identification number and a 4 trap. Here I use the 3 pin sensor equally it is easier to utilization and wire skyward because you don't have to add a resistor. Make sure to check the pinout of your sensing element, as different manufacturers have slimly different pinouts for this sensor.

- 10k Ohm Potentiometer - Buy Here (Amazon)

- 2 Pushbuttons - Buy Here (Virago)

- All-metal Gear Servo - Buy Hither (Amazon) - you do not take in to use a metal gear servo, as it all depends along your window fan. The servo will be used to move the turn on the buff, thusly it all depends on how often force is obligatory to move the switch. I use a beefy metal gear servo because my sports fan has a sturdy switch, and in general, metallike geartrain servos are way less prospective to break than veritable plastic gear servos.

- Male to Male & Male to Female Pinny Wires - Bribe Here (Amazon)

- Esp8266/NodeMCU Wifi Development Board - Purchase Here (Amazon)

- Blynk (Free mobile app disposable on App Store and Google Play)

- Micro USB Cable for programming Esp8266/NodeMCU

- Miscellaneous materials for constructing a device to allow the servomechanism to move the turn on the fan. (A fancy of my device testament be included further downcast)

Step 2: Wiring It All Up

The custom-built wiring diagram for the Arduino is shown above.

*IMPORTANT NOTE*

The DHT11 and Esp8266/NodeMCU both still have to be wired up to the Arduino. The servo likewise needs to atomic number 4 wired up to the Esp8266/NodeMCU.

Connections:

DHT11 ---> Arduino

VCC ---> 5v (happening breadboard)

GND ---> GND (along breadboard)

Signal (S) ---> Parallel Immobilise A0

____________________________

Arduino ---> Esp8266/NodeMCU

Digital Pin 8 ---> Digital Pin 3 (D3)

Digital Pin 9 ---> Appendage Pin 2 (D2)

____________________________

Servo Connections

Red Wire ---> 5v (on breadboard)

Black/Brown Wire ---> GND (happening bread board)

Yellow/Orange Wire ---> Digital Pin 0 (D0) on Esp8266/NodeMCU

Step 3: Programming the Arduino

The downloadable Arduino file out for the main Arduino electric circuit is located below.

*IMPORTANT*

Make sure you have the required libraries installed (dht11 and LiquidCrystal)

*If you already have both of these libraries installed (double hinderance, as in that respect are many a diametrical DHT11 libraries) then you can upload the Arduino code from the file in higher up to your Arduino*

To download the LiquidCrystal Library, in the Arduino IDE, click on Sketch, Include Depository library, and and so click on Manage Libraries. Wait for all of the libraries to load, and and so typecast LiquidCrystal in the research bar. It should be the low library to show up, by Arduino and Adafruit. (FYI this may already be installed, as this is one of the libraries that often comes inbuilt when you download the IDE. If it is, then just go to the next paragraph) Make sure it is the almost recent reading, and click Install. When it is through with installing, close out of the IDE.

To download the dht11 library, go Here, and click along the green button on the right that says "Clone or Download", and dawn "Download ZIP". A postal code file should follow downloaded to your twist. Open back up Arduino IDE and pawl on Sketch, Include Library, and Add .ZIP Library. Select the compressed ZIP lodge you just downloaded. Once the library has successfully been installed, close out of the IDE once many. Re-open information technology and navigate to the Custom_Fan_AC_System. Right away you can select your board and port and upload it to the Arduino.

Step out 4: Setting Up Blynk With the Esp8266/NodeMCU

Firstly, download the Blynk app from either the App Store (iOS) surgery the Google Play Stack away (Android).

Pioneer the app, and make an story. Create a New Project, and name IT Automatic Fan A/C System. Choose Esp8266 or NodeMCU for the gimmick (either should work). Take Wifi as the connection type. Then click "Create Cast". An authentication code should be created. That will be used later.

Now click on the screen (or swipe left) and a menu should pop up. Click on Styled Button, and record System Control as the name. For Pin, scroll to Digital and select D1. Slide the Mode from the Push to the Switch. For the off label, name it Room. For the on label, name it Mobile. And then click OK at the top right of the screen. Click on the screen door again to go to the card, and click slider. Name IT Fan Switch. For the Pin, scroll to Realistic and take V0. If the set range is from 0-1023, change the 1023 to 180. Then click OK at the top the right way. Click on the screen one lastly fourth dimension and scroll down until you see Segmented Switch. Get across "Add Option" and since my fan has three settings, Off, Depression, and Soaring, I named the first option Off, then Low, and then High-topped. DO NOT CONNECT THIS SWITCH TO A PIN. Place this switch below the slider. (the ground for this tack will get on clear later)

_____

There is one more library (possibly two) you need to install, and that is the Blynk library. Again, go into the Arduino IDE, to Sketch, Let in Subroutine library, then Library Manager. Search Blynk in the research box, and the 1 past Volodymyr Shymanskyy should come through. Download the current version and one time information technology is done, preclude of the IDE.

_____

Make destined you have the Servo library installed. IT is a assembled-in library for the IDE, thus it should be installed. The depository library is by Michael Margolis and Arduino. If IT is not installed, instal the latest version and exit out of the IDE.

_____

The Esp8266 needs to be setup inside the IDE. It is sooner simple, sporting open the IDE and go to File, Preferences, and in the Additional Boards Manager URLs box, typewrite in:

http://arduino.esp8266.com/stable/package_esp8266c...

So clack OK.

_____

Go to Tools, Panel, then Boards Managing director. Research for Esp8266. If it is not installed, install information technology and exit out of the IDE once many.

_____

Open up the IDE, and plug your Esp8266/NodeMCU into your device with the Little USB Cable television service. Make sure the Arduino Uno is unplugged. Go to Tools and select the available port wine, and for the Board, choose NodeMCU 1.0 (Esp-12E Module).

_____

Download the file for the Esp8266/NodeMCU above, and take through and through my comments and fill in the necessary entropy. Once that is done, upload information technology to the board.

Step 5: Constructing the Servo/Lover Switch Device

Here I will show you how I constructed a gimmick to allow the servomechanism to switch the fan between Low, High, and Off.

I used a piece of clear tubing that fit snugly around the switch of my fan, and I used Lego Technic pieces to produce an arm with a slippery material possession mechanism that would mount under the windowpane, just the likes of the fan. This all depends on your buff and the setup of the elbow room. I have a desk near the fan, so I can antimonopoly mount it to something on the desk. If you do not get a solid nonmoving object neighboring the window, you May need to attach the servo to the sports fan directly.

The Lego arm can move back freely for a certain outdistance, a distance that allows for the replacement to move fully from end to goal. I also adorned a Lego set put together to the servo trumpet by using some small screws and brass adapters that came with the servos. I did not powerfully bonded the Lego arm around the tube that is on the switch because the switch needs to move freely enough because the lean on of the tube changes due to the switch being a hemicycle. I just made a Lego box around the switch then the arm would not have trouble turning the fan connected and off. There is a video below that you can download and watch that shows the arm up close and how it moves the switch. On to testing!

Step 6: Examination & General Explanation of Task

I definite to take this project after my blood brother and I repeatedly disagreed on the temperature of our room. I like the fan on a great deal so the room is very cool, and he ends up turning off the fan a lot of the time, saying that it is too cold. Additionally, when information technology is tasty taboo, I sometimes forget to turn the fan connected when I'm non in the room, and when I go capable sleep the board is so hot, and I have to trip out the buff then, which doesn't alteration the temperature fast enough for a good sleep out. So I part to brand a arrangement that can wor the problem.

_____

This system has deuce elements: the Automatic Partly and the Manual Part

The Automatic Part is controlled aside the Arduino, where it constantly takes the temperature and displays it on the LCD screen. The Arduino also uses the cardinal pushbuttons to adjust the desired temperature of the board. In Automatic Mode, or Room Mode, the Arduino turns on the buff when the desired temperature is lower than the actual temperature. When the craved temperature is reached, it turns unsatisfactory the fan. The Blynk App is used to control the livelong organization, as the button can turn the fan into Elbow room Mood and into Mobile Mode, which allows for the user to control the servo and the fan remotely. When in Mobile River Mode, the user uses the slider to control the servo. The Arduino still keeps displaying the Current Temperature and the Desired Temperature on the LCD.

_____

Testing:

Once you bear uploaded the code onto both the Arduino and the Esp8266/NodeMCU and created a way for the servo to control the rooter alternate, you have to turn everything on. Power improving the Arduino and Esp8266/NodeMCU (whether that be through USB, a 5v source, etc.) and wait few seconds until everything is sexy. Then unenclosed the Blynk app and enter the project screen and hit the play button at the top right. It should be joined to the Esp8266/NodeMCU. Click the pushbuttons to piss sure they adjust the desired temperature, and make sure the LCD also changes with it. In the Blynk app, flick the switch so the system is in Mobile Mode. Then incite the slider and dismission it and you should hear the servo move (to the emplacement of the number of degrees that the skidder shows. If it doesn't show the value, enter the slider and check the switch that says "Record Value"). Move the slider around until you get the exact numbers that move the control system sol your fan turns on and off. Enter these numbers into the Arduino code. * I only programmed in the low and off settings, even off though mine has a high setting, every bit the double-bass background is powerful enough * Rhenium-upload the code to the Arduino.

The purpose of the segmented switch underneath the slider is to display the values for the settings on the fan, since you will be controlling remotely with the slipper. I changed the name of my options to

Alternative 1. Inactive - (value)

Alternative 2. Low - (measure)

Option 3. High - (value)

This way I know where to put the slider when I am controlling the fan remotely. You should get into your servo values into the options so you know where to move the slider. Then you can switch the Arrangement backrest into Room (Automatic) Mode.

____

Once that is through with. just set the desired temperature of the way with the two pushbuttons, and the Arduino system will do the work!

//

If you have any questions/problems, smel free to drop them down below and I'll be happy to help you out! :)

Be the First to Share

Recommendations

  • Anything Goes Contest 2022

    Anything Goes Contest 2022