Title: Portable Temperature Measurement System Team Information: Lin Zebang Award Information: Special Prize
1. Overall system plan
The complete physical picture of the portable temperature measurement system is as follows:
the blue, green and red LED lights are named "LOW", "NORMAL" and "HIGH" respectively, representing low temperature, normal temperature and high temperature. The functions of the three buttons are to set the temperature threshold, increase and decrease respectively. The LCD screen, Bluetooth module and power pin header are removed, as shown in the figure below:
The overall system block diagram of the portable temperature measurement system is as follows:
The temperature measurement system is powered by three AA batteries, and the microcontroller collects temperature information through the temperature sensor and displays it on the LCD in real time on the screen and simultaneously transmitted to the computer through the Bluetooth module. When the temperature is high, the red light lights up and the buzzer sounds long; when the temperature is normal, the green light lights up, and when the temperature is low, the blue light lights up. The temperature threshold can be modified by pressing the key.
2. Hardware circuit
The circuit schematic diagram is designed using Lichuang EDA. The overall diagram is as follows:
the microcontroller uses STC8A8K32S4A12-LQFP44. The STC8 series of microcontrollers are microcontrollers that do not require an external crystal oscillator or external reset. They are 8051 microcontrollers that aim at super anti-interference, ultra-low price, high speed, and low power consumption. At the same operating frequency, the STC8 series of microcontrollers are better than traditional 8051 microcontrollers. About 12 times faster (11.2~13.2 times faster), the instruction code is fully compatible with traditional 8051. The clock circuit and reset circuit are omitted here.
The temperature sensor is DS18B20, the measurement range is -55℃-125℃, I limited it to -49℃-99℃ in the program.
The LCD screen uses LCD1602, the sliding rheostat can adjust the contrast, and C1 and C2 are used as filters.
The Bluetooth module uses the HC-06 Bluetooth serial communication module, which is based on the Bluetooth Specification V2.0 data transmission module with EDR Bluetooth protocol. There is no need to understand the Bluetooth protocol when writing code, just write it according to serial communication.
The buzzer adopts an active buzzer and is driven by an S8550 transistor.
The three LED lights correspond to different temperature ranges, and a 1K resistor is used to limit the current.
The key circuit uses software anti-shake.
Use Lichuang EDA for PCB design. The PCB design is as follows.
3. Software design
The software is written using the Keil platform, and the official tool STC-ISP is used to download the program.
The code is divided into seven source files: main.c contains the main control logic; include.h and include.c contain the STC8 header file, data type definition and delay function; ds18b20.h and ds18b20.c contain the temperature sensor Driver; lcd1602.h and lcd1602.c contain LCD drivers
The program flow chart is shown below. See attachment for source code
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet