Design of temperature detection network node based on LPC1100

Publisher:huanliLatest update time:2012-08-30 Source: 电子科技 Keywords:LPC1100 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction
Cortex-MO is a low-power, small-size processor among 32-bit ARM processors. It perfectly combines the advantages of ultra-low power consumption, high efficiency and low gate count, which make it suitable as a processor for wireless sensor network nodes. This article introduces a solution for designing a temperature detection network node based on LPC1114.

1 Introduction to temperature detection system
A temperature detection wireless network consists of several temperature detection nodes, and each temperature detection node uses wireless sensors to communicate. All temperature detection nodes use ZigBee technology to form a wireless network. The functions of each node include collecting temperature and sending it through the ZigBee network. This system uses the Simplified TI protocol in the simplified version of the ZigBee protocol provided by TI to form a star network. The network consists of an access point (AP) and several terminal nodes (ED). Among them, the AP is equivalent to a full-function device, responsible for establishing the entire network and receiving the temperature information collected by the ED. All temperature detection nodes are powered by battery devices.

2 Hardware design of temperature detection node
The temperature detection node is mainly composed of LPC1100 series processor (LPC1114 is used here), temperature sensor, ZigBee module, LCD display, etc., as shown in Figure 1. The temperature sensor uses LM75 with I2C interface of National Semiconductor, the ZigBee module uses CC2500 chip with SPI interface of TI, and the LCD display uses LCD1602 character display screen. The entire node is powered by battery equipment. Considering the power consumption factor, the LCD screen adopts slot design, and some nodes that do not need to display can be disconnected from LCD. In addition to the above main parts, there are some optional units, such as UART serial port, LED, button, buzzer BEEP, etc. of general I/O interface.

14a.JPG

3 Software Design of Temperature Detection Node
The functions of the temperature detection node are as follows:
◆ Set a timer to detect the temperature regularly and display the current temperature value on the LCD;
◆ Send the detected temperature value through the ZigBee module;
◆ When the temperature is too high, the buzzer will sound for a certain period of time;
◆ The node is in sleep mode except for temperature detection and transmission;
◆ The timer wakes up the processor every 1 s to detect and transmit the temperature.
According to these functions, the software of the entire temperature node is divided into the following modules: power management module, LCD module, temperature sensor module, ZigBee module.
This section will focus on the power management module, temperature sensor module and ZigBee module.
3.1 Power management module
The power management of the LPC1100 series chip has three modes, namely sleep mode, deep sleep mode and deep power-down mode.
3.1.1 Entering and exiting the three modes
The entry and exit methods of the three modes are listed in Table 1.

14b.JPG [page]

3.1.2 Differences between the three modes
In sleep mode, if the peripheral clock is provided in the software, the peripheral function can still be executed in sleep mode, and an interrupt can be generated to cause the processor to resume operation. In deep sleep mode, the user can configure the power-down module during deep sleep and the power-on module after wake-up. In these two sleep modes, the processor state, registers, peripheral registers, internal SRAM values ​​are maintained, and the logic level of the pins remains unchanged. Deep sleep uses 13 wake-up interrupts to wake up. Its advantage is that the user can turn off the clock generation module, thereby reducing dynamic power consumption more than sleep mode.
In deep power-down mode, except for the WAKEUP pin, the power and clock on the entire chip are turned off, and the content in the SRAM cannot be maintained, but 4 general registers can be used to save data. If you want to wake up the chip in deep power-down mode, you must connect a low level to the WAKEUP pin through an external connection component.
3.1.3 Select sleep mode
In this system, the main function of the temperature detection node is to detect the temperature once every certain period of time, so the chip is put into sleep mode during the interval of collecting temperature. When the temperature needs to be collected, it is woken up by a timer interrupt. For example, the temperature is collected every 1 second, a timer interrupt is set after the temperature is collected and sent, and then the WFI instruction is called to put the chip in sleep mode. For easy observation, an LED light is set to flash to indicate the frequency of temperature collection. At the same time, if the temperature is detected to be too high, a buzzer is used to alarm. If an LCD screen is connected, the temperature value can also be displayed on the LCD screen.
The main code in the main function is as follows:

14b.JPG

After calling the WFI instruction, the program stops running. When the timer interrupt occurs, the processor can be woken up and the program continues to run the code after the WFI instruction. The code for the timer interrupt is as follows:

14d.JPG

3.2 Temperature sensor module
The temperature sensor LM75 uses a standard I2C interface. In this node, the hardware interface between LPC1114 and LM75 is shown in Figure 2.

14e.JPG


The address lines A0~A2 of LM75 are all grounded, and the 0S pin is floating, so this node only uses its basic temperature measurement function. There are 5 registers inside LM75: pointer register, configuration register, temperature register, temperature setting register and temperature hysteresis register. The pointer register is used to select the remaining 4 registers for operation. This node mainly reads the temperature value in the temperature register. The high 9-bit value in the temperature register is the valid temperature value. The value read out of this register is given in the format of binary complement, and each unit of its LSB (least significant bit) represents 0.5℃, for example, +0.5℃ corresponds to 001H. The range it can represent is -55~+125℃.

[page]

When using this temperature sensor, you need to call the following two API functions:

14g.JPG

3.3 ZigBee module
The ZigBee module of this node uses the CC2500 chip of T1 company and uses the SimpliciTI protocol to build a network. Its hardware connection is shown in Figure 3.

14f.JPG
When using CC2500, you first need to configure the SPI pins of LPC1114. In addition, you also need to configure pins GD00 and GDO1 as MCU interrupts to control the sending and receiving of network data packets. Then initialize the CC2500 chip according to the CC2500 initialization sequence, and then hand it over to the upper-level networking function for calling. The initialization steps of CC2500 are as follows:
① Initialize the SPI interface connected to the MCU;
② SCLK=1, SI=O;
③ CSn=0;
④ CSn-1, delay 40μs;
⑤ CSn=0;
⑥ Wait for the S0 pin to become low;
⑦ Send the command SRES on the SI pin;
⑧ Wait for the SO pin to become low again.
At this time, if the corresponding registers can be read and written normally, it means that CC2500 has been initialized successfully.
After CC2500 is initialized successfully, you need to configure the CC2500 registers and set the sending and receiving interrupts of data packets. Since CC2500 has many registers, please refer to the reference code on the CC2500 official website. The interrupt of sending and receiving data packets is controlled by the value of the configuration register. By setting the values ​​of these registers, GDO0 and GDO1 can be configured to send and receive data. Here, the value of the IOCFG0 register is configured to 0x6, that is, when a data packet is received or sent, a high level jump is generated on the GDO0 pin; after receiving or sending, it returns to a low level. Therefore, the GDO0 pin, that is, PIO2_5, is configured as an input pin, and the rising edge interrupt is set. The code is as follows:

14h.JPG
At this point, if data is sent or received, an interrupt can be generated. If data is received, a receiving function must be called in the interrupt handler function PIOINT2-IRQHandler.
There are also some places involving low-level communication that need to be modified, such as:

14i.JPG

After modifying the underlying hardware-related functions, you can use the upper-level networking functions. The CC2500 networking API functions mainly include the following functions:

14j.JPG

When networking, you need to call SMPL_Init to initialize, and then call SMPL_Link or SMPL_LinkListen function according to the function of the node to form a wireless network. Finally, call SMPL_Receive and SMPL_Send functions to send and receive data.

Conclusion
This article introduces a design method for temperature detection network nodes based on LPC1114. The LPC1114 chip has the characteristics of low power consumption and high performance, and with standard I2C, SSP and other interfaces, it facilitates the transplantation of many standard interface components. The temperature sensor with I2C interface can also be replaced with humidity sensor, gas sensor, etc. with I2C interface to establish a wireless sensor network based on ZigBee. This design scheme has certain reference value for node design in wireless sensor networks such as wireless environmental monitoring network and wireless meter reading network.

Keywords:LPC1100 Reference address:Design of temperature detection network node based on LPC1100

Previous article:Design of an intelligent electronic blood pressure meter based on LPC3250
Next article:Design of LPC1768 and AD7656 sampling system with time stamp

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号