Wireless temperature monitoring system based on ATmega16 microcontroller

Publisher:世界因你而精彩Latest update time:2011-10-31 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
With the development and progress of society, the requirements for temperature in more and more occasions are becoming increasingly stringent, and the application of temperature monitoring systems has received increasing attention. In the field of agricultural development, temperature measurement technology is required in many occasions such as agricultural greenhouses, cold storage, and cultivation greenhouses. Traditional temperature measurement systems are all wired systems. For some occasions that require multi-point temperature measurement, the use of traditional wired temperature measurement methods has many inconveniences in terms of layout, maintenance and updating. In order to solve this problem, a wireless temperature monitoring system based on a single-chip microcomputer and a wireless transceiver module is designed. Combined with a temperature sensor, it is very convenient to build a multi-point distributed intelligent wireless temperature monitoring system.

1 Composition of the wireless temperature monitoring system
The system mainly consists of two parts. As shown in Figure 1, the first part is the node temperature measurement system, and the second part is the temperature display management terminal. The node temperature measurement system is responsible for measuring the temperature and sending the temperature value to the temperature display management terminal through wireless communication. The management terminal receives the temperature information and displays and issues an alarm signal. In special cases, the management terminal can also send control information to the node temperature measurement system in reverse to achieve temperature control.

a.jpg


1.1 Design of node temperature measurement system
The node temperature measurement system is shown in Figure 2. The core control chip of the system uses the AVR series single-chip microcomputer ATmega16. This is a single-chip microcomputer with a reduced instruction set, high speed, low power consumption, sleep function and CMOS technology, and has a high degree of confidentiality. The Flash can be burned multiple times and has multiple password protection lock functions. In addition, the built-in watchdog timer (WDT) and the on-chip RC oscillator are very convenient to use. It has a sleep power saving function and an idle low power consumption function, and is relatively cost-effective in terms of practicality.

b.jpg [page]

The temperature sensor module uses the digital temperature sensor DS18B20, which is an intelligent digital temperature sensor launched by Dallas Semiconductor Corporation in the United States. When connecting to the MCU, the DS18B20 only needs one line (i.e., a single bus interface, plus a three-wire interface for power supply) to achieve two-way communication between the microprocessor and the DS18B20. Using DS18B20 can save system resources and make the system structure simpler. The temperature measurement range of DS18B20 is -55℃~+125℃, and the inherent temperature measurement resolution is 0.5℃. The working power supply is 3V~5V/DC. No peripheral components are required during use, and the measurement results are transmitted serially in the form of 9-12-bit digital quantities. The internal structure of DS18B20 mainly consists of four parts: 64-bit photolithography ROM, temperature sensor, non-volatile temperature alarm triggers TH and TL, and configuration registers. The 64-bit photolithography ROM stores the address sequence number of the DS18B20. The number is arranged as follows: the first 8 bits (28H) are the product type number, the next 48 bits are the serial number of the DS18B20 itself, and the last 8 bits are the cyclic redundancy check code (CRC=X8+X5+X4+1) of the previous 56 bits. The address sequence code in the photolithography ROM can distinguish each DS18B20, so that multiple DS18B20 can be connected to the same bus. According to the communication protocol of DS18B20, the MCU (single-chip microcomputer) must go through three steps to control the DS18B20 to complete the temperature conversion:
(1) Before each read and write, the DS18B20 must be reset
(2) After the reset is successful, a ROM instruction is sent
(3) Finally, a RAM instruction is sent
. Only in this way can the DS18B20 be operated as planned. Reset requires the main CPU to pull down the data line for 500 μs and then release it. When the DS18B20 receives the signal, it waits for about 16 to 60 μs, and then sends a low pulse of 60 to 240 μs. The main CPU receives this signal to indicate that the reset is successful. In the temperature measurement system designed in this paper, each DS18B20 occupies one I/O port when connected to the MCU. The steps of MCU controlling DS18B20 to complete temperature conversion are shown in Figure 3.

c.jpg

nRF24L01 is a highly integrated single-chip wireless transceiver device launched by Nordic. The chip has automatic response and automatic retransmission functions, a speed of up to 2 Mbps, 126 optional working channels, a very short channel switching time, and can be used for frequency hopping. Its output power, channel selection and protocol settings can all be set through the SPI port. Its Enhanced Shock Burst mode can control the response and retransmission functions at the same time without increasing the workload of the microcontroller. nRF24L01 also has the function of receiving six different channel data on the same channel, and can achieve data acquisition of up to 750 points using FDMA technology, making it the best choice for the hardware implementation of wireless temperature measurement systems. When the nRF24L01 module transmits data with the MCU, it can use the MCU's ordinary I/O port, and the system directly uses the SPI communication port of the inherent resources of ATmega16, which simplifies the software design process to a certain extent.

[page]

The LCD display module uses LCD1602 liquid crystal display. The character generation memory (CGROM) inside the module has stored 160 different dot matrix character graphics. These characters include: Arabic numerals, uppercase and lowercase English letters, commonly used symbols, Japanese kana, etc. Each character has a fixed code. For example, the code for the uppercase English letter "A" is 01000001B (41H). When displaying, the module displays the dot matrix character graphics in address 41H, and we can see the letter "A". Because 1602 recognizes ASCII code, ASCII code can be used to directly assign values ​​in the design, and character constants or variables can also be used in single-chip microcomputer programming, such as A'. In the system, 1602 uses an 8-bit data line driver, and its control end and data transmission are directly controlled by the I/O port of the single-chip microcomputer. The circuit is shown in Figure 4.

e.jpg


MCU-ATmega16, temperature sensor DS18B20 and LCD module 1602 are all powered by 5 V. The system power supply is 5 V and can be used directly. The nRF24L01 wireless transceiver module requires 3.3 V power supply, so the REG1117-3.3 chip is used to convert the power supply voltage to generate 3.3 V power supply for nRF24L01. When the SPI port of ATmega16 is connected to the nRF24L01 wireless transceiver module, the ATmega16 output drive current is too large, which may damage the wireless module, so a 2 k resistor is connected in series to protect the wireless module.
1.2 Temperature display management terminal
In the temperature display management terminal, the wireless transceiver module nRF24L01 first receives the temperature information sent by the node temperature measurement system through the antenna. The temperature information data is collected to the MCU through the SPI serial port of the single-chip microcomputer. If the temperature is not within the normal monitoring range, the sound module will sound an alarm. Finally, the temperature data is sent to the PC for display and processing through RS232 communication. The communication of the whole system belongs to duplex communication. If necessary, the circuit function can be expanded to realize the control signal sent by the PC and adjust the temperature of each node through reverse communication.

2 Conclusion
The wireless temperature monitoring system designed in this paper has a simple structure, easy implementation and good system performance. It is suitable for wireless temperature monitoring in various occasions.

Keywords:MCU Reference address:Wireless temperature monitoring system based on ATmega16 microcontroller

Previous article:Research on SPWM variable frequency speed regulation system based on 8098 single chip microcomputer
Next article:Design of railway crossing monitoring system in mining area using single chip microcomputer and GPRS

Recommended ReadingLatest update time:2024-11-17 01:38

OLED display implementation design based on C8051F023 microcontroller
1 Introduction Organic electroluminescent display, also known as organic light-emitting diode (OrganICLightEMIttingDiode, OLED) or organic light-emitting display OrganicLightEmittingDisplay (OLED), has obvious advantages over the current popular liquid crystal display (LCD) on the market. The main performance is: auto
[Microcontroller]
OLED display implementation design based on C8051F023 microcontroller
The construction of intelligent industrial sensor nodes requires sensors to share tasks with MCUs
As an important part of the perception layer in industrial control, industrial sensors not only improve industrial processes and provide asset monitoring and protection, but also make the visualization of industrial control clearer. In today's trend of industrial intelligent manufacturing, in order to create intelli
[Embedded]
Design of temperature and humidity collection and alarm system based on single chip microcomputer SHT11
#include reg51.h   #include intrins.h    #include math.h     #include stdio.h      #define LCD_DB P0  sbit LCD_RS=P2^0;    sbit LCD_RW=P2^1;   sbit LCD_E=P2^2;      sbit beep = P1^7; sbit key1 = P3^0; sbit key2 = P3^1; sbit key3 = P3^2; sbit key4 = P3^3; unsigned char Time; //Used to store the timing time unsigned
[Microcontroller]
Design of temperature and humidity collection and alarm system based on single chip microcomputer SHT11
FIP Application of NEC MCU
1 Overview The μPD780208 series 8-bit microcontroller produced by Japan's NEC Corporation is a more powerful series in the 78K/0 family. According to the different internal integrated ROM and RAM capacities, the μPD780208 series is divided into 5 models, and the μPD780208 chip is the highest model. In addit
[Microcontroller]
FIP Application of NEC MCU
Design of digital vortex flowmeter based on single chip microcomputer
research background and meaning 1. Overview of vortex flowmeter When a non-streamlined vortex generator is placed in the fluid, the fluid will be separated alternately on both sides of the generator and release two strings of regularly staggered vortices. Within a certain range, the vortex separation frequency
[Microcontroller]
Design of digital vortex flowmeter based on single chip microcomputer
ATMEGA16 four-line LCD driver
#include #include macros.h #define uchar unsigned char #define uint unsigned int //Define the port application of LCD1602 #define RS_CLI PORTB&=~BIT(PB1) #define RS_SEI PORTB|=BIT(PB1) #define RW_CLI PORTB&=~BIT(PB2) #define RW_SEI PORTB|=BIT(PB2) #define EN_CLI PORTB&=~BIT(PB3) #define EN_SEI PORTB|=BI
[Microcontroller]
51 single chip microcomputer realizes infrared coding detection
I have always wanted to do an infrared detection, because I work on air conditioning fans, and our group is responsible for remote controls. A few days ago, I found an article in Baidu Library, and then I did one. #include reg52.h //Include the header file. Generally, no modification is required. The header file con
[Microcontroller]
The anti-interference measures of the microcontroller itself
  In order to improve the reliability of the MCU itself, in recent years, MCU manufacturers have taken a series of measures in MCU design to improve reliability. These technologies are mainly reflected in the following aspects.   1. Reduce the external clock frequency   The external clock is a high-frequency noise
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号