All pictures are for illustrative purposes only.
Happy Holidays! Our store will be closed December 25th, 26th and January 1st for Christmas and New Years.
Store address and hours
location_on 4131 Fraser St. Vancouver BC Get Directions
phone 604-875-1993 Call us
access_time Hours
Monday - Friday | 9AM - 5:30PM |
Saturday - Sunday & Holidays | Closed | See Holiday Hours |
Closed
• Opens Wed at 9AM
close
Menu
-
close
-
CATEGORIES
-
-
-
-
-
-
-
-
-
-
-
-
-
Featured Items
-
-
-
-
-
-
-
More mirco-controllers
-
More Developement Tools
-
-
More Prototyping
-
More Modules
-
-
Featured Items
-
More prototyping Tools
-
-
-
-
-
-
-
-
Featured Item
-
-
-
-
-
-
-
Featured Items
-
-
-
-
-
-
-
-
Featured Items
-
-
-
-
-
-
-
-
-
-
-
-
-
Featured Items
-
-
-
-
-
-
-
-
-
Featured Items
-
-
-
-
-
-
Popular Cleaners
-
-
-
Featured Items
-
-
-
-
-
-
-
Featured Items
-
-
-
-
-
Featured Items
-
-
-
-
Featured Products
-
-
-
-
-
more motor
-
-
more power supplies
-
-
Featured Items
-
-
-
more electrical devices
-
-
-
-
-
-
-
Featured Items
-
-
-
-
-
-
BRANDS
-
- PROJECTS
-
COMMUNITY
-
-
-
FEATURED POSTS
-
-
-
- SALE
- GST/HST Break
DIGITAL HUMIDITY AND TEMPERATURE SENSOR DHT22
Description
Features:
- 3.3-6V Input
- 1-1.5mA measuring current
- 40-50 uA standby current
- Humidity from 0-100% RH
- -40 - 80 degrees C temperature range
- +-2% RH accuracy
- +-0.5 degrees C
- #include"DHT.h"
- #define DHTPIN 2// what pin we're connected to
- #define DHTTYPE DHT22 // DHT 22 (AM2302)
- #define fan 4
- int maxHum =60;
- int maxTemp =40;
- DHT dht(DHTPIN, DHTTYPE);
- void setup(){
- pinMode(fan, OUTPUT);
- Serial.begin(9600);
- dht.begin();
- }
- void loop(){
- // Wait a few seconds between measurements.
- delay(2000);
- // Reading temperature or humidity takes about 250 milliseconds!
- // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
- float h = dht.readHumidity();
- // Read temperature as Celsius
- float t = dht.readTemperature();
- // Check if any reads failed and exit early (to try again).
- if(isnan(h)|| isnan(t)){
- Serial.println("Failed to read from DHT sensor!");
- return;
- }
- if(h > maxHum || t > maxTemp){
- digitalWrite(fan, HIGH);
- }else{
- digitalWrite(fan, LOW);
- }
- Serial.print("Humidity: ");
- Serial.print(h);
- Serial.print(" %t");
- Serial.print("Temperature: ");
- Serial.print(t);
- Serial.println(" *C ");
- }