ZigBee Module Design for Data Acquisition and Transmission

In the realm of the Internet of Things (IoT), ZigBee has emerged as a pivotal wireless communication and networking technology that offers unparalleled functionality. It establishes a reliable and secure platform for wireless device connectivity and control, enabling seamless integration and interoperability. However, it is important to acknowledge that ZigBee operates on a low-power, short-range wireless protocol. Consequently, the movement of devices within this network may indeed affect the efficacy of data collection and transmission. Thus, optimizing the ZigBee design becomes imperative for improved motion data collection and transmission. In this TechSparks article, we aim to provide valuable suggestions to enhance the performance of your project in this regard.

Table of Contents

Data Acquisition and Transmission System

Data acquisition and transmission system structure
Figure 1: Data acquisition and transmission system structure

In accordance with the depicted system architecture in Figure 1, the data acquisition and transmission system leverages the LPC2148 microprocessor to exert control over the ADIS16355 device, thereby facilitating the comprehensive storage of all acquired data within the SD card. Concurrently, the ZigBee module enables seamless wireless transmission of the data to the designated client, which subsequently undertakes the tasks of reception and processing. At the recipient end, the client platform assumes responsibility for the observation and processing of the collected data, or alternatively, the SD card can be physically extracted and seamlessly interfaced with a PC, thereby facilitating in-depth data analysis and evaluation.

ZigBee Circuit Design

Data Acquisition and Transmission Circuit

As illustrated in Figure 2, the ADIS16355 chip is equipped with an SPI interface, featuring the following essential pins:

  • SCLK0: Serves as the clock input for synchronizing data transmission within the SPI bus.
  • MOSI0 and MISO0: Facilitate the bidirectional transfer of data between the host (master) and the slave device.
  • SSEL0: Functions as a signal flag, enabling the master device to differentiate between multiple slave devices.

For the data transmission module, ZigBee technology is employed. In terms of the data interface, the system utilizes the Universal Asynchronous Receiver-Transmitter (UART) mode, which encompasses three crucial pins:

  • RXD1: This pin is designated for receiving data from external sources.
  • TXD1: Data is transmitted through this pin to external devices or systems.
  • DTR1: This control pin is responsible for managing the Data Terminal Ready (DTR) signal, enabling communication control.

The power state of the ZigBee module can be regulated by manipulating the appropriate pins via the LPC2148 main control chip. By transitioning the module into sleep mode during idle periods, power consumption can be effectively minimized, contributing to enhanced energy efficiency.

Storage Circuit

To ensure storage convenience and portability, the SD card is employed as the designated medium in this context. Its utilization caters to the requirements of large-capacity data storage and low power consumption, thereby optimizing overall system performance. The SD card supports two interface protocol modes: SD mode and SPI mode, with distinct pin definitions for each mode. During communication, the host LPC2148 must select a single communication mode. However, the SD card possesses the capability to automatically detect the mode through the reset command, thereby establishing and maintaining consistent communication in subsequent interactions.

Leveraging the LPC2148’s hardware SPI interface, seamless access to the SD card is effortlessly facilitated. In Figure 3 of the circuit design, a four-line connection is illustrated. The host LPC2148 transmits the chip select signal (SSEL1) to the card, enabling card selection. Moreover, the one-way data signal (MOSI1) is transmitted from the host to the card, while the clock signal (SCLK1) is also dispatched from the host to the card. Finally, the card returns a one-way data signal (MISO1) to the host, thus ensuring effective and reliable data transfer.

Considering ZigBee Power Design

To ensure prolonged operation, the system design incorporates a rechargeable battery as the power supply method. This necessitates low power consumption to enable the system’s sustained functionality over several months. In line with this objective, the LPC2148 chip is employed as the processor. This 32-bit high-speed processor embodies a Reduced Instruction Set Computing (RISC) architecture, boasting a power-efficient design. The chip operates at a power supply voltage of 3.3V, with a core voltage of 2.5V, further contributing to its low power consumption characteristics.

Both the sensor module ADIS16355 and ZigBee transmission module encompass programmable power consumption control capabilities. By configuring the register data, these modules can be seamlessly transitioned into standby or sleep mode, effectively reducing power consumption. This aligns with the circuit design requirements, allowing for extended operation. Following comprehensive testing, it has been determined that the system can consistently operate for a duration of 4 to 5 months when powered by a self-manufactured rechargeable 7V battery, featuring a capacity of 1,300mAh.

Software Design

The software design of the system primarily encompasses three core components: SD card read/write operations, sensor data acquisition, and ZigBee data transmission. The program flow is meticulously outlined in Figure 3. The firmware program development is facilitated through the utilization of Keil uVision3, a comprehensive integrated development environment (IDE). Subsequently, the Keil ULINK2 emulator is employed for efficient program downloading and debugging, ensuring optimal software performance and reliability.

Software Design Process

Here is a partial implementation program for the data acquisition of the three-axis sensor ADIS16355:

				
					static void SPI0_Init(void) {
    PINSEL0 = (PINSEL0 & (~(0xFF << 8))) | (0x55 << 8);
    // Set the pin function. Set P0.4~P0.7 to support SPI
    // SCK=1 MHz, S0SPCCR is the SPI clock register
    SOSPCR = 0b0000000010100100;
    // Master mode (LPC2148 to ADI16355 transfer), interrupt enabled
    // 16 bits can be transmitted at a time, SOSPCR is the SPI control register
}
static uint8 addr[6][2] = {
    {0x02, 0x03},
    {0x04, 0x05},
    {0x06, 0x07},
    {0x08, 0x09},
    {0x0A, 0x0B},
    {0x0C, 0x0D}
};
// 6 is the output register, 2 XYZ pairs for each register,
// each register has 2 addresses, high 6 bits and low 6 bits

				
			

The SPI0_Init function initializes the SPI (Serial Peripheral Interface) module. It sets the pin functions and the clock register (S0SPCCR). The SOSPCR is the SPI control register, which is used to configure the SPI’s operating mode and transfer settings.

The addr is a two-dimensional array that contains the addresses of 6 registers. Each register consists of two addresses, representing the high 6 bits and low 6 bits.

Summarize

This set of data acquisition equipment uses a wireless ZigBee transmission module to form an ad hoc network, and the maximum barrier-free communication distance can reach about 400m.

Scroll to Top