Implementation of Low Cost Data Logger Using Flash Disk with File Allocation Table
Total Page:16
File Type:pdf, Size:1020Kb
Implementation of Low Cost Data Logger Using Flash Disk with File Allocation Table Panupong Thanutong1, Dusit Thanapatay2, Kamol Kaemarungsi3 and Tsuyoshi Isshiki4 1TAIST Tokyo Tech, ICTES Program, Dept. of Electrical Engineering, Kasetsart University, Jatujak, Bangkok 10900, Thailand 2Dept. of Electrical Engineering, Kasetsart University, Jatujak, Bangkok 10900, Thailand 3Embedded System Technology Laboratory, National Electronics and Computer Technology Center, Pathumthani 12120, Thailand 4 Dept. of Communications & Integrated Systems, Tokyo Institute of Technology, S3-66, 2-12-1, Ookayama, Meguro-ku, Tokyo 152-8550, JAPAN computer for further analysis using software analyzing tools. Abstract— Data logger is a device used for storing Data loggers can be applied in various fields such as in [1] measurement data. It can be used in wide range of embedded where data logger is used to observe city’s air environment or in logging applications. This paper reports on practical development [2] where it is used for collecting galvanic skin response (GSR). experience and design’s details of a low cost data logger prototype. In this paper, we developed a prototype of low cost data The data logger in this paper is also compared with two of existing data loggers in the literature. This data logger combines 32-bits logger as a part of our planned research project in a microcontroller and flash disk with file allocation system (FAT) hydrological system application for monitoring rivers. The data together with programming technique to control the hardware for logger will be connected to a hydrological sensing system recording and monitoring of general proposes measurements. which consists of a set of wireless sensor nodes and several This data logger stores the data on removable flash disk for hydrological sensors. However, to test our prototype in this convenient and can forward real time measurement data through paper we decided to use basic sensor device which can be RS232 standard serial port to be display on LCD. The applications studied in this paper are based on logging of obtained easily such as temperature and humidity sensors. temperature and relative humidity from a SHT15 digital sensor. These sensor devices are low cost and simple to integrate to our The data are stored in form of comma-separated values file (CSV) data logger prototype. For example, SHT15 is an integrated because this file format can be read and understood by many temperature and relative humidity sensors in one package [9] platform applications such as MySQL, MS-Excel, and MATLAB. which is very convenient. We designed our prototype of data The microcontroller in this prototype provides power down mode logger based on [3] with different structure for both hardware function that can save energy during long waiting operation and its storage memory can record measurement data for several and software. years. Keyword: data logger, embedded system, temperature and Relative humidity sensing, FAT system. I. INTRODUCTION owadays, the applications of embedded and ubiquitous N sensing systems are increasingly popular. Examples of embedded sensing application are in the area of monitoring systems such as meteorology, hydrological, mining and food industries. A data logger is an embedded electronic device that can be a part of those monitoring systems. The main functionality of data logger is to record data from sensing system over time. Generally, a data logger can obtain data from Fig 1. System architecture of the data logger measurements in several ways such as through attached Fig. 1 illustrates the system architecture of the data logger in analog-to-digital converter (ADC) or sensory data sent via this paper. At the center, the microcontroller is the heart of the various communication protocols and serial communication data logger where we use STM32 ARM Cortex M3 which is a port (USART). The data maintained in the data logger collected low cost 32-bit microcontroller with a lot of built-in from monitoring system can be transferred to personal functionalities. Our data logger consists of major component such as a RS232 serial interface for communication with personal computer, a SHT15 temperature and relative humidity sensor for measuring environment, a 16-character by 2-line [9]. Finally, this data logger prototype can also take inputs from liquid crystal display (LCD) to display data output, Micro SD other measurements through additional ADC ports on the card for a storage memory, and other analog input/output (I/O). MCU. The ARM Cortex M3 provides three channel of 10-bit The organization of this paper is as follows. First, Section II ADC for connecting with other sensors such as CO2 sensor as in describes the hardware design and each major component. [1]. Note that the data logger circuit can measure voltage Next, Section III describes our embedded software design for between 0 and 3.3V at ADC channel 1. the data logger. Next, Section IV reports on preliminary C. Storage Memory measurement results and compares our data logger with others. Finally, Section V concludes our work and briefly mention Traditionally, the storage memory for most data loggers was about our future works. based on electrically erasable programmable read-only memory (EEPROM) or small general purpose random access memory II. HARDWARE DESIGN (RAM) [6]. These devices were easy to use and require lower write cycle. However, today flash memory in form of MicroSD A. Microcontroller Unit (MCU) card is getting cheaper with larger capacity. Thus, MicroSD The selected microcontroller unit for the data logger system cards are gaining popularity in modern embedded system. The is an STM32F103 ARM Cortex M3 [15]. This microcontroller MicroSD cards used in this prototype are very small with (MCU) provides a good price per performance when compared dimension of 15mm x 11mm x 0.7 mm and weight only 0.0.4g to others well known microcontrollers such as MSP430 [5], [1]. The capacity of MicroSD used in this work is 2 GBytes AVR32 [6], and PIC16 [7]. The price of this MCU is very since it is the maximum physical limitation for FAT16 [1]. The attractive among those popular MCUs. With 32-bit main advantage for using MicroSD card as data storage system architecture, it provides better computational power at similar is the ease of transferring data directly to other electronic or lower price point than some 16-bit architecture. The major devices such as laptops or smart phones which support FAT advantage of ARM Cortex M3 lies in its Thumb-2 instruction format as file system. User can reduce the time to transfer and set which allows this MCU to have 32-bit performance with convert the data from traditional EEPROM to other data 16-bit code density [8]. Moreover, it can run at 1.25 DMIPS analysis systems. (Dhrystone Million Instructions per Second)/MHz. The MCU D. Circuit Diagram is faster up to 35% and up to 45% less code than ARM7TDMI [8]. It is fully equipped with a number of peripheral interfaces Our data logger prototype is developed on existing such as I2C, SPI, USART, analog-to-digital converter (ADC) development board called ET-STM32F103 from ETT and digital-to-analog converter (DAC). Another reason for Company [11]. Fig. 2 depicts a circuit diagram of our prototype choosing this MCU is that its manufacturer provides free which is based on schematic from [11] that were attached with license of standard firmware libraries to be used in SHT15 from [9] and an LCD. Note that the peripherals around development of complex applications. the MCU are similar to the architecture in Fig. 1 which consists of RS232 interface, LCD, SHT15 sensor, and SDMCC socket B. Measurement Module for SD card. We chose this board because we needed a stable For our evaluation purpose, we initially use only one sensor hardware platform for programming and performing for our test. A sensor device called SHT15 is attached directly experiment. We plan to develop our own print circuit board to the microcontroller ARM Cortex M3. SHT15, which is a (PCB) once the prototype and its peripherals have been well known sensor device, is applied in measurement module verified. where it provides sensory data to our data logger. This sensor device has analog-to-digital conversion over linear temperature and relative humidity and it has built-in on chip ADC circuit [9]. Thus, we do not require separate ADC before attach the sensor device to MCU. This simplifies the testing of our prototype. Note that with the structure of this SHT15 sensor chip is different from the one used in [3] where they used pure analog sensors. Additional advantages of this sensor device are that it can reduce the component count and the hardware complexity. Another advantage of SHT15 is that it has fast response time and uses CMOSens technology to guarantee reliability and stability [9]. The size of this device is also small with a dimension of 7.47 x 4.93 x 2.5 mm. Its weight is only 100 mg. The sensor also requires low power consumption with average current consumption of 28µA and can be used with single power supply between 2.4V and 5.5V [9]. The SHT15 has operating range for temperature between -40 to 123.8 Fig 2.Simplified circuit diagram of the system Celsius and range for relative humidity between 0 to 100%RH III. SOFTWARE DESIGN B. Programming Language A. Flowchart Diagram of the Data Logger The software was developed using C language, cross-compiled, and loaded into the MCU. We used IAR The flowchart of embedded software that controls our data Embedded Work Bench for ARM as a complier tool [12]. logger is showed in Fig. 3. In this section, we briefly explain the operation of our data logger. C. FAT File System In the first step, user needs to configure parameters for To implement the FAT File System into the propose data sensory data recording via USART.