c code for soil moisture sensor interfacing with microcontroller
#1

Hi am Mohani would like to get details on c code for soil moisture sensor interfacing with microcontroller ..My friend Justin said c code for soil moisture sensor interfacing with microcontroller will be available here and now i am living at ..sangli....... and i last studied in the college/school ......wce,sangli... and now am doing ..engineering..i need help on ..project....etc
Reply
#2
The project is intended to provide proper amount of irrigation to agricultural fields by observing the moisture content of soil. The project automates the process of manually irrigating the fields by switching the pump ON/OFF. It is implemented by using an 8051 series microcontroller, programmed such as to collect input signals that measures moisture content of soil through sensing arrangement. Sensing arrangement is made by inserting two stiff metallic rods into the field at some distance. An op-amp is used as a comparator that interfaces microcontroller and the sensing arrangement. On receiving the signal, the microcontroller produces an output that drives a relay and operates the water pump. Also LCD is used which is interfaced with microcontroller for displaying the moisture content of soil and water pump status. Hence the system reduces human intervention and provides required irrigation to field.



MikroC Source Code :


sbit LCD_RS at LATB7_bit;
sbit LCD_EN at LATB6_bit;
sbit LCD_D4 at LATB5_bit;
sbit LCD_D5 at LATB4_bit;
sbit LCD_D6 at LATB3_bit;
sbit LCD_D7 at LATB2_bit;
sbit LCD_RS_Direction at TRISB7_bit;
sbit LCD_EN_Direction at TRISB6_bit;
sbit LCD_D4_Direction at TRISB5_bit;
sbit LCD_D5_Direction at TRISB4_bit;
sbit LCD_D6_Direction at TRISB3_bit;
sbit LCD_D7_Direction at TRISB2_bit;
// End LCD module connections
double source=0;
int view=0;
char txt[6];
void main() {
ADCON1=0x0D; // Configure RE1 pin as input
CMCON=7;
TRISC.F4=0;
ADC_Init(); // Initialize ADC
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
// char code for degree
// Display "C" for Celsius
while(1){
source=Adc_Read(1);
source=100*source;
source=source/744;
inttostr(source,txt);
if(source>96){
source=100;
}
if(source>83){
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,3, "Water!!");
Lcd_Out(2,1, "Hum:");
Lcd_Out(2,5,txt);
Lcd_Chr(2,11,0x25);
Lcd_Chr(2,12,' ');
Lcd_Chr(2,13,' ');
Lcd_Chr(2,14,' ');
Lcd_Chr(2,15,' ');
Lcd_Chr(2,16,' ');
delay_ms(1000);
}
else if(source>40&&source<=83){
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,3, "Humid Soil");
Lcd_Out(2,1, "Hum:");
Lcd_Out(2,5,txt);
Lcd_Chr(2,11,0x25);
Lcd_Chr(2,12,' ');
Lcd_Chr(2,13,' ');
Lcd_Chr(2,14,' ');
Lcd_Chr(2,15,' ');
Lcd_Chr(2,16,' ');
PORTC.f4=0; //motor off
delay_ms(1000);
} else{
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,3, "Dry Soil");
Lcd_Out(2,1, "Hum:");
Lcd_Out(2,5,txt);
Lcd_Chr(2,11,0x25);
Lcd_Chr(2,12,' ');
Lcd_Chr(2,13,' ');
Lcd_Chr(2,14,' ');
Lcd_Chr(2,15,' ');
Lcd_Chr(2,16,' ');
PORTC.f4=1; // motor on
delay_ms(1000);
PORTC.f4=1;
}
}
}
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: iterfacing of soil moisture sensor with 8051 microcontroller, interfacing soil moisture sensor with lpc2148, moisture sensor using 8051 microcontroller block diagram, interfacing figaro sensor to microcontroller, source code to soil moisture with arm lpc2148, soil moisture sensor using 8051 microcontroller, simple soil moisture sensor using 8051 microcontroller,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  Lm35 Temperature Sensor using Microprocessor 8086 0 783 23-06-2021, 02:59 PM
Last Post:
  download ajay deshmukh microcontroller 8051 pdf 0 706 13-10-2018, 02:02 AM
Last Post: Guest
  project on door lock system using 8085 microcontroller 0 754 04-10-2018, 10:39 PM
Last Post: Guest
  bascom hc sr04 sensor code 0 558 23-08-2018, 08:29 AM
Last Post: Guest
  project report on digital soil moisture tester using ic lm3915 0 771 13-08-2018, 10:43 AM
Last Post: Guest
  disadvantages of reinforced soil 0 649 22-05-2018, 02:04 PM
Last Post: Guest
  project on door lock system using 8085 microcontroller 0 649 14-05-2018, 11:03 PM
Last Post: Guest
  seminar report of tactile sensor 0 618 05-05-2018, 11:37 PM
Last Post: Guest
  use of plastic as a soil stabilizer report pdf 0 561 03-05-2018, 03:47 PM
Last Post: Guest
  future scope of four quadrant dc motor speed control with microcontroller 0 753 20-04-2018, 05:52 PM
Last Post: Guest

Forum Jump: