Difference between revisions of "LilyPad Temperature Sensor"
From Geeetech Wiki
Line 22: | Line 22: | ||
A0 -------- S | A0 -------- S | ||
+ | |||
+ | 2.Upload the code | ||
+ | |||
+ | float temp; | ||
+ | |||
+ | void setup() { | ||
+ | |||
+ | Serial.begin(57600); | ||
+ | |||
+ | }; | ||
+ | |||
+ | |||
+ | void loop () { | ||
+ | |||
+ | temp = analogRead(0)*5/1024.0; | ||
+ | |||
+ | temp = temp - 0.5; | ||
+ | |||
+ | temp = temp / 0.01; | ||
+ | |||
+ | Serial.println(temp); | ||
+ | |||
+ | delay(500); | ||
+ | |||
+ | }; | ||
+ | |||
+ | 3.Open the monitor |
Revision as of 08:58, 30 August 2013
Overview
Detecting temperature changes has never been easier. The MCP9700 is a small thermistor type temperature sensor. This sensor will output 0.5V at 0 degrees C,
0.75V at 25 C, and 10mV per degree C. Doing an analog to digital conversion on the signal line will allow you to establish the local ambient temperature.
Detect physical touch based on body heat and ambient conditions with this small sensor.
USE
1.Connect Uno and LilyPad Temperature Sensor like as:
Uno ------ LilyPad Temperature Sensor
5V -------- +
GND ------- -
A0 -------- S
2.Upload the code
float temp;
void setup() {
Serial.begin(57600);
};
void loop () {
temp = analogRead(0)*5/1024.0;
temp = temp - 0.5;
temp = temp / 0.01;
Serial.println(temp);
delay(500);
};
3.Open the monitor