In this tutorial we will show how to build WiFi fan controller. Fan controller is connected to internet and EasyIoT Cloud over WiFi. For this purpose we will use ESP8266. Controller can monitor temperature and in case of temperature increase power on the fan.
Main ESP8266 fan controller features:
- WiFi connected
- 12V fan output
- temperature monitor
- set fan switch on temperature
- WEB and mobile application
- Connected to EasyIoT Cloud
- ESP8266 WEB configuration page
-ESP8266 WiFi module
|ESP8266 Lua Nodemcu WIFI Network Development Board|
-DS18B20 Dallas temperature sensor
|DS18B20 DALLAS Temperature Sensor|
-12V 3Pin DC Brushless PC Computer Case Cooling Fan
|12V 3Pin DC Brushless PC Computer Case Cooling Fan|
-N-Channel MOSFET (IRLZ44N)
|N-Channel MOSFET (IRLZ44N)|
-Resistors 220M, 4.4K, 1K
|400X 0.25w 1/4w Metal Film Resistor Pack Kit 1% 20 Value Each 20 Pcs 10 ~ 1M ohm|
|10Pcs 5 x 7 cm DIY Prototype Paper PCB|
|10Pcs AMS1117-3.3 LM1117 3.3V 1A SOT-223 Voltage Regulator|
|210Pcs 25 Value 0.1uF-220uF Electrolytic Capacitors Assortment Kit Set|
-12V 1A/2A Transformer Travel Power Supply Adapter US EU UK Plug
|12V 1A/2A Transformer Travel Power Supply Adapter US EU UK Plug|
See buying guide at the end for details and please shop in our store to support EasyIoT framework.
For simplicity reasons we will use ESP8266 NODE MCU, but you can use any other type of ESP8266.
ESP8266 uses 3.3V power supply, computer fan 12V. In our case we will use 12V power supply and add additional 3.3V AMS1117 regulator to step down voltage to 3.3 V. See power supply in our store.
We connect GND and 3.3V output of regulator to ESP8266 GND and 3.3V pin.
DS18B20 Dallas temperature sensor
DS18B20 is powered by 3.3V, digital output is connected to ESP8266 D2 pin. We also use 4.7K pull up resistor.
Computer fan is powered by 12V AC. There are 3 and 4 pin connection versions. In our case we will use only 2 pins GND and 12V VCC. Fan is controlled by MOSFET IRLZ44N connected to ESP8266 D1 pin.
Computer fan pinout
Additional libraries are here: lib.
ESP8266 source program
Before you upload program to ESP8266 it's recommended to change those lines:
#define AP_SSID "xxx"
#define AP_PASSWORD "xxx"
#define EIOTCLOUD_USERNAME "xxx"
#define EIOTCLOUD_PASSWORD "xxx"
If you forget to change those settings you can press FLASH button non ESP8266 NODE MCU module. ESP8266 will go in config mode. This means it works as access point with configuration server. After you press FLASH button use mobile phone and search or AP (access points) available nearby. Connect to access point with name Device xx-xx-xx-xx-xx. xx-xx-xx-xx-xx are some random letters. After you connect to AP open web browser and enter IP address 192.168.1.4. If you done everything correct browser opens config page:
After you enter correct data press submit button and ESP8266 will restart with new settings.
Configure EasyIoT Cloud
No manual configuration is needed. Program will automatically add new module to EasyIoT Cloud. First you need to register to EasyIoT Cloud.
See more tutorials at http://iot-playground.com/build
To support this site and EasyIoT framework development please buy in our store.