The design concept evolved from the requirements stated above. The basic functionality for each unit – independent of its function (e.g. sensing node or base station) – is incorporated into the core board. The core board offers processing, non-
volatile memory, power, and wired as well as wireless communication. It also has a physical connector for Add-On boards, offering analog inputs, digital I/O, and I2C communication. All specific functionality, in particular sensing, is realised as an Add- On board that can be physically and electrically attached to the core. Figure 15 shows a core board with a sensor board attached.
The software is also tied to these hardware modules. Specifically the software framework for the core board offers primitives for the base functionality and also to access the Add-On boards.
In the following sections the implementation of the core board, several Add-On boards and the back-end integration is described.
5.4.2.2 Core Board
The basic design of the core board is centred on a PIC16F8765 Microcontroller offering processing, analog inputs, and digital I/O. A Ramtron FM24C64 ferro- electric memory is connected via I2C to the MCU [Ramtron,02]. The FRAM-chip provides 8KByte of non-volatile memory. These components are the only two parts in the core board that hold state information. Therefore they are not directly soldered in the board; they are hold in a socket. By physically moving the MCU and the FRAM from one board to another all program and data memory is moved. This makes it easier to keep old versions – instead of reprogramming the system or storing the whole system, only the MCU and the FRAM have to be stored for a particular version of a prototype. Furthermore the ability to transfer the processor with the software and the memory chip to another board also eases debugging.
Wireless communication, another Smart-Its key requirements, is realised using a BIM2 transceiver module from Radiometrix [Radiometrix,02]. The transceiver offers raw data rates up to 160KBits/s in half duplex mode. Running at higher data rate the module requires a balanced code (50% “0” and 50% “1”), however at lower data rates this is less critical and a serial data stream can be sent directly. As the wireless transmission is unreliable securing the transmission in software is inevitable.
Directly on the core board there is also a RS232 connection included. To ease the connection to PC or PDAs and hence debugging a SUB-D connector is included, despite the size of the connector. The TTL-signal on the MCU is converted into a RS232 signal using converter. In the design the MAX233, which does not require external capacitors was favoured over the MAX232 to reduce the component count on the board.
As the core board should offer a flexible platform – for mobile as well as stationary use – various ways for providing power are included. For mobile use the power can be provided by 4 AAA-rechargeable or by 4 AAA-batteries. In stationary use there is also a further option to provide power externally by a supply that outputs 6-18V DC. If the power is provided by batteries or by an external source a power regular (low voltage drop version) provides a 5V supply. In case of rechargeable the 4.8V are used directly. The type of power supply can be selected by a dip-switch. To ensure that the device is not damaged in case the power is provided with wrong polarity a diode and a fuse are included.
A connector with 20 pins provides the electrical and physical extension to the core board. Add-on boards can be pluged into the connector. The connector has three groups of pins: one for I2C, one for digital I/O, and one for analog inputs. In summary the 9+8+3 connector provides 3x GND, 2x 5V-power, 5x analog-input, 7x digital I/O, one digital output and a I2C connection (2 pins, SDA and SCL).
The overall design results in a device with about 30 components. To understand the basics of operation it requires only looking at 5 datasheets (Microcontroller PIC16F876, RF Transceiver BIM2, Serial line driver MAX2322, Memory FR16C64, and voltage regulator 78L05). The physical size is about 55x70x29 mm and about 58 grams (110 g with 4 AAA-batteries). In Figure 16 the block diagram is shown; in Figure 17 (right) the module is depicted.
Exclusively for mobile use a further version of the core board which is much smaller 45x50x19 mm and only weights 24 grams (29 grams with a 3V battery) is developed, see Figure 17 (left). It has the same main components (processor, FRAM, and RF transceiver) and offers the same 20-pin Add-On connector. It is software compatible to the other version. The differences are in the power supply – it runs from a single 3V Lithium battery. Also RS232 level conversion and the 9-Pin Sub-D connector are omitted.
The design rational for the PIC microcontroller was the manifold. One important reason was that the MCU is widely used in education and therefore a lot of
Microcontroller (PIC16F876 or PIC18FXXX) FRAM Memory Analog Input Digital I/O I2C Bus Radio transceiver RS232 Driver Sub-D connector Voltage Regulator Battery Holder DC connector A d d- On Con n e c tor Digital I/O Digital I/O Analog Input Analog Input
Figure 16: Block diagram of the Smart-Its core. The overall diagram shows the larger general purpose version. The part with the grey background shows the
information is easily available. Compared to other microcontrollers (e.g. ATmega103) it is fairly cheap and power consumption is low however it offers less memory. Furthermore the availability of a compiler (which is commercial) that provides a large set of libraries was another reason for choosing this MCU. To compensate for the lack of memory the cheap and power saving FRAM chip is included in the design.
To make the hardware easily reproducible it was opted for a conversional design using no SMD technology. This decision resulted in a larger physical size however it eases assembly, soldering and debugging dramatically. Also to ease debugging 2 LEDs have been included in the design – on which is permanently on indicating the availability of power and the other which can be controlled by software.
For the core board a library and software templates are provided. The library provided functions to access all functionally offered by the core board. In particular for
• sending and receiving messages using wired or wireless communication, • storing data in and retrieving data from the external memory,
• accessing analog input,
• reading and writing digital I/O, and • switching the LED.
The templates are programs that can be compiled and run on the core board. They make use of the libraries and provide a particular function. They are intended to be used as starting point for new development. Examples for templates are
• base-station template
This program reads from the wireless connection and hands on everything that was received to the serial RS232 connection. This template is a starting point for developing code for modules that provided base-station functionality. • Sensing loop template
This program contains a infinite loop in which all analog inputs are read and then send over the wireless link as well as over the serial line. This template is the starting point for developments that read sensor data, process them, and provide them to other components in the system.
The schematics are depicted in Appendix E.1: Core Board Schematic. and Appendix E.2: Mini Core Board Schematic. Further technical details, in particular an electronic version of the schematic, the PCB-layout, and the header file are available at [Schmidt,02b].
5.4.2.3 General Sensor Board
The general sensor board is designed as an Add-On board to the core providing a basic sensing system. It is intended for prototyping of context-aware rooms and artefacts, especially in an early proof of context phase. The included sensors make it easy to collect data in situ on a real artefact or in a real world setting. The data can then be used to find out which of the sensors are useful in the setting investigated. Based on these initial experiments a specific device or Add-On can be developed. The block diagram of the sensor Add-On is depicted in Figure 18 (left). Specifically the following sensors are included:
• Two light sensors. The boards can be equipped with a variety of pin compatible light sensor of the TSL25X and TSL26X series [TAOS,02]. Aiming at different wavelength and amplification factors.
• Acceleration/orientation in two dimensions. An ADXL202E sensor provides information about acceleration and that is dependent on the way the device is hold. If no acceleration occurs the output represents the spatial orientation. • A capacitive touch sensor. To get information about user interaction a
capacitive touch sensor is included. The sensing surface can be extended to any conductive surface on the artefact (e.g. a door handle can be made touch sensitive).
• A passive infrared sensor (PIR) module is mounted on the board. The digital output signals movement of people or animals around. The lens – a half sphere – offers a viewing angle of 360º with an opening of 180º. This sensor works only on the 5V version of the core board.
• Also a digital temperature sensor is on the board. The sensor is on the I2C bus and provides a resolution of 0.5º centigrade.
Beyond the sensors also two LEDs are included in the design. Having visual output on the boards makes it easy to give simple feedback, especially when debugging applications. The sensor board is depicted in Figure 18 (right). The full schematic is depicted in Appendix E.3: General Sensor Board Schematic.
Analog Input I2C Bus Light Sensor (TSL261) Add -O n C o nn ec to r Light Sensor (TSL251) Analog Input
Digital I/O Touch
(QT110)
Digital I/O Acceleration
(ADXL202)
Digital I/O PIR Module
Temperature (DS1621)
To run the core board with a sensor Add-On as wireless sensing node, basic software is provided. It implements a sensing loop at the end of which the current results are sent via RF and also over serial line. The code is also a basic framework for more elaborate usage of the sensor Add-On.
A more advanced version of the sensing software is configurable. It also executes a sensing loop, but keeps a history and calculates basic statistics of the sensor values over time. The serial line can be used to change the configuration, in particular which sensors are read, the transmission format, the sensing speed, and how often a wireless transmission is carried out.