11-Light and temperature and humidity detection alarm based on 51 single chip microcomputer

Publisher:文江桂青Latest update time:2021-10-19 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Specific implementation functions

It consists of STC89C52 microcontroller + LCD1602 liquid crystal display + ADC0832 module + buzzer + DHT11 temperature and humidity sensor + light sensor + LED + button.


Specific functions:


1. The first line of LCD1602 displays the current light value, and the second line displays the current temperature and humidity values;


2. You can set the upper and lower limit alarm values ​​for light, temperature and humidity. There are 4 buttons in total: reset button, minus button, plus button, and set button; the set parameters can be saved when power is off and are stored inside the STC microcontroller, so there is no need to reset them when power is on;


3. When the light value is higher than the set alarm value or the temperature and humidity are beyond the upper and lower limits, the buzzer and indicator light will sound an audible and visual alarm;


4. When the temperature and humidity values ​​are lower or higher than the set range, the corresponding indicator light will light up and the buzzer will sound an alarm.

Introduction to MCU

The 51 single chip is a low-power, high-performance CMOS 8-bit microcontroller with 8K in-system programmable Flash memory. With a smart 8-bit CPU and in-system programmable Flash on a single chip, the STC89C51 provides a highly flexible and ultra-effective solution for many embedded control application systems. It has the following standard functions: 8k bytes of Flash, 512 bytes of RAM, 32-bit I/O port lines, watchdog timer, built-in 4KB EEPROM, MAX810 reset circuit, three 16-bit timers/counters, a 6-vector 2-level interrupt structure, and a full-duplex serial port. In addition, the STC89X51 can be reduced to 0Hz static logic operation and supports 2 software-selectable power saving modes. In idle mode, the CPU stops working, allowing RAM, timer/counter, serial port, and interrupt to continue working. In power-off protection mode, the RAM content is saved, the oscillator is frozen, and all microcontroller operations stop until the next interrupt or hardware reset. The maximum operating frequency is 35Mhz, and 6T/12T is optional.


Design ideas

Literature research method: collect and organize relevant research materials on the single-chip microcomputer smart bracelet system, read the literature carefully, and prepare for the research;


Investigation and research method: Through investigation, analysis, specific trials and other methods, the current situation, existing problems and solutions of the single-chip smart bracelet system are discovered;


Comparative analysis method: compare the specific principles of different single-chip smart bracelet systems, as well as the differences in the performance of the same type of sensors, and analyze the research status and development prospects of single-chip smart bracelet systems;


Software and hardware design method: Implement specific hardware through software and hardware design, and finally test whether each function meets the requirements.


Schematic

The schematic design of this system uses Altium Designer19, as shown in the figure. In the undergraduate single-chip microcomputer design, the software used to design the circuit is generally Altium Designer or proteus. Because Altium Designer is powerful, it can design the schematic diagram and PCB diagram of the hardware circuit, and the interface is simple, easy to operate, and easy to use. Altium Designer19 is a professional end-to-end electronic printed circuit board design environment for electronic printed circuit board design. It combines schematic design, PCB design, and multiple management and simulation technologies to meet the design needs of this time.


program

This design uses KEIL5 software to implement program design, as shown in the figure. As the first programming language learned during undergraduate studies, C language is one of the most familiar programming languages. Of course, due to its powerful functions, C language is currently the most widely used and popular programming language in the world. In the design of single-chip microcomputers, C language has gradually completely replaced assembly language, because compared with assembly language, C language compilation, running, debugging is very convenient, and it has high portability, good readability, and is easy to burn and write hardware systems. Therefore, C language is widely used in single-chip microcomputer design. Keil software is compatible with single-chip microcomputer design, can achieve fast debugging, and generate burning files, and is widely used in C language writing and single-chip microcomputer design.

Simulation Implementation

This design uses protues8.7 software to implement simulation design, as shown in the figure.


Protues is also one of the commonly used design software in MCU simulation design. By designing the hardware circuit diagram and writing the driver, the circuit can be debugged without implementing the hardware. In addition, Protues can also realize PCB design, and can also be combined with KEIL in simulation to facilitate program debugging. It supports multiple platforms and is simple and convenient to use.

Reference address:11-Light and temperature and humidity detection alarm based on 51 single chip microcomputer

Previous article:12-Fire and theft prevention GSM reporting smart home system based on 51 single chip microcomputer
Next article:10-Simulation of multi-channel temperature detection and adjustment serial port transmission system based on 51 single chip microcomputer

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号