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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
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

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Upgrade Your Hobbyist Arduino Firmware To Work With STM32 For Wider Applications
  • How to Stream Sensor Data to Apache Pinot for Real Time Analysis
  • How To Check Tuya Library in Arduino IDE

Trending

  • Unlocking AI Coding Assistants Part 1: Real-World Use Cases
  • Emerging Data Architectures: The Future of Data Management
  • Understanding Java Signals
  • Doris: Unifying SQL Dialects for a Seamless Data Query Ecosystem
  1. DZone
  2. Data Engineering
  3. IoT
  4. ESP8266 WiFi Touchscreen Thermostat

ESP8266 WiFi Touchscreen Thermostat

Learn to make your own touchscreen thermostat controlled by WiFi with this guide to the parts and code required to build it from scratch.

By 
Igor Jarc user avatar
Igor Jarc
·
Jun. 23, 17 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
11.3K Views

Join the DZone community and get the full member experience.

Join For Free

in this tutorial, we will show how to build a wifi touchscreen thermostat. this esp8266 wifi touchscreen thermostat is an example of complex sensor build by esp8266, arduino mega 2560 and tft 3.2" touch screen display. the thermostat is connected to easyiot cloud and can be controlled over the internet.

main features

  • 6 modes - auto, off, lolo, lo, hi, hihi.
  • touchscreen.
  • wifi connected.
  • four set temperatures (lolo, lo, hi, hihi) and weekly schedule.
  • time display.
  • additional data display - temperature in another room, air pressure, and weather forecast.
  • connected to easyiot cloud and can be controlled in a web interface or native mobile application over the internet.

materials

-arduino mega 2560 $9.97, $8.68

-esp8266 wifi module

esp8266 esp-01 serial wifi wireless transceiver module $2.19, $17.00

esp8266 esp-03 serial wifi wireless transceiver module $2.07, $2.15

esp8266 esp-12 serial wifi wireless transceiver module $2.08, $1.95

esp8266 esp-05 serial wifi wireless transceiver module $1.88, $3.89

esp8266 esp-07 serial wifi wireless transceiver module $2.18, $1.87

-bmp180 digital barometric pressure sensor

bmp180 digital barometric pressure sensor $1.59, $1.49

-dht22 digital temperature and humidity sensor

dht22 digital temperature and humidity sensor $2.72, $2.52

-1 channel isolated 5v relay module

1 channel isolated 5v relay module $1.34, $0.58

-rtc ds1302 real time clock module

rtc ds1302 real time clock module $0.99, $0.84

-3.2" tft lcd module touch panel+ tft 3.2" lcd shield expansion board for arduino

3.2 tft lcd + 3.2 tft lcd shield $22.99, $16.77

build

connections:

arduino mega 2560 tft display

this is easy, because we will use a shield. just put the tft 3.2" lcd shield expansion board and 3.2" tft lcd module touch panel on top of the arduino mega 2560.

esp8266

esp8266 is used as the wifi gateway to easyiot cloud. it is loaded with firmware written in arduino ide. in this case, we will use hw serial1 on arduino mega 2560 to connect the module. follow it to connect the esp module to the arduino. the arduino serial1 rx pin is 19, tx 18 and the reset pin is 12. for the 3.3v power supply, we will use the 3.3 v from the tft shield expansion board. see the picture below for where to connect the 3.3 v.

bmp180

arduinobmp180 module vcc vcc gnd gnd 20 sda 21 slc

dht22

arduinodht22 vcc 1 vcc gnd 4 gnd 8 2 data

relay module

the relay module input is connected to pin 51 on the arduino. we also connect vcc and gnd.

rtc ds1302

arduinods1302 vcc vcc gnd gnd 11 ce 10 io 9 clk

source code

additional libraries are here .

esp8266 source code can be found on github . upload the program with the esp8266 arduino ide . if you are using esp-01, then keep debug in the comments. to enable debug to use the esp8266 node mcu, which allows one additional software serial.

the arduino mega 2560 program is available on github .

before you upload the program to the arduino, it is recommended to change the following lines:

#define default_ap_ssid "xxxx"
#define default_ap_password "xxxx"
#define default_cloud_username "xxxx"
#define default_cloud_password "xxxx"

set the access point name and password and easyiot cloud username and password. you can later set those settings on the thermostat touch screen (settings->wifi cloud), but it's easier to change it in the program. the program will automatically add the thermostat to the easyiot cloud and configure the module parameters. of course, you need to register to easyiot cloud first.

configure easyiot cloud

automation

our thermostat also shows the temperature and humidity in another room and outside. first, add those modules to easyiot cloud. add three automation programs to forward the value of the sensors (temperature 1, humidity 1 and temperature 2) to the thermostat. in automation (configure->automation), add a new program and select the program type to "forward value." then select the appropriate module and parameter to forward values. the thermostat parameters are as follows:

sensor.parameter4 - temperature 1

sensor.parameter5 - temperature 2

sensor.parameter6 - humidity 1

future improvements

this is the first version of the thermostat. for future versions, there is an idea to add multiple zones to the thermostat. also, the display graphic design is basic. if we use an sd card attached to the tft display, we can create screens with nice graphics.

arduino

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

Opinions expressed by DZone contributors are their own.

Related

  • Upgrade Your Hobbyist Arduino Firmware To Work With STM32 For Wider Applications
  • How to Stream Sensor Data to Apache Pinot for Real Time Analysis
  • How To Check Tuya Library in Arduino IDE

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • 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:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!