//Logo Image
Author: Che-Chang Yang (2010-06-22); recommend: Yeh-Liang Hsu (2010-06-26).

Design of the distributed data server using PIC_SERVER v3.7

This document describes the design of the distributed data server (DDS) using PIC_SERVER v3.7. The DDS consists of two parts: the PIC_SERVER v3.7 module and the application board. A ZigBee RF transceiver module that enables wireless sensor network (WSN) capability for DDS is also presented.

1.     PIC_SERVER v3.7

The PIC_SERVER v3.7 module is the core of the DDS. It comprises the minimum number of components that are required for basic operation as an embedded system. This module has reserved sockets to provide connectivity to external devices (e.g., the application board in this study). The size of PIC_SERVER v3.7 module is also small to maximize portability for a variety of applications.

PIC_SERVER v3.7 module consists of three main components: a PIC microcontroller (PIC18LF6722, Microchip Co.), an EEPROM (24LC256, Microchip Co.), and an Ethernet interface controller (RTL8019AS, RealTek). The functional structure of PIC_SERVER v3.7 module is defined in Table 3.1 which lists the pin assignment of the PIC18LF6722. In general, the PIC_SERVER v3.7 module features the following main capabilities:

(1)    Analog-to-digital conversion and digital input/output (I/O)

The PIC18LF6722 offers 10-bit analog-to-digital conversion (A/D converter) at the sampling rate up to around 800Hz. Two A/D converter channels (Pin RA0, RA5) are reserved on PIC_SERVER v3.7 module. A third A/D conversion channel (Pin RA1) is reserved for a switch. The PIC_SERVER v3.7 module also provides 7 channels of digital I/O (Pin RB0 to RB2 and Pin RB4 to RB7) for general logistic control. There are another 2 digital inputs (Pin RG3, RG4) reserved for switches to configure time setting of the real-time clock on the DDS.

(2)    Serial data communications

The PIC_SERVER v3.7 module provides two serial RS-232 channels that are commonly used for communication with PCs or external devices. The PIC_SERVER v3.7 module also provides serial I2C connectivity for internal communication between the microcontroller and electronic components.

(3)    Data processing

The PIC18LF6722 provides fundamental signal processing capability at maximum clock rate of 40MHz. It has 128kbyte flash program memory and 3936byte SRAM.

(4)    Data logging and storage

The PIC_SERVER v3.7module uses a MMC memory card for data storage. Data can be recorded in text files (*.txt) in FAT16 format.

(5)    Internet communication

An Ethernet controller (RTL8019AS) is used for enabling TCP/UDP connectivity with static IP address and MAC address. This Internet connectivity of the PIC_SERVER v3.7 module is the most important capability among ordinary embedded system-based devices.

Table 1. Pin assignment of the PIC18LF6722 for PIC_SERVER v3.7 module

Function

Pin

Address

A/D converter

RA0

Analog(0)

RA5

Analog(5), TTL

Digital I/O

RB0

Digital_1

RB1

Digital_2

RB2

Digital_3

RB4

Digital_4

RB5

Digital_5

RB6

Digital_6

RB7

Digital_7

Time set

RG3

Digital_8, D/I

RG4

Digital_9, D/I

Switch

RA1

Analog(1)

RS-232 A

RC6

RS-232_TX1 (D/O)

RC7

RS232_RX1 (D/I)

RS-232 B

RG1

RS-232_TX2(D/O)

RG2

RS232_RX2D/I)

I2C

RC3

I2C_SCL1

RC4

I2C_DA1

Real-time clock

(for DS1302)

RC0

RTC_SCLK

RC1

RTC_IO

RC2

RTC_RST

Data storage medium

(MMC)

RB3

MMC_DOUT (TTL)

RF0

MMC_DIN

RF1

MMC_CLK

RF2

MMEC_SEL

LCD text display

RF3

LCD_EN (D/O)

RA2

LCD_RS

RA3

LCD_RW

RF4

LCD_DATA4

RF5

LCD_DATA5

RF6

LCD_DATA6

RF7

LCD_DATA7

RG0

LCD backlight

Ethernet interface

(for RTL8019AS)

RD0 to RD7

NIC_CODE DATA

RE0

NIC_IOR

RE1

NIC_IOW

RE2

NIC_RESET (D/O)

RE3 to RE7

NIC_ADDRESS

System LED

RA4

SYS_LED (D/O), ICP

Beeper

RC5

BEEP(D/O)

Figure 1 and Figure 2 show the schematic design of PIC_SERVER v3.7 module. Figure 3 shows two 2.54-pitch dual-inline pin connectors to which external application circuitry or devices can be connected. Figure 4 shows the PCB layout of the PIC_SERVER v3.7 module that measures 60mm×50mm in size. All the components are in SMD footprints in order to save PCB layout space. The PCB uses a dual-layer circuit routes to interconnect all the components placed on the top layer. The PIC_SERVER v3.7 module can be fixed and secured to external objects via the four through holes at the corners of the PCB. Figure 5 shows the physical assembly of the PIC_SERVER v3.7 module.

Figure 1. Schematic of the PIC_SERVER v3.7 module (I): PIC18LF6722

Figure 2. Schematic of the PIC_SERVER v3.7 module (I): RTL8019AS & 24LC512

Figure 3. Schematic of the PIC_SERVER v3.7 module (III): Connectors

Figure 4. The PCB layout of the PIC_SERVER v3.7 module (left: the component placement; right: dual-layer circuitry)

Figure 5. The physical assembly of PIC_SERVER v3.7 module

2.     Design of the application board

2.1  Schematic design

Figure 6 to Figure 10 show the schematics of the application board. In Figure 6, two DC+5V regulators (M2940, National Semiconductors) and a DC+3.3V regulator (LM3940, National Semiconductors) are used to regulate input power up to DC36V from an AC-DC adapter (typical input voltage DC9V-12V). The D1 LED indicates the presence of the input power and the D2 LED can be an optional user-defined status indicator.

Figure 6. Schematic design of the application board (1): Power supply

Figure 7 shows the connectors and switches on the application board. J2 and J3 are sockets for connecting the PIC_SERVER v3.7 module. All the reserved digital I/O ports, analog channels and DC power are reserved in the connector J4 for connecting to sensors, switches or a LCD text display. The S1 and S2 switches are for RESET and inner chip programmer (ICP) mode control of the PIC_SERVER v3.7 module. S3 is a user-defined switch for logic (on/off status) control.

Figure 8 shows the RS-232 circuit and interface in the application board. A Dual EIA-232 driver/receiver IC (MAX232 or HIN232) is used to regulate the RS-232 interface voltage level. The PIC_SERVER v3.7 offers two RS-232 channels (RS-232A/B). The RS-232A is for communicating with PCs and the RS-232B is for connecting with any external RS-232 compatible devices.

Figure 7. Schematic of the application board (2): Connectors and switches

Figure 8. Schematic of the application board (3): RS-232 interface

Figure 9 shows the schematics of the MMC sockets, the RJ45 Internet cable connector, and the real-time clock. Note that the MMC socket used on the DDS does not support the MMC-plus memory card that features a faster R/W speed. The footprint of the RJ-45 connector (P65-P01-11A9, SpeedTech) is compatible with an old version P02-102-11A9 which does not have the LEDs indicating the Internet TX/RX status. The real-time clock serves as a timer that provides time information for the system. A CR2032 3V lithium battery (BT1) is used as a backup power source to reserve time information in the absence of the supply power. The system can retrieve accurate time information with a properly selected crystal oscillator (Y1) and its two coupling capacitors (C10, C11).

Figure 9. Schematic of the application board (4): MMC (left), RJ-45 connector (right), real-time clock (below)

The DDS has a built-in RF receiver circuit that provides a basic RF data forwarding and remote control from compatible RF devices. Figure 10 shows the built-in RF receiver circuit on the application board. U9 is a RF receiver (RWS-530, Wenshing Electronics) coupled with a SMA antenna set (E1). The RWS-530 receives 433.93MHz RF signals in ASK modulation. The decoder (U8, PT2272, Princeton Technology Corp.) decodes the received RF signals into a 6-bit binary sequence in which the 6 bits of D0 to D5 are connected to the digital input pin of RB6, RB7 RB2, RB1, RB4, and RB0, respectively. The ID address can be configured by the 6-bit DIP switch S4 for to identify paired RF devices. The PT2272 decoder can only recognize RF data sent with the same ID address at the transmitter. Note that the RF receiver circuit is an optional function for the DDS. If this circuit is in use, the RBx pins reading the status of the PT2272 decoder outputs are hence not available in the connector J4.

Figure 10. Schematic of the application board (5): On-board wireless RF circuitry

2.2  PCB layout and DDS assembly

Figure 11 shows the component placement and circuit layout of the PCB of the application board. The PCB size is 155×90mm and all components are pin-through-hole (PTH) type because the sizes and number of the components does not greatly affect the overall PCB layout and electrical characteristics. It will be also more convenient to use PTH components if further circuit modifications are needed. The RS-232B connector is put in the front panel so that external devices can be easily connected to the DDS. The button switch (S3) is put next to that RS-232B connector for the consideration of applications that need a switch as a functional trigger. The reserved I/O ports (J4) of the DDS depicted in Figure 12 is also put in the front panel of the DDS. Figure 12 shows the DDS and with its case assembly.

Figure 11. Component placement (above), and PCB layout (below) of the application board

Figure 12. The reserved I/O ports of the DDS

Figure 13. The DDS (left) with its case assembly (right)

3.     Design of the ZigBee RF transceiver module

Although the application board has a built-in RF receiver circuit that operates via ASK 433.92MHz radio band, several capability constraints have to be taken into consideration. First, the DDS with such built-in RF circuit can only receive data that is transmitted from other devices. In other words, the DDS is unable to transmit data to other devices within a network. Secondly, the fact that data must be in the protocol of a short binary sequence limits the usability in applications that require transmitting multiple raw signals or sensor readings. Third, the data rate is low, and intensive data transmission via such low frequency radio band as 433.92MHz might not be reliable enough. Therefore, an upgrade is needed to advance the capability of RF data transmission in addition to a simple radio utility.

3.1  Wireless sensor network and ZigBee

Wireless sensor network (WSN) technology has been widely used in a variety of personal area network (PAN) applications. A WSN consists of a number of spatially distributed sensors that cooperatively monitor physical or environment conditions over a range of space. A common and typical industrial application using WSN technology is temperature and humidity monitoring. “ZigBee” has been the mainstream RF protocol for wireless PAN (WPAN)-based WSN applications in the industries. It bases on IEEE 802.15.4 standard that specifies operation in unlicensed 868MHz, 915MHz or 2.4GHz industrial, scientific and medical (ISM) radio bands. The 2.4GHz radio band is the mainstream ZigBee specification due to its highest data rate up to 250kbps. ZigBee is targeted at RF applications that require low data rate, long battery life, and autonomous networking capabilities.

A typical ZigBee network consists of one “coordinator” and one or more “routers” and/or “end devices”. Figure 14 illustrates an example of typical ZigBee PAN network topology. A PAN-ID is required for a coordinator to initiate a valid network that allows other routers and/or end devices with the same PAN-ID to join. When a router or end device joins a PAN, it receives a 16-bit network address from the coordinator and can transmit data to or receive data from other devices in the PAN. Routers and the coordinator can allow other devices to join the PAN, and can assist in sending data through the network to ensure data is routed correctly to the intended recipient device. Note that end devices in a PAN can transmit or receive data but cannot route data from one node to another, nor can they allow devices to join the PAN. End devices must always communicate directly with their parent routers or the coordinator they joined to. The parent router or coordinator can route data on behalf of an end device to ensure that it reaches the correct destination. End devices can be battery-powered so as to support the operation in low power modes (sleep mode), while routers and the coordinator must be mains-powered because the routers and coordinator must be always on for receiving or routing data between the nodes. In sum, ZigBee RF protocol provides WSN-based systems with an advanced networking topology that offers more efficient ways in data transmission at low power operations.

Figure 14. Example of typical ZigBee PAN network topology

The ZigBee RF transceiver module designed for the DDS uses the XBee Series 2 OEM RF module (Digi International) as shown in Figure 15. The XBee Series 2 OEM RF module is an integrated RF transceiver measures 25×28×2.8mm in size (without antenna) and it operates in accordance with ZigBee protocol in 2.4GHz radio band. The maximal data rate is 250kbps with line-of-sight transmission ranges of up to 120m (outdoors) and 40m (indoors). It can be supplied with low voltage power from 2.1V to 3.6V that is suitable for battery-driven applications. The XBee Series OEM RF module supports point-to-point, point-to-multipoint, and peer-to-peer topologies with self-routing and mesh networking. External devices, such as PCs or microprocessors can communicate with the XBee Series 2 OEM RF module using serial RS-232 (TX/RX) interface. The XBee Series 2 OEM RF module has dual in-line pins for direct connecting to a PCB without the need of soldering. 

Figure 15. The XBee Series 2 OEM RF module

3.2  Schematic and PCB design

The ZigBee RF transceiver module for the DDS is simple and uses only a few components. As the schematic and PCB layout shown in the Figure 16, the JP1 socket is for connecting the RF transceiver module to the DDS so as to provide power for the ZigBee RF transceiver module. A Dual EIA-232 MAX232 driver/receiver IC (U1, or compatible items, e.g., HIN232) is used as a serial communication interface for regulating RS-232 voltage levels between the XBee Series 2 OEM RF module and the DDS. A 3-wired cable from the J1 connector of the ZigBee RF transceiver module is connected to the RS-232B connector of the DDS. Figure 17 shows the DDS equipped with the ZigBee RF transceiver module. Finally the bill of material list of the DDS is shown in the Appendix.

Figure 16. The schematic design and PCB layout of the RF transceiver module

DSC01672.JPG

Figure 17. The DDS equipped with the ZigBee RF transceiver module

Appendix: Bill of material list of the DDS

Table A1. PIC_SERVER v3.7 module

Designator

Part/item

General footprint

Note

U1

RTL8019AS

100-pin QFP

 

U2

PIC18LF6722

64-pin TQFP

 

U3

24LC512

8-pin SOIC

 

D1

LED

0805

 

CN1

Socket (F)

IDC24

 

CN2

 

IDC26

 

C1-C6, C9-C10

Capacitors

0805

0.1uF (104)

C7-C8

22pF

Y1

XTAL

HC-49

20MHz

Y2

10MHz

R1-R3, R5

Resistors

0805

2.2kΩ

R4, R6, R7

4.7kΩ

R8

120Ω

R9

10kΩ

Table A2. Application board

Designator

Part/item

General footprint

Note

U1-U2

LM2940

TO-220H

 

U3

LM3940

 

U5

MAX232

DIP16

HIN232 compatible

U6

DS1302

DIP8

 

U7

MMC socket

 

7-pin, MMC-plus not compatible

U8

PT2272

DIP18

 

U9

RWS-530

 

 

J1

DC jack

 

 

J2

Sockets (F)

IDC24

 

J3

IDC26

 

J4

IDC30

 

J5

D-sub 9

DSUB-9-F

 

J6

DSUB-9-M

 

J7

RJ-45

 

P65-P01-11A9

J8

Sockets (M)

CON2

Jumpers

J9

C1, C3

Capacitors

RB

0.47uF

C2, C4

47uF/100uF

C5

33uF

C6-C9, C13

RAD0.1

0.1uF (104)

C10, C11

22pF

C12

1uF (105)

R1, R2, R19

Resistors

AXIAL0.3

2.2kΩ

R3

200Ω

R4, R6, R8,R10

10kΩ

R5, R7, R9

20kΩ

R11-R16

1kΩ (2.2kΩ)

R17

820kΩ

R18

100kΩ

LS1

Beeper

 

 

D1, D2

LED

 

90° LED set

S1, S2

switches

 

90°

S3

 

 

S4

DIP12

 

BT1

CR 2032 battery set

 

 

Y1

XTAL

 

32.768kHz

E1

Antenna

 

433MHz

Table A3. ZigBee RF transceiver module

Designator

Part/item

General footprint

Note

U1

MAX232

DIP16

HIN232 compatible

U2

XBee Seris 2 OEM RF module

 

2.0-pitch pin socket (F)

JP1

Socket

IDC30

 

J1

Socket

CON3

 

C1-C4

Capacitors

0805

0.1uF