Design of multi-channel wireless temperature acquisition system based on C8051F020

Publisher:清新生活Latest update time:2014-02-28 Source: 21ICKeywords:C8051F Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction

With the continuous advancement of science and technology, in most fields, wired connections can no longer meet the requirements of rapid technological development. Wireless communication is entering various fields of our lives. Compared with wired connections, it has the advantages of being easy to carry, flexible to use, and no need to consider wiring. It has extremely wide applications in wireless alarm, industrial data acquisition, remote control, remote measurement radio frequency IC card, handheld PDA, wireless image transmission, non-stop toll collection, wireless meter reading, etc. The temperature measurement system introduced in this article is also one of the applications of wireless communication systems. It uses SOC microcontroller C8051F020 as the central controller, CC1000 as the wireless transmission module and temperature measurement circuit to form a multi-channel wireless temperature acquisition system.

The 8-channel temperature data is collected and sent wirelessly to the host C8051F020 for processing.

The modulation and demodulation are completed by CC1000. The system adopts frequency shift keying modulation (FSK), the carrier frequency is 433MHz, the bandwidth is 64kHz, and the data is sent using differential Manchester encoding. The data rate sent over the air can be set as needed. When sending, the controller C8051F020 microcontroller receives the acquisition command from the user interface, collects 8-channel temperature signals, and packages the collected temperature data into data frames and transmits them to CC1000, controlling CC1000 to send data.

When receiving, the controller C8051F020 receives the temperature data transmitted from CC1000, performs simple processing and transmits the data to the host computer for detailed analysis and processing. The hardware block diagram is shown in Figure 1 and Figure 2.

 

 

 

 

2. System hardware design

2.1 Wireless transceiver module

The wireless transceiver module of this design uses the high-performance RF transceiver chip CC1000 of ChipconComponent. It is a single-chip high-frequency wireless transceiver IC with low current consumption, adjustable communication rate, up to 72.8kbit/s, receiving sensitivity of -109dB.m, and adjustable transmission signal power within -20~10dB.m. The circuit is simple in design, the peripheral devices used are few, the coding is simple, and the operating frequency range can be changed within 300~1000MHz by changing the circuit and device parameters. At the same time, the device integrates the transmission power amplifier, FSK modulation/demodulation, low-noise receiving amplifier, mixer, voltage-controlled oscillator, phase detector and other circuits. It is a highly integrated chip that can communicate directly with the single-chip microcomputer. This IC is very suitable for embedding into various measurement or control systems with high low power requirements. We choose the 433MHz frequency band in this system. The internal structure diagram of CC1000 is shown in Figure 3.

 

 

2.2 Main control chip C8051F020 and control circuit

C8051Fxxx is a series of 8-bit high-speed system-on-chip (SOC) microcontrollers launched by Cygnal. C8051F020 is one of them. Its CIP-51 and MCS-51 instruction sets are fully compatible and have the following advantages: (1) High speed, with a maximum processing speed of up to 25MIPS; it fully meets the real-time requirements of this design. (2) High integration, with a wide range of analog and digital peripherals integrated on the chip: two multi-channel analog/digital conversion systems, including an 8-bit ADC and a 12-bit ADC, as well as two programmable gain amplifiers and two analog multiplexers; two 12-bit digital/analog conversion systems; two analog comparators; an on-chip temperature sensor; a wide range of bus interfaces including SMBus, UART, and SPI; five 16-bit general-purpose timers; eight 8-bit I/O ports; a 64K FLASH, a 256B internal RAM, and a 4096B external RAM (XRAM); and a watchdog circuit, etc.; these on-chip resources greatly simplify the hardware circuit design of this design and greatly shorten the development cycle. (3) The cross switch makes I/O port allocation more flexible.

Based on the on-chip resources of C8051F020, it can fully meet the real-time acquisition and processing of temperature data at multiple points. The control circuit of C8051F020 to CC1000 is shown in Figure 4.

 

 

As shown in Figure 4, the microcontroller C8051F020 uses P3.0, P3.1, and P3.2 to connect CC1000's PDATA (programming data), PCLK (programming clock), and PALE (programming enable) to program, configure, and calibrate CC1000, making it work at 433MHz, with a bandwidth of 64kHz, and data is sent using differential Manchester encoding. P0.2 and P0.3 of the single-chip microcomputer C8051F020 are connected to the DIO and DCLK of CC1000 to send and receive data. The single-chip microcomputer packages the collected temperature data and sends it to the DIO pin of CC1000 through the P0.2 pin. The digital signal input by the DIO pin is frequency-shift keyed (FSK) and sent to the power amplifier, and then transmitted through the antenna of CC1000; the RF signal received by the CC1000 antenna is amplified by the low-noise amplifier (LNA) and sent to the mixer, and then demodulated by the demodulator (DEMCO) into a digital signal and output by the DIO pin. The P0.2 pin of the single-chip microcomputer receives the digital signal of the DIO pin and transmits it to the host computer for analysis and processing.

2.3 Temperature measurement circuit

The temperature measurement amplifier circuit is shown in Figure 5. The temperature measurement part is performed by 8-way K-type thermocouples to convert the temperature signal into a voltage signal. The range of the thermocouple is 40.7uV/C. Since the range of the thermocouple is very small, it needs to be amplified. The amplifier circuit uses the integrated operational amplifier LM224 to form a unidirectional proportional operation circuit for amplification. The collected analog quantity Vi is amplified by the amplifier LM224 to Vo=(1+605/4.99)*Vi. The 8-way amplified analog signal Vo is connected to the analog input terminals AIN0.0~AIN0.7 of the 8-way 12-bit A/D of the SOC microcontroller C8051F020 for analog/digital conversion, and then converted into a temperature value for storage and waiting for wireless transmission.


 

3. System software design

The software used in this design is Kei C51, and the languages ​​used are C language and assembly language. In order to obtain accurate delay, the delay subroutine is written in assembly language. The following mainly introduces the wireless communication part.

3.1 Design of communication protocol A reasonable communication protocol is the key to reliable wireless data transmission. For point-to-multipoint wireless communication, the protocol used in this design is representative. Since the wireless communication between the transmitter and the receiver is easily disturbed by external noise and generates erroneous data or data loss, this design packages the data to be sent and then sends it. The data organization format is shown in Figure 6.

 

 

The data packet format is OxAA OxAA 0xAA 0xAA 0x330xCC address data…data checksum, where 4 0xAA are the synchronization header and 0×33 0xCC is a special identifier. Since the probability of OxAA followed by 0×33 0xCC in noise is extremely small, 0×33 0xCC is sent after 4 OxAA as the identification header. Each time, only data with 4 OxAA 0×33 0xCC as the identification header is received, and then the address is sent. Each slave has a unique address. When receiving, the slave only receives packets with the same address as its own. Finally, the checksum method is used to ensure the reliability of the data.

3.2 Main program design process

The communication is initiated by the host computer. When communication is needed, the host computer first sends a synchronization header, then sends an address and then waits for the response from the lower computer. The lower computer communicates with the host computer by interruption, that is, the lower computer checks whether there is synchronization header information on the side every time it receives a data packet. If there is no synchronization header information, the wireless communication module goes into sleep mode; otherwise, the lower computer receives information from the host computer: if the received address is the local address, the data is analyzed and processed, otherwise it goes into sleep mode. Although this communication method is slow, it greatly reduces the power consumption of the lower computer and prolongs the battery life of the lower computer. The program flow chart is shown in Figure 7.

 

 

CC1000 has high requirements for both hardware and software. To achieve good wireless communication effects, you need to pay attention to the following points:

(1) The power supply filtering should be good. The microcontroller C8051F020 and CC1000 are powered by two power supplies. The power chip uses the LDO TPS7133Q chip to prevent crosstalk and ensure the stability of the output voltage.

(2) When laying out the PCB, RF and LF components should be laid out separately. The capacitors and inductors related to CC1000 should be placed closely around CC1000 to increase the grounding area and communication reliability of CC1000.

(3) The delay of mode switching must be sufficient.

4. Conclusion

This solution uses the C8051F020 microcontroller and the wireless transceiver chip CC1000 to realize the collection and wireless transmission of 8-channel temperature data. From the experimental results, it can be seen that the system meets the requirements of the wireless temperature measurement system well and effectively reduces the power consumption and volume of the system.

Keywords:C8051F Reference address:Design of multi-channel wireless temperature acquisition system based on C8051F020

Previous article:Digital voltmeter based on ADC0809
Next article:Development and application of USB3.0 bus technology based on CYPRESS

Latest Power Management 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号