Difference between revisions of "Temperature & Humidity Sensor"
From Microduino Wiki
(Program Debugging and Application Edits) |
|||
Line 77: | Line 77: | ||
===Program Debugging === | ===Program Debugging === | ||
*The program uses AM2321 temperature and humidity collection library and defines "#include <Wire.h>" and "#include <AM2321.h>" as driving files. | *The program uses AM2321 temperature and humidity collection library and defines "#include <Wire.h>" and "#include <AM2321.h>" as driving files. | ||
+ | *The program uses two important libraries to communicate with the sensor. For any project/software that uses this sensor, the following libraries must be included: | ||
+ | **For the AM2321 sensor: "#include <AM2321.h>" | ||
+ | **For I2C Communication: "#include <Wire.h>" | ||
*“am2321.temperature/10.0”represents the calculated temperature value and " am2321.humidity/10.0" represents the calculated humidity value. | *“am2321.temperature/10.0”represents the calculated temperature value and " am2321.humidity/10.0" represents the calculated humidity value. | ||
==Application== | ==Application== | ||
− | + | The Microduino Temperature and Humidity sensor can be used in a range of applications including HVAC systems, dehumidifiers, home automation, data recording or in a weather station. | |
==Video== | ==Video== | ||
|} | |} |
Revision as of 17:41, 15 August 2016
ContentsOutlineThis mCookie sensor uses an AM2321 chip and the standard mCookie connector to give you the ability to quickly add high precision temperature measuring and humidity sensing to any Microduino project. The sensor has an on-board microprocessor delivering rapid response, high noise tolerance and excellent data quality. Specification
DevelopmentEquipment
Preparation
Experiment: Detect Temp&Hum Values
File->Examples->_07_Sensor_Temp_Hum_AM2321->'read_simple' #include <Wire.h>
#include <AM2321.h>
void setup() {
Serial.begin(9600);
}
void loop() {
readByAM2321();
delay(500);
}
void readByAM2321()
{
AM2321 am2321;
am2321.read();
Serial.print("(");
Serial.print(am2321.temperature/10.0);
Serial.print(", ");
Serial.print(am2321.humidity/10.0);
Serial.println(')');
}
Program Debugging
ApplicationThe Microduino Temperature and Humidity sensor can be used in a range of applications including HVAC systems, dehumidifiers, home automation, data recording or in a weather station. Video |