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

temp-sensor.ino

/*

modified by chandan

Grove - Temprature Sensor demo v1.0*  This sensor detects the enviroment temprature,*  Connect the signal of this sensor to A0, use the *  Serial monitor to get the result.*  By: http://www.seeedstudio.com*/

#include <math.h>

#include "rgb_lcd.h"


rgb_lcd lcd;


const int colorR = 0;

const int colorG = 255;

const int colorB = 0;


int a;float temperature;int B=3975;                  //B value of the thermistorfloat resistance;


void setup(){

    Serial.begin(9600);        // 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("CSL!");

    delay(10000);

 }
void loop(){

    a=analogRead(2);

    resistance=(float)(1023-a)*10000/a; //get the resistance of the sensor; 

    temperature=1/(log(resistance/10000)/B+1/298.15)-273.15;

   //convert to temperature via datasheet ;

    delay(1000);

    Serial.print("Current temperature is "); 

   Serial.println(temperature);

        if(temperature > 25){

      lcd.setRGB(255,0,0);

      lcd.clear();      lcd.setCursor(0,0);

      lcd.print("temperature");

      lcd.setCursor(0,1);

      lcd.print("Please use fan!");

      delay(500);

    }    else if(temperature < 23){

      lcd.setRGB(0,255,0); 

    lcd.clear();

      lcd.setCursor(0,0); 

    lcd.print("Low Temperature: temperature!");

      lcd.setCursor(0,1);

      lcd.print("temperature");

      delay(1000);

   }

}



Copyright 2019 Chandan Shamala Library. All rights reserved.

Web Hosting by Yahoo!

Chandler 85248
chandan@chandanshamalalibrary.org