Skip to main content

moisture sensor with arduino

MOISTURE SENSOR: -Soil moisture sensors measure the volumetric water content in soil. By using some other property of the soil, such as electrical resistance, dielectric constant and conductivity we are usable to make such a arduino project which can be really help full in many areas. like Rain sensor , Auto gardening and etc. 



Component to be needed: - Arduino moisture sensor can be made with some easy stuff which could be available easily.
1. Arduino board: - AN arduino board is a pre-fabricate training board which is now being manufactured by many companies and it is really very cheap. you can get all detail about the arduino board from the link below https://www.arduino.cc/ . and you can bye an arduino board from 

https://www.amazon.in/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=arduuino+board&rh=i%3Aaps%2Ck%3Aarduuino+board


2.Moisture sensor: - A soil moisture sensor is a basically a two conducting wire which is used to measure the conductivity between two point in ground or garden.
Soil moisture sensors measure the volumetric water content indirectly by using some other property of the soil, such as electrical resistance, 

so you can use two normal wire with Op-Amp or bye a soil moisture sensor from https://www.amazon.in/s/ref=nb_sb_ss_c_0_15?url=search-alias%3Daps&field-keywords=soil+moisture+sensor&sprefix=soil+%2Cmoisture+%2Caps%2C253 .
3. Battery: - You can use a 12V DC battery which can be obtain from online or off line from any electronics store.
4.Led: -  you will need cople of leds i you project to indicate or  to know the out put. and some 1K register with it.




Fig: - Component details.





Code for ARDUINO: -Add 1K resistors to the LEDs and correct the code so that the red LED will light.
The probe only needs to be on while a reading is taken, so poll the probe for one second every half hour by driving it from a digital pin. In my example code I used D7. This greatly improves power consumption and extends the life of the probe by several orders of magnitude since damage by electrolysis will be insignificant. If you want to check after watering, just press reset for a new reading.


A0 - Soil Mosture Sensor
D2:D6 - LEDS 1,2,3,4,5
LED1 - Green
LED2 - Green
LED3 - Green
LED4 - YELLOW
LED5 - RED
Connect the Soil Mosture Sensor to anolog input pin A0,
and your 5 led to digital out 2-6
*/
int led1 = 2;
int led2 = 3;
int led3 = 4;
int led4 = 5;
int led5 = 6;
int probe = 7;
int mostureSensor = 0;
void setup() {
// Serial Begin so we can see the data from the mosture sensor in our serial input window.
Serial.begin(9600);
// setting the led pins to outputs
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
pinMode(probe, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// Power-up the probe and pause for the driver
digitalWrite(probe, HIGH);
delay(1000);
// read the input on analog pin 0:
int sensorValue = analogRead(mostureSensor);
// print out the value you read:
Serial.println(sensorValue);
if (sensorValue >= 820)
{
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
}
else if (sensorValue >= 615 && sensorValue < 820)
{
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, LOW);
}
else if (sensorValue >= 410 && sensorValue < 615)
{
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
}
else if (sensorValue >= 250 && sensorValue < 410)
{
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
}
else if (sensorValue >= 0 && sensorValue < 250)
{
digitalWrite(led1, HIGH);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
}
// Power-down the probe
digitalWrite(probe, LOW);
delay(1800000); // wait half an hour
}

And keep remember that moisture sensor which you have bought will give value high when conductivity is zero(soil without moisture) between two polls and it will give value low when conductivity is high(soil with moisture). Because the output of sensor is inverted.


Comments

Popular posts from this blog

Smart Home Door lock system project.

RFID MFRC522  Door lock system Project summary: RFID system radio frequency identification in which Information is written in the card or tag is get read by RFID module when they get in contact. In this project we are making a home lock system which would open only when an authorized card will be available and access will be denied on wrong card. Component require: - In this project we are interfacing Arduino board with RFID MFRC522 and servo motor. RFID system would send data to Arduino board and according to that data action would be taken by Arduino board. Components are listed below:         ·          Arduino board.         ·          Arduino software.         ·          RFID MFRC522 board.         ·        ...

RFID-MFRC522 with Arduino Board.

1.     RFID MFRC522:        A normal RFID kit is just like our ATM card which can send a specific data to controller when it gets in touch with its reader module.       MFRC522 is name of controller which is being used in this RFID kit.   Figure 1 : RFID MRFC522      1.1 Specifications of RFID MFRC22 Module Name:MF522-ED Working current : 13 - 26mA / DC 3.3V Standby current : 10 - 13mA / DC 3.3V Sleep current : <80uA Peak current : <30mA Working frequency : 13.56MHz Card reading distance : 0 ~ 60mm ( Mifare1 card ) Protocol : SPI. Data communication speed : 10Mbit/s Max. Card types supported: Mifare1  S50, Mifare1 S70, Mifare UltraLight, Mifare Pro, Mifare  Desfire Dimension : 40mm × 60mm Working temperature : -20—80 degree Storage temperature : -40—85 degree Humidity : relevant humidity 5%—95% This RFID kit works on the...

Arduino board interfacing with X-bee module.

      Project: Arduino interfacing with X-Bee S-2 module.   1.     X-Bee module: X-Bee module is wireless communication device which range may be up to 500 meter or above it and it have two version Pro and normal. This module may be used for high speed and much secure communication for data and information transmitting. 1.1 Specifications: 3.3V @ 40mA 250kbps Max data rate 2 mW to 6 mW output (+3 dBm) 100 to 500 meter range(for normal X-bee not Pro.) Built-in antenna Fully FCC certified 6 10-bit ADC input pins 8 digital IO pins 128-bit encryption Local or over-air configuration AT or API command set Data sheet of X-bee is Here:   Download X-Bee data sheet NOTE: - Before using X-Bee first we need to configure some features in X-Bee like baud rate, Pan               ID, destination address channel etc. To understand the configurations please go to links below. 2.  ...