A smart clock that displays the time and indoor temperature simultaneously, and allows voice control of the air conditioner temperature.
I. Project Overview
This project aims to design a feature-rich smart clock that not only displays the time as a traditional clock but also shows the real-time indoor temperature and allows voice control of the air conditioner temperature. The design uses the STC8H4K64 as the main control chip, combined with a 4-digit LED display for time display, a DHT11 sensor for temperature and humidity data collection, touch buttons for basic operations, an HLK-V20 module for voice interaction, and an infrared transmitter for air conditioner control.
II. Design Objectives
Real-time display of current time (hours, minutes, seconds).
Real-time display of indoor temperature.
Time setting and simple operations via touch buttons.
Voice control of air conditioner temperature via the HLK-V20 module.
Infrared transmitter for air conditioner on/off and temperature adjustment.
III. Hardware Design
Main control chip: STC8H4K64, responsible for overall system control and data processing.
Display module: 4-digit LED display for displaying current time and temperature.
Temperature and humidity acquisition: DHT11 sensor for real-time indoor temperature data collection.
Touch buttons: for time setting and simple operations.
Voice Interaction: The HLK-V20 module supports speech recognition and speech synthesis, enabling voice interaction with the user.
Infrared Emitter: Used to send infrared commands to the air conditioner to control its on/off state and temperature adjustment.
IV. Software Design
System Initialization: Includes initialization settings for the digital display, DHT11 sensor, touch buttons, HLK-V20, and infrared emitter.
Time Display: Displays the current time (hours, minutes, seconds) in real time via the digital display.
Temperature Display: Displays the indoor temperature in real time based on data collected by the DHT11 sensor.
Touch Button Processing: Detects touch button input and performs corresponding operations (such as time setting).
Voice Control: The HLK-V20 module recognizes user voice commands, parses the commands, and controls the infrared emitter to send corresponding commands to the air conditioner.
Infrared Command Encoding: Based on the air conditioner's infrared command protocol, corresponding infrared command codes are written to control the air conditioner's on/off state and temperature adjustment.