Home Heat Hub

CHAPTER 2 – DESIGN OF THE HOME HEAT HUB

2.1 Introduction

The chosen design is based on the Nano MCU with ESP8266 used only as a wireless interfacing
medium. The Home Heat Hub will communicate with the EasyIoT web server which for demonstration
purposes will be hosted on a local Windows machine.

2.2 Hardware Design

2.2.1 Hardware Schematic

Home Heat Hub Schematic
Figure 2-2-1 – Home Heat Hub Schematic

2.2.2 MCU – Nano V3.0

The MCU will utilise 4 digital pins and 3 analogue pins.
GPIO 2 & 3 – used as Rx & Tx respectively for serial communication between the MCU and the
ESP8266.
GPIO 6 – Digital out pin used to control the heating relay.
GPIO 7 – Digital read pin for reading temperature and humidity from DHT22.
GPIO A0 – Analogue pin with pull-up resistor enable for 4 button/resistor configuration.
GPIO A5 – Analogue Data line used as SDA for I2C communication with LCD.
GPIO A6 – Analogue Clock line used as SCL for I2C communication with LCD.

2.2.3 Voltage Regulator

The voltage regulator is required for providing a stable 3.3v supply to the ESP8266. A Separate 5v
500mA DC supply is required to ensure no over-current draw from the ESP.

2.2.4 ESP8266

The wireless module is not 5v tolerant, the transmit line from the Nano (A 5v MCU) must be reduced
by implementing a potential dividing circuit. By using a 1K and 2K resistor the voltage at the ESP Rx pin
is dropped by 1/3. No level shifting is required for the Tx from the ESP as the Nano will detect the 3.3v
as a logic 1.

Potential Divider Circuit
Table 2.2.3 – ESP 8266 Potential Divider Circuit

2.2.5 1602 LCD + I2C Interface

The LCD module has 16 connections, 8 of which are data lines. Initial testing was carried out with the
module in 4-bit configuration. Control of the backlight was a requirement therefore an additional GPIO
was used in conjunction with an NPN transistor to control the ground connection of pin 16.
This configuration was tested with Python and Arduino libraries and performed well on both devices.
The number of GPIOs used was problematic hence further investigation was carried out with
reference to an I2C/TwoWire interface for the LCD module.
Using an I2C interface the LCD module is able to operate as required with full control of backlight and contrast by using only data and clock lines from the MCU.

LCD with I2C Interface
Figure 2.2.4 – LCD with I2C Interface

2.2.6 DHT22 Temperature/Humidity Sensor

The temperature sensor has 4 connections, 1 of which is not in use. 5v, GND and DATA are used with
the requirement to pull the data line up with a 10K pull-up resistor.
This sensor technology is quite old and requires delays to be implemented into the code for retrieving
the data, this should be between 2-3 seconds.

Figure 2.2.6 - Temperature Sensor with Pull-Up Resistor on Data Line
Figure 2.2.6 – Temperature Sensor with Pull-Up Resistor on Data Line

2.2.7 Push Button Configurations

The switch configurations were initially tested using a digital IO for each switch. This method is very
effective at detecting switch state changes but with 4 buttons used it was impractical to use 4 digital
pins. An alternative approach was to utilise 1 analogue input pin with the pull-up resistor enabled and
connect all switches in series with a 1K resistor for each switch. When read, the analogue input pin will
have a value between 0-1024 depending on what button is pressed.

retro

Author: Brian Lawes

A lover of how things work. Currently diving deep into the world of ServiceNow. Implementing Security Incident Response, Vulnerability Response, Threat Intelligence and developing cutting edge SecOps integrations. BEng(Hons) Computer Security & Forensics degree at Edinburgh Napier University. A Marine Mechanic to trade, also specialised in electrical/mechanical repair & maintenance.

Leave a Reply