A code for i2C 16*2 LCD, 3LEDs, LM35 sensor

Hi guys, I'm new to the group and this is my first post. A brief introduction about me, I've a medical background and intend to integrate arduino technology into my project. So guys I'll be very grateful to have a circuit sketch and a code for the following project; A red light turning on when temperature is below 35.5 degrees celsius, a white light turning on when temperature between 36.6 and 37.5 degrees celsius, a blue light turning on when temperature is greater than 37.5 degrees celsius. All temperature displayed also on the 16*2 LCD. I'll be very thankful guys for your input or any links.

Hi guys, I'm new to the group and this is my first post. A brief introduction about me, I've a medical background and intend to integrate arduino technology into my project. So guys I'll be very grateful to have a circuit sketch and a code for the following project; A red light turning on when temperature is below 35.5 degrees celsius, a white light turning on when temperature between 36.6 and 37.5 degrees celsius, a blue light turning on when temperature is greater than 37.5 degrees celsius. All temperature displayed also on the 16*2 LCD. I'll be very thankful guys for your input or any links.

My input? Please do not cross-post. A code for i2C 16*2 LCD, 3LEDs, LM35 sensor

So guys I'll be very grateful to have a circuit sketch and a code for the following project;

You'll need to do some research and learn the basics, have a go at it, then post if you have a problem. No one is going to draw your schematic and write the code for you.

I'll be very grateful to have a circuit sketch and a code for the following project;

The way it works is: you come here with your circuit and code.

We try to help you when you run into problems.

.

You can google for link like this and expand from there

/*
Adafruit Arduino - Lesson 12. Light and Temperature
*/

#include <LiquidCrystal.h>

int tempPin = 0;
int lightPin = 1;

//                BS  E  D4 D5  D6 D7
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

void setup() 
{
  lcd.begin(16, 2);
}

void loop()
{
  // Display Temperature in C
  int tempReading = analogRead(tempPin);
  float tempVolts = tempReading * 5.0 / 1024.0;
  float tempC = (tempVolts - 0.5) * 100.0;
  float tempF = tempC * 9.0 / 5.0 + 32.0;
  //         ----------------
  lcd.print("Temp         F  ");
  lcd.setCursor(6, 0);
  lcd.print(tempF);
  
  // Display Light on second row
  int lightReading = analogRead(lightPin);
  lcd.setCursor(0, 1);
  //         ----------------
  lcd.print("Light           ");  
  lcd.setCursor(6, 1);
  lcd.print(lightReading);
  delay(500);
}

For I2C LCD https://arduino-info.wikispaces.com/LCD-Blue-I2C

Yes. You definately have to expand from there. OP wants to read with 0.1C accuracy. This:

int tempReading = analogRead(tempPin); float tempVolts = tempReading * 5.0 / 1024.0; float tempC = (tempVolts - 0.5) * 100.0; float tempF = tempC * 9.0 / 5.0 + 32.0;

is an example of bad code for an LM35 temp sensor. One degree C accurate if you're lucky. Leo..

With this sketch, approximately a tenth of a degree resolution is possible. Of course, such small numbers are going to be somewhat inaccurate because aRef will not be exactly 1.1V. Also, the LM35 is only guaranteed to be within 0.5 degrees of the actual temperature. However, it does yield higher resolution, if only for appearances' sake.

To change aRef to 1.1V, you use the command "analogReference(INTERNAL);"

Here's an example sketch using 1.1 as aRef:

float tempC;
int reading;
int tempPin = 0;

void setup()
{
analogReference(INTERNAL);
Serial.begin(9600);
}

void loop()
{
reading = analogRead(tempPin);
tempC = reading / 9.31;
Serial.println(tempC);
delay(1000);
}

Most of the usual sensor like the sht15/10 or the LM series or the Dallas DS18s20 have an accuracy of 0.5°C.

conrad07: So guys I'll be very grateful to have a circuit sketch and a code for the following project;

I don't think people accept only gratitude as payment when starting with zilch, but if you came looking for turnkey:

http://forum.arduino.cc/index.php?board=26.0

Threads merged.