Vous êtes sur la page 1sur 6

`

Hardware Interface Sensor for Arduino to send pH value of Soil via


GSM

EXECUTIVE SUMMARY
TITLE: Hardware Interface Sensor for Arduino to send pH value of Soil via
GSM
RESEARCHERS:
TEAM LEADER:

Christopher Sarili

MEMBERS:

Jared Joel Salazar


Nikko Paul Distor
Patrick Evan Espiritu

INSTITUTIION: Bataan Peninsula State University- Main Campus


College of Engineering and Architecture

SECTOR:

Department of Electronics Engineering

CATEGORY:

Agricultural Development

INTRODUCTION
Rationale
Farming is one of the major industries here in Bataan. Most of its land
area were rice fields which is very common to rural areas. The fertility of
the soil determines the productivity of farming industry. One of the factors
affecting fertility is the pH of the soil.
pH
In chemistry, pH is the measure of acidity or basicity (alkalinity) of
solution, in our case the composition of different material in soil. It is very
important to measure the pH of soil before planting. One of the reasons is
that tiny microbes that decompose materials such as food waste, dead
animals and plants cannot live on high acidity or high alkalinity. Another is
that nutrient cannot be absorb by the plants if the pH was not right. Usually,
a balance pH reading was from 5.8 to 7.5.
pH Sensor
pH is the unit of measure for the acidity of a solution in a process. pH
sensors are electronic device used to measure the acidity and alkalinity of
soil and water. Its components are usually combined into one device called
a combination pH electrode. The measuring electrode is usually glass and
quite fragile. Recent developments have replaced the glass with more
durable solid-state sensors. The probe is an essential part of a pH meter; it
is a rod like structure usually made up of glass. At the bottom of the probe
there is a bulb, the bulb is a sensitive part of a probe that contains the
sensor.
Arduino
Arduino is an open-source electronics prototyping platform based on
flexible, easy-to-use hardware and software. Its intended for artists,
designers, hobbyists and anyone interested in creating interactive objects
or environments.

Since it was open-source, different versions of it were available on


market. Here in Philippines, local electronic shop E-gizmo created its own
arduino called Gizduino. Its also flexible and easy to use at a very cheap
price.

PROJECT DESCRIPTION
The project utilizes the computing power of the arduino to interpret
the pH value from the pH sensor electrode. The pH value and its status
are sent once via SMS to the receiver phone number. The data can also be
projected using the serial monitor of the arduino program compiler. This
project demonstrates how to use arduino as analog to digital converter that
might help future improvements to the project.

HOW IT WORKS
The whole process starts with the sensor. The pH sensors output
voltage varies relative to the pH of the test soil. The lower the pH value the
higher the output voltage. The output of the sensor according to the
instruction manual stabilizes after ten (10) minutes. At that point the output
voltage becomes constant.
Given the output voltage, it becomes an input to the Arduino analog
input A0. Then, the Arduino process the analog input ranging from 0 to 255.
Using interpolation we found out the relation of values in pH to the input
voltage. Now we have the pH value we can classify the status of the soil
whether it was an acidic soil, a base soil or a balance soil.
Now that we have both pH value and status its up to the GSM
Module to send SMS to the receivers mobile phone.

SOURCE CODE
//GSM PH Source Code was an open source sketch
//Created and developed by
//TEAM LEADER: Christopher Sarili
// MEMBERS: Jared Joel Salazar
//
Nikko Paul Distor
//
Patrick Evan Cruz
//with the help of Elmer Camingal
//
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2 ,3);

const int analogInPin = A0;


const int analogOutPin = 9;
int sensorValue = 0;
int outputValue = 0;
long time = 0;
int sent = 0;
float equivalue = 0;
float x = 9.48;
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);
// map it to the range of the analog out:
outputValue = map(sensorValue, 0, 1023, 0, 255);
// change the analog out value:
equivalue = x - (0.14)*outputValue;

analogWrite(analogOutPin, outputValue);

//print the results to the serial monitor:


Serial.print("sensor value = " );

`
Serial.print(sensorValue);

Serial.print("\t pH = ");
Serial.print(equivalue);
Serial.print("\t time = ");
Serial.print(time);
if (equivalue >= 1 && equivalue <= 4.4)
Serial.println("\t stat = Acidic Soil");
else if (equivalue >= 4.5 && equivalue <= 7.5)
Serial.println("\t stat = Balance Soil");
else
Serial.println("\t stat = Base Soil");
if (time == 600000)
{
if(sent == 0)
{
sendsms();
sent = 1;
}
time = 0;
}
time = time + 200;
// wait 2 milliseconds before the next loop
// for the analog-to-digital converter to settle
// after the last reading:
delay(200);
}
void sendsms()
{
Serial.print("\r");
delay(1000);
Serial.print("AT+CMGF=1\r");
delay(1000);
Serial.print("AT+CMGS=\"09172553961\"\r"); //Number to which you want to send the sms
delay(1000);
Serial.print("pH = ");
Serial.print(equivalue);
if (equivalue >= 1 && equivalue <= 4.4)
Serial.println(" status = Acidic Soil");

`
else if (equivalue >= 4.5 && equivalue <= 7.5)
Serial.println(" status = Balance Soil");
else
Serial.println(" status = Base Soil");
delay(1000);
Serial.write(0x1A);
}

CIRCUIT DIAGRAM
9V DC

9V DC

pH sensor

ARDUINO
Board

GSM
MODULE

LIST OF MATERIALS
1

pH sensor

Arduino Uno Board

GSM Shield

Male Connecting Wire

9V Battery

9V Battery connector

Sim Card

Receiving Phone

Range: 2.9 to 8 (tolerance 5%)

Has enough load.

Vous aimerez peut-être aussi