ChandanShamala Library

Developing Communities                                                                          Be Good Do Good

Chandler 85248
chandan@chandanshamalalibrary.org

  • Home
  • About Us
  • Volunteering Opportunities
  • How You Can Help
  • AZ FLL Pictures
  • USA ChaptersClick to open the USA Chapters menu
    • BAY AREA - San Jose Chapter
    • Raspberry Pi classes
  • IndiaClick to open the India menu
    • Certificate of Registration
    • Memorandum of Association
    • India Home
    • Medical Camp
    • Blood Donors Group at Goalpara
  • STEM Videos from the Web
  • Mobile STEM/IOT/Robotics LaboratoryClick to open the Mobile STEM/IOT/Robotics Laboratory menu
    • DIY: Solar Energy System
  • Make your Own Phone
  • Makers - Lets Start!
  • Intel Edison ClassesClick to open the Intel Edison Classes menu
    • Intel Edison 101
    • Intel Edison 201
    • Intel Edison 301
  • Intel Edison ProjectsClick to open the Intel Edison Projects menu
    • Intel Edison Setup
    • BlinkWithoutDelay
    • Hello World with Grove LCD
    • Grove Light Sensor
    • Grove Moisture Sensor
    • Grove PIR Motion Sensor
    • Grove UV Sensor
    • Grove Servo Motor
    • GroveTemperature Sensor
    • Grove Sound Sensor
  • Arduino ino FilesClick to open the Arduino ino Files menu
    • light-sensor.ino
    • pirmotion-sensor.ino
    • moisture-sensor
    • hello-world.ino
    • uv-sensor.ino
    • servo-sweep.ino
    • temp-sensor.ino
    • sound-sensor.ino
  • STEM CoursesClick to open the STEM Courses menu
    • Simple Energy Source - Battery
    • SimpleMachines
    • STEAM 101
    • STEAM201
    • STEAM301
    • STEAM401
    • STEAM501
  • Sustainability Courses: Solar
  • Solar Light Circuit
  • Sensor 101
  • LEGO Classes
  • Drone Projects
  • 3D Printing Projects
  • Programming Resources
  • Contact Us
  • Contact BayArea Chapter
  • Bylaws
  • Thank You
  • Events Participated

moisture-sensor

/* moisture/water sensor with LCD display*/


#include <Wire.h>

#include "rgb_lcd.h"

rgb_lcd lcd;

const int colorR = 0;

const int colorG = 255;

const int colorB = 0;


const int D2_low = 2;

int SenStateH = 0;


void setup() {    // set up the LCD's number of columns and rows:

     lcd.begin(16, 2);       

   lcd.setRGB(colorR, colorG, colorB);        // Print a message to the LCD.   

   lcd.clear();    lcd.setCursor(0,0);    lcd.print("Greetings from ");

    lcd.setCursor(0,1);

    lcd.print("TIES Academy!");

    delay(10000);        pinMode(D2_low, INPUT);

    }


void loop() {

    SenStateH = digitalRead(D2_low);


    if(SenStateH == LOW){

      lcd.setRGB(255,0,0);

      lcd.clear();

      lcd.setCursor(0,0);

      lcd.print("Low Water Level!");

      lcd.setCursor(0,1);

      lcd.print("Please Refill!");

      delay(1000);

    }

    else if(SenStateH == HIGH){

      lcd.setRGB(0,255,0);

      lcd.clear();

      lcd.setCursor(0,0);

      lcd.print("Water Level!");

      lcd.setCursor(0,1);

      lcd.print("Perfect!");

      delay(1000);

   }

    else {

      lcd.noDisplay();

      delay(500);

      lcd.display();

      delay(500);

        // set the cursor to column 0, line 1

       // (note: line 1 is the second row, since counting begins with 0):

       // lcd.setCursor(0, 1);

      // print the number of seconds since reset:

      // lcd.print(millis()/1000);

    }
}
/*********************************************************************************************************  END FILE*********************************************************************************************************/



Copyright 2019 Chandan Shamala Library. All rights reserved.

Web Hosting by Yahoo!

Chandler 85248
chandan@chandanshamalalibrary.org