Search It !

Sunday, 8 June 2014

Part 3: The Sensors and Connections

After part 1 and part 2 is  over well, we are now focusing on the TGS2600 for contamination detection sensors.

What is TGS2600 ?
 It is a metal oxide sensor developed by Figaro (USA) for the air contamination (such as Carbon Monoxide) sensors. The sensor is heated internally until the metal oxide sensor can capture the air pollutants reading in parts per million. The output from this sensors is in form of the resistance reading (in ohm , Ω ).

Here is a picture of the sensor used in Raspberry Pi.


How to connect it to the Raspberry Pi?

This is the bottom view of the cross sections of the said sensor


The schematics for the sensor connections is as followed



How to connect to Raspberry Pi ?

You can solder it but preferably it is advisable to use non - permanent connection mode by using female - female jumper (if you do not have / rusty soldering skill) .

Here is the GPIO connection in Raspberry Pi.
There are a total of 26 connections with 13 pins on each sides.
All of the GPIO pins are to be used interchangeably with one another ( except for the 3 power pins )



On the board, the P1 indicator refers to the top left of the GPIO pins.


On the breadboard, we are using a analogue to digital converter chip, a Microchip MCP03800

Saturday, 31 May 2014

Part 2 : The Software Setup

Hi, welcome to Part 2 of setup. Technically,this is not software but operating system setup.
This guide assuming that you know how to operate Windows 7 operating systems.

First of all, we need a full size SD card. You may use mini / micro sized SD card with adapter.
For this Raspberry Pi project, I used my old trusted SanDisk Ultra Class 6 SD cards


For beginner,  prepare a SD card, mine was a SanDisk Ultra SDHC Class6 8GB. It is confirmed to be working for me. Any brand of card is maybe acceptable but you need to make sure that you have more than 2GB spaces as the OS for Raspbian (Raspberry Pi official OS) is known to take about 1.3 GB spaces.If you are willing, you can leave the SD cards that is working in the comment

Prepare the SD cards using SDFormatter at  https://www.sdcard.org/downloads/formatter_4/. Use this options to format the SD cards


Then , surf to http://www.raspberrypi.org/downloads/ to download the OS. Select the NOOBS Offline and network install parts. After finished downloading, unzip the files and copy it into the freshly formatted SD cards. 

Then , connect the Raspberry Pi to the LCD using HDMI and use select "Source" in your TV remote to select HDMI ports plugged in.


But my Raspberry Pi PWR LED lights on but there are nothing on display
There are few reasons why your Raspberry Pi is not showing anything on the LCD display.
Based on my trial and error experiments

1. HDMI cable is not plugged in properly or faulty HDMI cables. Poor connections = no output display.

2. SD card is locked . Raspberry Pi needs to unlock SD card before it can modify the contents inside SD card
Unlock it (Slider is pushed opposite of Lock directions) . Look it at the left side of the SD card (In this case Sandisk)


3. SD card not formatted correctly
You maybe skipping the format the SD card parts. Reformat using SDFormatter software and copy the NOOBS into SD card and boot them again

4. SD Card damaged
Test the SD cards can be readable in Windows machine. If not, replace with other known working SD Cards

5. Power adapter does not give enough power to the Raspberry Pi board
The adapter is supposed at least to give 5V and 0.7A 

Ok , Now I can see display on the LCD screen. Now what ?
Congrats ! Now yopu can proceed to the next step.
Select Raspbian [RECOMMENDED] as it is highly optimized for Raspberry Pi.

You can select others but other Linux Distro is more confusing than the Raspbian with Windows looks alike interface.


Wait for the OS images to be fully unpack . Unpack is term used in Linux to unzip the file.
NOOBS is essentially a "packed" OS.

Remember this very well. You will need this soon...

Finally, finished install the OS after around 25 minutes.


You will see this as your first setup. You will need keyboard for this.
Press [Enter] and finished.


The screen will filled like with lines and lines of code like Matrix style .
Supposedly, it will stop at a point where system request for Usename.Type in as follows

Username: pi
Password: raspberry

And the password field may look blank when you type in but it is not. It is one of Linux security features .

The screen will scroll more.
Type startx to go to familiar Window Interface


Saturday, 17 May 2014

Part 1: The Hardware Boot Setup

For this air quality monitoring project, we are going to use a low cost but accurate enough sensors to monitor air quality. Hence, Raspberry Pi is chosen as our development platform.

What is Raspberry Pi ?
It is a low costs SBC (Single Board Computer) that is designed in UK and made in UK (in mid 2013 onwards).There are 2 types of Raspberry Pi model : Model A and Model B.

They are almost same a PC but their specs is only a bit off.

The differences are stated below.


Model A B
RAM 256MB 512MB
USB 1X 2X
Ethernet (LAN) No Yes

Here is how the Raspberry Pi (Model B) will looked like (If you bought it from Element14)
Although Model A may suffice but Model B is preferable as we might need to use the network (Internet) to update the readings in future road maps of this project.


Here is short over view for each functions of the ports -
(General Purposes Input Output) GPIO - It functions to receive inputs from sensors and also as well as give commands to the stepper motor to perform turning

RCA video jack - This video jack is used on older type of CRT TV but it is not advisable to use this as the quality pictures displayed on screen is not suitable for debugging (For example the '6' is too similar to 'b')

3.5mm audio jack - This port is same as the smartphone audio port to plug in the earphone

Dual USB Ports - No into needed but their main purposes is to plug in keyboard and mouse separately

RJ45 Ethernet LAN - Plug to Internet connections using LAN cable

External Display (Display Serial Interface)  - A methodbeside HDMI to hook up the display to LCD panel

HDMI - Cable that transfer high res pics and sounds to LCD panel that supports it.Recommended to buy a HDMI cable and plug it into the TV

Micro USB - The main source of power for Raspberry Pi comes from here

External Camera Board (Camera Serial Interface) - It is connected to 5MP camera recently launched by Raspberry Pi

 
How to power up this thing ?

Simple,use your smartphone (any brand) charger adapter (with micro USB Type A). To make sure it is working, plug in adapter with rating of 5V and at least 0.7mA and above. Shown here is my adapter for Galaxy S3 charger with 5V and 2A . The extra amps is to provide more juice during its computing intensive calculations.

The design of Raspberry Pis intentionally like that to let the developer to power the board using the smartphone charger means less cost to buy any specialized charger.


Behold, Red LED (PWR) will light on. It indicates the Raspberry Pi is working well

In next section,we are going to talk about the software (OS) setup.

We need the following items (SD Card)

Monday, 12 May 2014

AIr Pollution Info Sharing

Introduction
Particles released into the atmosphere of various gases, finely divided solids, or finely dispersed liquid aerosols at rates that exceed the natural capacity of the environment to dissipate and dilute or absorb them. These substances may reach concentrations in the air that cause undesirable health, economic, or aesthetic effects.
Major air pollutants
Clean, dry air consists primarily of nitrogen and oxygen—78 percent and 21 percent respectively, by volume. The remaining 1 percent is a mixture of other gases, mostly argon (0.9 percent), along with trace (very small) amounts of carbon dioxide, methane, hydrogen, helium, and more. Water vapour is also a normal, though quite variable, component of the atmosphere, normally ranging from 0.01 to 4 percent by volume; under very humid conditions the moisture content of air may be as high as 5 percent.
The gaseous air pollutants of primary concern in urban settings include sulfur dioxide, nitrogen dioxide, and carbon monoxide; these are emitted directly into the air from fossil fuels such as fuel oil, gasoline, and natural gas that are burned in power plants, automobiles, and other combustion sources. Ozone (a key component of smog) is also a gaseous pollutant; it forms in the atmosphere via complex chemical reactions occurring between nitrogen dioxide and various volatile organic compounds (e.g., gasoline vapours).
Airborne suspensions of extremely small solid or liquid particles called “particulates” (e.g., soot, dust, smokes, fumes, mists), especially those less than 10 micrometres (μm; millionths of a metre) in size, are significant air pollutants because of their very harmful effects on human health. They are emitted by various industrial processes, coal- or oil-burning power plants, residential heating systems, and automobiles. Lead fumes (airborne particulates less than 0.5 μm in size) are particularly toxic.
The six major air pollutants listed above have been designated by the U.S. Environmental Protection Agency (EPA) as “criteria” pollutants—criteria meaning that the concentrations of these pollutants in the atmosphere are useful as indicators of overall air quality.
Except for lead, criteria pollutants are emitted in industrialized countries at very high rates, typically measured in millions of tons per year. All except ozone are discharged directly into the atmosphere from a wide variety of sources. They are regulated primarily by establishing ambient air quality standards, which are maximum acceptable concentrations of each criteria pollutant in the atmosphere, regardless of its origin.

Criteria pollutants

The six criteria pollutants are described in turn below.
Fine particulates
Very small fragments of solid materials or liquid droplets suspended in air are called particulates. Except for airborne lead, which is treated as a separate category (see below), they are characterized on the basis of size and phase (i.e., solid or liquid) rather than by chemical composition. For example, solid particulates between roughly 1 and 100 μm in diameter are called dust particles, whereas airborne solids less than 1 μm in diameter are called fumes.
The particulates of most concern with regard to their effects on human health are solids less than 10 μm in diameter, because they can be inhaled deep into the lungs and become trapped in the lower respiratory system. Certain particulates, such as asbestos fibres, are known carcinogens (cancer-causing agents), and many carbonaceous particulates—e.g., soot—are suspected of being carcinogenic. Major sources of particulate emissions include fossil-fuel power plants, manufacturing processes, fossil-fuel residential heating systems, and gasoline-powered vehicles.
Carbon monoxide
Carbon monoxide is an odourless, invisible gas formed as a result of incomplete combustion. It is the most abundant of the criteria pollutants. Gasoline-powered highway vehicles are the primary source, although residential heating systems and certain industrial processes also emit significant amounts of this gas. Power plants emit relatively little carbon monoxide because they are carefully designed and operated to maximize combustion efficiency. Exposure to carbon monoxide can be acutely harmful since it readily displaces oxygen in the bloodstream, leading to asphyxiation at high enough concentrations and exposure times.
Sulfur dioxide
A colourless gas with a sharp, choking odour, sulfur dioxide is formed during the combustion of coal or oil that contains sulfur as an impurity. Most sulfur dioxide emissions come from power-generating plants; very little comes from mobile sources. This pungent gas can cause eye and throat irritation and harm lung tissue when inhaled. It also reacts with oxygen and water vapour in the air, forming a mist of sulfuric acid that reaches the ground as a component of acid rain. Acid rain is believed to have harmed or destroyed fish and plant life in many thousands of lakes and streams in parts of Europe, the northeastern United States, southeastern Canada, and parts of China. It also causes corrosion of metals and deterioration of the exposed surfaces of buildings and public monuments.
Nitrogen dioxide
Of the several forms of nitrogen oxides, nitrogen dioxide—a pungent, irritating gas—is of most concern. It is known to cause pulmonary edema, an accumulation of excessive fluid in the lungs. Nitrogen dioxide also reacts in the atmosphere to form nitric acid, contributing to the problem of acid rain. In addition, nitrogen dioxide plays a role in the formation of photochemical smog, a reddish brown haze that often is seen in many urban areas and that is created by sunlight-promoted reactions in the lower atmosphere.
Nitrogen oxides are formed when combustion temperatures are high enough to cause molecular nitrogen in the air to react with oxygen. Stationary sources such as coal-burning power plants are major contributors of this pollutant, although gasoline engines and other mobile sources are also significant.
Ozone
A key component of photochemical smog, ozone is formed by a complex reaction between nitrogen dioxide and hydrocarbons in the presence of sunlight. It is considered to be a criteria pollutant in the troposphere—the lowermost layer of the atmosphere—but not in the upper atmosphere, where it occurs naturally and serves to block harmful ultraviolet rays from the Sun. Because nitrogen dioxide and hydrocarbons are emitted in significant quantities by motor vehicles, photochemical smog is common in cities such as Los Angeles, where sunshine is ample and highway traffic is heavy. Certain geographic features, such as mountains that impede air movement, and weather conditions, such as temperature inversions in the troposphere, contribute to the trapping of air pollutants and the formation of photochemical smog.
Lead
Inhaled lead particulates in the form of fumes and dusts are particularly harmful to children, in whom even slightly elevated levels of lead in the blood can cause learning disabilities, seizures, or even death. Sources of airborne lead particulates include oil refining, smelting, and other industrial activities. In the past, combustion of gasoline containing a lead-based antiknock additive called tetraethyl lead was a major source of lead particulates. In many countries there is now a complete ban on the use of lead in gasoline. In the United States, lead concentrations in outdoor air decreased more than 90 percent after the use of leaded gasoline was restricted in the mid-1970s and then completely banned in 1996.

Project API : Air Pollutant Index Info Overview

Welcome to first blog post. Our team are sharing some of the info with you regarding to the Air Pollutant Index in short form API.

There are two type of the air quality monitoring stations used in Malaysia
(i) Manual Sampling (High Volume Sampler , HSV)
(ii) Automated Sampling (Continuous Air Quality Monitoring Stations, CAQM)


Locations of all national air quality monitoring network in West Malaysia.
For Johor state,there are only 4 stations available and there are none available in Batu Pahat.

This is our primary motivations of our team to get out the air quality monitoring system as soon as possible.



Here is additional of locations of air quality monitoring located in East Malaysia

How to calculate API :
(1) Each of the pollutant (7 categories) is collected thru the collectors at set interval time.
(2) The amount of the pollutants collected are averaged out and counted as individual index (Idx)
(3) Maximum Idx are chosen as the API indicator for the region