RESEARCH ARTICLE
Adv. Sci. Lett. 20 (10-12), 2082–2086, 2014
Copyright © 2014 American Scientific Publishers All rights reserved Printed in the United States of America
Advanced Science Letters Vol. 20 (10-12), 2082–2086, 2014
Pollution Instrumentation Using GPS and Data Logger Based-on Propeller Ferry Wahyu Wibowo1 1
Department of Informatics Engineering, STMIK AMIKOM Yogyakarta, Yogyakarta, Indonesia
Pollution issues are all of countries in the world common problems. A lot of countries have policies to regulate their countries and reduce the pollutions, because this issue is very important in human lives. This paper uses parallax’s propeller demo board as controller. The mechanism of this instrumentation is to detect pollutant of carbon monoxide (CO) using gas sensor module. The gas detection data converted by analog to digital converter (ADC) attached on the gas sensor module. Parallax’s propeller is multi-core processor, so each core can be used to manage real-time data without waiting sequential instructions. The works of each module can be done by one propeller. GPS module is used to get data of latitude, longitude, altitude, date and time. These data are important thing for tracing position of the instrumentation placement on the map, e.g. google map. The data of time and date are used to know carbon monoxide concentration each time and when it is taken. Not only using GPS, but this instrumentation also used secure data (SD) card as the storage data of GPS and carbon monoxide concentration. Keywords: Instrumentation, Pollution, Sensor.
1. INTRODUCTION It can’t be denied that the fresh air environmental quality is a part of health. The air is the great component and it is important to creatures and needs to be preserved and increased its quality to support optimally health. The increasing of industries and vehicles makes some problems effecting directly to the environments. One of cases emerged by that problem is air pollution. Air pollution is a serious issue due to the human health threat, not just that, but air quality also limits human welfare and ecosystems. It can cause breathing difficulty, skin irritations, birth defect, immuno-suppression and cancer1. This paper observed to make an instrumentation of air quality with some characteristics to detect air pollutant source in such environment. The pollutant which is observed is carbon monoxide (CO) detected by MQ-7 sensor, although the sensor can be replaced with another sensors with such reference values. The carbon monoxide (CO) is formed by carbon (C) and oxygen (O2), together make a compound as imperfect combustion result while result of perfect burning will form carbon dioxide (CO2). *
Email Address:
[email protected]
2082
Adv. Sci. Lett. Vol. 20, No. 10-12, 2014
The carbon monoxide is a compound material with some characteristics i.e. odorless, tasteless, and it will form unseen gas at a normal air temperatures. The carbon monoxide also has toxic potention that is dangerous because it can bond in blood i.e. haemoglobin. Carbon monoxide also can cause slowing reflexes, so this must be aware. For reviewing and evaluating air quality, some novel methods to detect and measure pollutants have been researched and implemented. To capturing multi-pollutant (SO2, NOx, and Hg), it can use wet flue gas desulphurization scrubber fed by limestone and sodium chlorite. In this method, sodium chlorite additive shows significantly to capture NOx and Hg2. The features of measurement systems like flexibility, low-cost, and high speed digital data acquisition are always implemented to get easy and powerful designs. It will not possible to be done if application parameters due to the object and data analyzing is unclear. Internet is very important nowadays in human lives. The scientist and engineer try to integrate their needs in one aspect, in addition the progress of technology is faster day to day. Instrumentation remote will have high value when the monitoring is not done by human directly but it is done by machine or instrumentation. So the data can be reached and 1936-6612/2011/4/400/008
doi:10.1166/asl.2014.5629
RESEARCH ARTICLE
Adv. Sci. Lett. 20 (10-12), 2082-2086, 2014 analyzed as soon as possible. Nowadays, distributed instrumentation system and remote are developed as on-line monitoring environment3. This paper presented one of approached methods to measuring carbon monoxide in the air.
Fig. 1. DT-SENSE Gas Sensor Module6
2. RELATED WORKS The instrumentation for detecting pollutants on the air which are built in this paper due to the specific performance factors of devices. The devices used in this paper consist of parallax’s propeller demo board, MQ-7 gas sensor of carbon monoxide, DT-Sense gas module, global positioning system (GPS), SD-Card and SD-Card module. The applicated software tool to program parallax’s propeller is a simpleIDE application tool using programming language of C code. The simpleIDE tool is the official programming interface for Parallax’s propeller and open source software for programming parallax propeller microcontroller and can be downloaded in the site http://learn.parallax.com/propeller-c-set-simpleide. This tool is provided for three operating systems i.e. Windows, Mac, and Linux. Some libraries and examples have also been provided by the parallax for this tool1. For each operating system driver of COM port of the parallax’s propeller microcontroller can be found in the site http://www.ftdichip.com/Drivers/VCP.htm4. 2.1 Gas Sensor Module The implementation of gas sensor module is the important aspect to detect and measure the concentration of pollutants in the air. This paper presents a gas sensor module of DT-SENSE. This module is smart sensor module that can be used as module attached some sensors to detect gas concentration effects of pollutants in the air e.g. carbon monoxide (CO), carbon dioxide (CO2), liquefied petroleum gas (LPG), iso butane, propane, methane, etc. Some sensors which are compatible with this module i.e. gas sensor of MQ-3 for detecting alcohol; gas sensor of MQ-4 for detecting methane; gas sensor of MQ-6 for detecting LPG, iso butane, propane; gas sensor of MQ-7 for detecting carbon monoxide, gas sensor of MQ-135 for detecting air quality; and gas sensor of MG811 for detecting carbon monoxide (CO2). Beside of that gas sensors, some pollutants can be detected using such sensors and set the point reference manually to control the gas concentration. The pollutant of CO can be detected by MQ-7 sensor with some factors must be considered like humidity, temperature, especially the capacity of oxygen5. This smart sensor module uses transistor-transistor logic universal asynchronous receiver transmitter (TTL UART) and inter integrated circuit (I2C) buses to communicate between sensor and microcontroller. For exchange data, the I2C bus using two pins which are serial data line (SDA) and serial clock line (SCL). When using I2C bus, DTSense gas sensor module can be cascaded up to 8 modules. This smart sensor module also attached analog-to-digital converter (ADC) with resolution of 10 bit. The schema of DT-Sense gas sensor module shown on figure 1. Adv. Sci. Lett. Vol. 20, No. 10-12, 2014
This paper used I2C bus as the data communication to the parallax’s propeller. The MQ-7 carbon monoxide sensor has capability for sensing carbon monoxide (CO) with good range of calculation and some factors can cause unstable condition due to its performance. Connector and jumper setting (J3) have function as connector for module power supply, TTL UART and I2C interfacings. Pin numbers, names, and functions shown on table 1. Pins 1 2 3 4 5 6
Table. 1. Pin numbers, names, and functions. Names Functions GND Reference point for input power supply VCC Connect to 5 Volt power supply RX TTL serial level input to the DTSENSE module TX TTL serial level output to the DTSENSE module SDA I2C data bus input / output SCL I2C clock bus input
Function of RLOAD jumper (J7) is to choose load resistor which is going to be applicated by DT-SENSE module signal conditioning circuit, so the module can be functioned for more sensors that will be activated. The RLOAD configurations shown on table 2. Table. 2. RLOAD configurations RLOAD Jumper (J7) Load Resistor values and Sensors Resistor value of 2K2 Ohm MQ-4 and MQ-135 sensors
1936-6612/2011/4/400/008
Resistor value of 3K3 Ohm MQ-3 and MQ-7 sensors Resistor value of 5K1 Ohm MQ-6 sensor Resistor value of 100K Ohm MG-811 sensor
doi:10.1166/asl.2014.5629
2083
RESEARCH ARTICLE DT-SENSE Gas sensor module has 2 indicator light emitting diodes (LEDs), i.e. red indicator LED and green indicator LED. When the performance is on power-up state, the red LED will blink as I2C module addresses. If the I2C address is 0xE0, the indicator LED will blink 1 time. If the I2C address is 0xE2, the indicator LED will blink 2 times. If the I2C address is 0xE4, the indicator LED will blink 3 times and so on until 0xEE I2C address, the indicator LED will blink 8 times. In addition, the green LED will blink faster until the sensor is stable. Time to reach stable condition for each sensor is different depends on sensor response and heater condition. If the condition is stable, so the green LED will light on without blink. When the condition is on normal operation after power-up, the red LED will blink as reading of the sensor and chosen operation mode. While the reading of sensor is stable, green LED will be light on and off slowly as long as gas concentration changing. There are 2 available operation modes i.e. hysteresis and window operation modes. The work of the hysteresis operation mode as follows : 1. If the result of analog to digital conversion sensor values less than low limit, then the output pin will be off (red indicator LED is turned off). 2. If the result of analog to digital conversion sensor values greater than high limit, then the output pin will be on (red indicator LED is turned on). 3. If the result of analog to digital conversion sensor values equal to between low and high limits, then the output pin will not be changed. Meanwhile the work of the window operation mode as follows : 1. If the result of analog to digital conversion sensor values less than low limit, then the output pin will be on (red indicator LED is turned on). 2. If the result of analog to digital conversion sensor values greater than high limit, then the output pin will be on (red indicator LED is turned on). 3. If the result of analog to digital conversion sensor values equal to between low and high limits, then the output pin will be off (red indicator LED is turned off). If the chosen limit value source using resistor variable attached on DT-SENSE gas sensor module, then the operation mode enacts hysteresis operation mode only. The resistor variable value will be used as high limit value, while low limit is always value of 50 point under high limit value. If the chosen limit value source is using storage value on EEPROM attached on DT-SENSE gas sensor module, so the operation mode that can be enacted i.e. hysteresis and window operation modes6.
Adv. Sci. Lett. 20 (10-12), 2082–2086, 2014 on-board. The usage of industrial standard of SiRF star III chipset makes the module has bargaining position as mini featured GPS solution, its size is about 1.93” x 1.42”. The GPS receiver module is standard component using string national marine electronics association (NMEA0183 data protocol) or data specified by user via serial command interfacing and able to trace until 20 parallel satellites for fast acquisition and reacquisition, and has functionality wide area augmentation system/European geostationary navigation overlay service (WAAS/EGNOS) demodulator for accurate position. The module provide date, time, latitude, longitude, altitude, speed, etc. It uses rechargeable battery for memory and real time clock (RTC) backups. The advanced algorithm provides superior navigation performance and this module is opensource. For data communication, it uses TTL serial port with baud rate of 4800 bps but it can also work on baud rate of 9600, 19300, and 38400 bps7. 2.3 Data Logger This paper used data logger to store its data on the secure digital (SD) card connected to serial peripheral interface (SPI). SD card is the important flash memory device collecting sector. Each sector has 512 byte and can be millions of sector on huge SD card. SD card doesn’t have file system, so FAT16, FAT32, NTFS, linux file systems, etc. could read SD card. Interface drivers need to translate data at the sector of SD card into file system. It is just operation needed to implement FAT16/32 file system capability to read or write a sector. SD protocol and hardware support that, so to support FAT system, need to write driver implementing FAT file system on SD card and translate it to directory, boot record, and so on. The SD command formatted transmitting and receiving from SD card via the SPI interface a byte clock once consists of command, data, and others made from the single or double byte transactions. All communications use write and read byte SPI methods, and the layer of SD is above on it. This paper used an easier SPI protocol mode, although it is not faster than SD protocol mode. At the SPI mode, SD card and multimedia card (MMC) work on same ways, so the software and driver can use MMC card. All communications with SD card done via SPI interface, so when it is reading or writing, the object interface of SPI communication is used. This is a different communication with SD mode. Figure 2 shows an SD card command format on the SPI mode.
2.2 Global Positioning System This paper used PMB-688 global positioning system (GPS) produced by Parallax Inc. Parallax’s GPS receiver module designed to be worked with grand idea studio (www.grandideastudio.com). The parallax’s GPS receiver module is fully integrated devices, low-cost with antenna 2084
Adv. Sci. Lett. Vol. 20, No. 10-12, 2014
Fig. 2. SD card command format on SPI mode A 32-bit address must have format of big–endian that is a high byte until low byte. This is different with Intel’s format that is little-endian format. When it wanted to send 1936-6612/2011/4/400/008
doi:10.1166/asl.2014.5629
RESEARCH ARTICLE
Adv. Sci. Lett. 20 (10-12), 2082-2086, 2014 $F5_B3_33_12 in the big-endian format, it will send $F5, then followed by $B3, $33 and the last is $12. So the word address might not be needed to give a piece of command, if not it always makes $00_00_00_00. After that a cyclic redundancy check (CRC) checksum byte must be computed based on byte 1 until 5. The SD card after receives byte 1 until 5, then it will compare CRC which is sent and computed, if it isn’t same, then SD card will show an error. The same condition when SD card is receiving command, SD card will send back response related to the CRC.
longitude from GPS can be read on the map, e.g. google map or other map applications. So, it will show the position mark of instrumentation on the map. In addition, the date and time from GPS is used to get date and time of taking pollution concentration data. All data will be saved on the SD card as data logger via SD card slot. The global design of the instrumentation shown on figure 3.
2.4 Parallax’s Propeller Chip The knowing of architecture and programming of propeller chip in this paper is very important to get global and clear controlling and interfacing as host attached some devices to do a data communication. The propeller chip is designed to provide high speed processing in the embedded systems and consuming less current and small physic. One of features that propeller chip had is to fast chip performance and propeller has flexibility and power done by eight processors that are well-known as cogs. Cogs can provide simultaneous or co-operative free assignment, while simple architecture is easier to learn and use. The result of propeller programming design is independent application development of embedded systems programming complexity. This is because propeller chip has flat memory map that doesn’t need paging with code block, variable, and data. Asynchronous process is easier to be handled than using chip that has interrupt process. Propeller doesn’t need interrupt processing, it is just using some cogs with high bandwidth performance. So, the application result is more responsive when it used to. A propeller assembly language has conditional execution features and optional result of programming code for each individual instruction8. A propeller assembly language that is used to program parallax’s propeller chip known as spin, but in this paper the programming code to program propeller chip is using C programming language. The C programming is written on simpleIDE application tool. P8X32A parallax’s propeller chip has 32 input/output pins i.e. port A from P0 until P31. Four input/output pins have special purposes i.e. pin P28 until pin P31, and others are general purposes. At the power-up/reset, pin P30 and pin P31 communicate with host for programming, while pin P28 and pin P29 are used to interface 32 kb electrically erasable programmable read-only memory (EEPROM) i.e. 24LC2569. 3. RESEARCH METHODOLOGY This paper observed parallax’s propeller module as controller of interfaces. The mechanism of this instrumentation is focus on the gas sensor module to detect pollutant. The detected carbon monoxide gas from MQ-7 sensor will be converted by gas sensor module and transmitted into parallax’s propeller. A GPS module is used to get data of determining location coordinate of the instrumentation placement. The data of latitude and Adv. Sci. Lett. Vol. 20, No. 10-12, 2014
Fig. 3. Schema of measurement instrumentation design The USB digital oscilloscope is used to capture data signal to make sure the output signal is same as desired signal and the monitor is to monitor the data values. Overall, this paper presented the MQ-7 gas sensor and GPS data will be processed by parallax’s propeller as informations. So, the informations will be saved all the time on the SD card as data logger when the battery is turned on. When the informations need to be observed or analyzed, then the files on the SD card can be taken.
4. EXPERIMENTAL RESULT Operation speed per core of propeller implemented in this paper is about 80 MHz and the instruction speed is about 20 mega instruction per second (MIPS) or a quarter of available clock value of 5 MHz attached on the parallax’s propeller board. The operation speed is used to execute driver of module blocks consist of monitor, GPS, SD card and gas sensor module. The data taken from satellite done by GPS that is connected to the data pins of propeller on the pins P6 for Tx and P7 for Rx. The baudrate used for the data communication is about 4800 bps. There are 5 pins to interface with other modules, i.e. gas sensor and SD card modules. To interface between both propeller and SD card using 4 pin that are MISO signal of SD card attached to pin P0, clock (SCLK) signal of SD card attached to pin P1, MOSI signal of SD card attached to pin P2, and chip-select (CS) pin attached to pin P3. And the rest of pins used to interfacing with gas sensor module. Monitor attached to the VGA module, the function is to monitor the values changing for each clock. Programming that is used in this paper using C programming written on the simpleIDE tool. The libraries has been provided by the parallax and up-to-date if there are new libraries in the parallax link, so the user or programmer with a simple technique can use it effectively. The libraries used for programming propeller are simpletools.h, vgatext.h, serial.h, simplei2c.h and sdcard.h. The simpleIDE tool has a feature of terminal
1936-6612/2011/4/400/008
doi:10.1166/asl.2014.5629
2085
RESEARCH ARTICLE display, so the programmer can see the result of data, it is very helpful for the programmer. The GPS module of PMB-688 completed with the LED indicator to show the data communication process of GPS module. The interfacing of modules connected to the parallax’s propeller shown on figure 4.
Adv. Sci. Lett. 20 (10-12), 2082–2086, 2014 Display of the instrumentation shows the information captured from the satellite. The experiment done by catching information of latitude by value of N 0000.0000, that means recorded coordinate is north and information value for longitude is E 00000.0000, that means recorded coordinate is east. For the time clock and date captured repectively as 001001.035 and 151213. Clock shows 001001.035 means 00 o’clock, 10 minutes, and 01.035 seconds. While recorded date is 151213 means day 11th, month 11 (December), and year 2013. 5. CONCLUSIONS
Fig. 4. Connection of propeller and modules A characteristic had by parallax’s propeller board is the capability of programming data storage. It uses two data storages, i.e. random access memory (RAM) and electrically erasable programmable read-only memory (EEPROM). If the programming data storage allocated on the RAM, then when the power supply unplugged, the programming data will be erased automatically, but when the programming data storage allocated on the EEPROM, the programming data is still remain although the power supply unplugged. For the testing, this paper recommends the programmer to use RAM as programming data storage, so the programming data will be reset after turning the power supply off. The data storage done by SD card implements signal detection on pin P2. If the value of pin P2 is not equal to 0, then SD card will be error, but when the value is inversely, then the SD card ready to receive and record data. Display of GPS information text done by writing of date, time, value of pollutant detected by MQ-7 gas sensor, latitude, longitude, altitude, and GPS heading (see figure 5).
This paper shows the integration of modules of GPS, monitor, SD card, and gas sensor connected to the propeller. The PMB-688 GPS module needs to be connected to the external antenna wiring to capture signal as well. The instrumentation of detecting pollutant can be modified using other pollutant gas sensors with considering its load resistance setting. ACKNOWLEDGMENTS This work was supported by division of research, development and public service of STMIK AMIKOM Yogyakarta.
REFERENCES [1]
[2]
[3] [4] [5]
[6] [7] [8]
[9]
C. Wright, R. Oosthuizen. Air Quality Monitoring and Evaluation Tools for Human Health Risk Reduction in South Africa. National Association for Clean Air Conference (NACA 2009). Vanderbijlpark, South Africa, (2009) 6. R. Krzyżyńska. A Novel Method for Nox- and Hg-emission Control in Power Plants Using Existing Wet Limestone Scrubbers. Industrial Fluidization South Africa (IFSA 2011). Johannesburg: Southern African Institute of Mining and Metallurgy (2011) 353-360. M. Branzila. Instrumentation and Virtual Library for air Pollution Monitoring, Air Pollution, Vanda Villanyi (Ed.) (2010). Lindsay, A. Propeller C - Set Up SimpleIDE. http://learn.parallax.com/propeller-c-set-simpleide. Retrieved December 11st 2013, (2013). F. W. Wibowo, P. P. Purwacandra. Carbon Monoxide Pollution Detection and Measurement Using Knowledge-Based and Probability Approaches. 7th International Seminar on Industrial Engineering and Management (7th ISIEM), Bali, Indonesia (2014). Innovative Electronics. DT-SENSE Gas Sensor. Innovative Electronics, (-). Parallax. Parallax GPS Receiver Module. Parallax, Inc. (2010). S. Avery, Lindsay, M. Gracey, A. Hintze, J. Martin, V. Graner, A. LaMothe, H. Sander. Programming and Customizing The Multicore PopellerTM Microcontroller. McGraw-Hill Companies, Inc (2010). M. Hibbet. Introducing The Propeller Processor, Everyday Practical Electronics, ed. April 2010, pp. 60-61.
Fig. 5. Display of instrumentation
2086
Adv. Sci. Lett. Vol. 20, No. 10-12, 2014
1936-6612/2011/4/400/008
doi:10.1166/asl.2014.5629