DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modern Digital Website Security: Prepare to face any form of malicious web activity and enable your sites to optimally serve your customers.

Containers Trend Report: Explore the current state of containers, containerization strategies, and modernizing architecture.

Low-Code Development: Learn the concepts of low code, features + use cases for professional devs, and the low-code implementation process.

E-Commerce Development Essentials: Considering starting or working on an e-commerce business? Learn how to create a backend that scales.

Related

  • Everything You Need to Know and Do With Load Balancers
  • Securing VMs, Hosts, Kubernetes, and Cloud Services
  • DevOps vs. SRE vs. Platform Engineer vs. Cloud Engineer: Substance or Semantics?
  • How to Get Started With the Smart Parking

Trending

  • AI in Java: Building a ChatGPT Clone With Spring Boot and LangChain
  • Data Privacy and Security
  • IoT Cloud Computing in IoT: Benefits and Challenges Explained
  • Master the Art of Data Security: A Complete Guide To Securing Data at Rest on Amazon S3
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. ESP8266 Wi-Fi Fan Controller

ESP8266 Wi-Fi Fan Controller

Learn how to build a Wi-Fi-capable fan controller. For this project, we'll use EasyIoT Cloud and assorted hardware to build a temperature-sensing fan.

Igor Jarc user avatar by
Igor Jarc
·
Mar. 22, 18 · Tutorial
Like (3)
Save
Tweet
Share
26.0K Views

Join the DZone community and get the full member experience.

Join For Free

In this tutorial, we will show how to build Wi-Fi fan controller. The fan controller is connected to the internet and EasyIoT Cloud over Wi-Fi. For this purpose, we will use an ESP8266. The controller can monitor temperature and, in case the temperature increases, power on the fan.

Main ESP8266 Fan Controller Features

  • Wi-Fi connected
  • 12V fan output
  • Temperature monitor
  • Fan switch based on temperature
  • Web and mobile application
  • Connected to EasyIoT Cloud
  • ESP8266 WEB configuration page



Materials

  • ESP8266 Wi-Fi module

  • DS18B20 Dallas temperature sensor

  • 12V 3Pin DC Brushless PC Computer Case Cooling Fan

  • N-Channel MOSFET (IRLZ44N)

  • Resistors 220M, 4.4K, 1K

  • Prototype PCB

  • AMS1117-3.3V regulator

  • 220uF capacitor

  • 12V 1A/2A Transformer Travel Power Supply Adapter US EU UK Plug

Build

For simplicity, we will use ESP8266 NODE MCU, but you can use any other type of ESP8266.

Connections

Power Supply

ESP8266 uses a 3.3V power supply and 12V computer fan. In our case, we will use 12V power supply and add an additional 3.3V AMS1117 regulator to step down the voltage to 3.3 V. 

We connect the GND and the 3.3V output of the regulator to the ESP8266 GND and 3.3V pin.

DS18B20 Dallas Temperature Sensor

DS18B20 is powered by 3.3V, and the digital output is connected to the ESP8266 D2 pin. We also use a 4.7K pull up resistor.

Computer Fan

The 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. The fan is controlled by a MOSFET IRLZ44N connected to the ESP8266 D1 pin.

IRLZ44N pinout

Computer fan pinout

Source Code

Additional libraries are here: lib.

ESP8266 Source Program

The ESP8266 source code can be found on GitHub. Upload the program with ESP8266 Arduino IDE.

Before you upload the program to the ESP8266, it's recommended to change these 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 the FLASH button on the ESP8266 NODE MCU module. The ESP8266 will go into config mode. This means it works as an access point with the configuration server. After you press the FLASH button, use a mobile phone and search for AP (access points) available nearby. Connect to the access point with the name Device xx-xx-xx-xx-xx. xx-xx-xx-xx-xx will be some random letters. After you connect to the AP, open a web browser and enter the IP address 192.168.1.4. If you did everything correctly, the browser opens a config page:

ESP8266 config page
ESP8266 config page

After you enter the correct data, press the submit button and the ESP8266 will restart with the new settings.

Configure EasyIoT Cloud

No manual configuration is needed. The program will automatically add the new module to EasyIoT Cloud. First, you need to register to EasyIoT Cloud.

Cloud Computer Mobile phone mobile app Upload Connection (dance) Monitor (synchronization) Build (game engine)

Published at DZone with permission of Igor Jarc, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Everything You Need to Know and Do With Load Balancers
  • Securing VMs, Hosts, Kubernetes, and Cloud Services
  • DevOps vs. SRE vs. Platform Engineer vs. Cloud Engineer: Substance or Semantics?
  • How to Get Started With the Smart Parking

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: