{"id":729,"date":"2015-06-14T02:01:31","date_gmt":"2015-06-13T17:01:31","guid":{"rendered":"https:\/\/hack.gpl.jp\/?p=729"},"modified":"2015-06-14T02:01:31","modified_gmt":"2015-06-13T17:01:31","slug":"post-729","status":"publish","type":"post","link":"https:\/\/hack.gpl.jp\/2015\/06\/14\/post-729.html","title":{"rendered":"AM2302\u6e29\u5ea6\u6e7f\u5ea6\u30bb\u30f3\u30b5\u30fc\u3092Arduino Nano\u3067\u30c6\u30b9\u30c8"},"content":{"rendered":"

\u6e29\u5ea6\u3068\u6e7f\u5ea6\u306e\u30bb\u30f3\u30b5\u30fc\u304c\u5408\u4f53\u3057\u305f\u306e\u3067\u3001\u5358\u7dda\u3067\u4f7f\u3048\u308b\u3082\u306e\u3092\u63a2\u3057\u3066\u3044\u305f\u3089\u3001DHT\u30b7\u30ea\u30fc\u30ba\u3068\u3044\u3046\u306e\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u3053\u308c\u3092\u30c6\u30b9\u30c8\u3002<\/p>\n

\u30e1\u30fc\u30ab\u30fc\u306f\u3001Aosong Guangzhou Electronics Co., Ltd.\u3067\u3001\u4e2d\u56fd\u306e\u5e83\u5dde\u306b\u3042\u308b\u30bb\u30f3\u30b5\u30fc\u5c02\u9580\u30e1\u30fc\u30ab\u30fc\u306e\u3088\u3046\u3067\u3059\u30021\u500b2.99 \u30c9\u30eb\u3067\u3001Nano\u3088\u308a\u3082\u9ad8\u3044\u3067\u3059\u3002\u305d\u3053\u305d\u3053\u3001\u7cbe\u5ea6\u306f\u53d6\u308c\u308b\u306e\u3067\u3057\u3087\u3046\u304b\u306d\u3002<\/p>\n

 <\/p>\n

\"DHT22_AM2302_fzz\" <\/p>\n

\u624b\u6301\u3061\u306b10K\u03a9\u304c\u898b\u5f53\u305f\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u30015.6K \u3092\uff12\u3064\u4ed8\u3051\u3066\u3044\u307e\u3059\u3002\u30bb\u30f3\u30b5\u30fc\u304b\u3089\u306f\uff14Pin \u51fa\u3066\u3044\u307e\u3059\u304c\u3001\u4f7f\u3046\u306e\u306f3\u672c\u3067\u3059\u3002<\/p>\n

\"AM2302\" <\/p>\n

 <\/p>\n

\n

https:\/\/www.sparkfun.com\/datasheets\/Sensors\/Temperature\/DHT22.pdf<\/a><\/p>\n

3. Technical Specification:
Model DHT22
Power supply 3.3-6V DC
Output signal digital signal via single-bus
Sensing element Polymer capacitor
Operating range humidity 0-100%RH; temperature -40~80Celsius
Accuracy humidity +-2%RH(Max +-5%RH); temperature <+-0.5Celsius
Resolution or sensitivity humidity 0.1%RH; temperature 0.1Celsius
Repeatability humidity +-1%RH; temperature +-0.2Celsius
Humidity hysteresis +-0.3%RH
Long-term Stability +-0.5%RH\/year
Sensing period Average: 2s
Interchangeability fully interchangeable
Dimensions small size 1418<\/em>5.5mm; big size 2228<\/em>5mm<\/p>\n<\/blockquote>\n

 <\/p>\n<\/p>\n

\"datasheets_Sensors_Temperature_DHT22_pdf\" <\/p>\n

\u30b3\u30fc\u30c8\u306f\u3001\u30b5\u30f3\u30d7\u30eb\u306e\u3067\u3059\u3002\u83ef\u6c0f\u3067\u30b7\u30ea\u30a2\u30eb\u30d7\u30ea\u30f3\u30c8\u3057\u3066\u3044\u308b\u90e8\u5206\u306f\u3044\u3089\u306a\u3044\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n

\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u3001\u4ee5\u4e0b\u3092\u4f7f\u3044\u307e\u3057\u305f\u3002<\/p>\n

— Arduino library for DHT11DHT22 —
https:\/\/github.com\/adafruit\/DHT-sensor-library<\/a><\/p>\n

 <\/p>\n

\/*\nAM2302 DHT22 humidity\/temperature sensors\nRead test.<\/p>\n

--- AM2302 Aosong Guangzhou Electronics Co., Ltd. ---\n3 to 5V power and I\/O\n2.5mA max current use during conversion (while requesting data)\nGood for 0-100% humidity readings with 2-5% accuracy\nGood for -40 to 125\u00b0C temperature readings \u00b10.5\u00b0C accuracy\nNo more than 0.5 Hz sampling rate (once every 2 seconds)\nBody size 15.1mm x 25mm x 7.7mm\n4 pins with 0.1" spacing<\/p>\n

--- Arduino library for DHT11DHT22 ---\nhttps:\/\/github.com\/adafruit\/DHT-sensor-library<\/a><\/p>\n

JunkHack 2015.06.14\n*\/<\/p>\n

include "DHT.h"<\/h1>\n

define DHTPIN 2 \/\/ what pin we're connected to<\/h1>\n

\/\/ Uncomment whatever type you're using!\n\/\/#define DHTTYPE DHT11 \/\/ DHT 11 <\/p>\n

define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)<\/h1>\n

\/\/#define DHTTYPE DHT21 \/\/ DHT 21 (AM2301)<\/p>\n

\/\/ Initialize DHT sensor for normal 16mhz Arduino\nDHT dht(DHTPIN, DHTTYPE);<\/p>\n

void setup() {\nSerial.begin(9600);\nSerial.println("DHT22 AM2302 test!");<\/p>\n

dht.begin();\n}<\/p>\n

void loop() {\n\/\/ Wait a few seconds between measurements.\ndelay(2000);<\/p>\n

\/\/ Reading temperature or humidity takes about 250 milliseconds!\n\/\/ Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)\nfloat h = dht.readHumidity();\n\/\/ Read temperature as Celsius\nfloat t = dht.readTemperature();\n\/\/ Read temperature as Fahrenheit\nfloat f = dht.readTemperature(true);<\/p>\n

\/\/ Check if any reads failed and exit early (to try again).\nif (isnan(h) || isnan(t) || isnan(f)) {\nSerial.println("Failed to read from DHT sensor!");\nreturn;\n}<\/p>\n

\/\/ Compute heat index\n\/\/ Must send in temp in Fahrenheit!\nfloat hi = dht.computeHeatIndex(f, h);<\/p>\n

Serial.print("Humidity: ");\nSerial.print(h);\nSerial.print(" %\\t");\nSerial.print("Temperature: ");\nSerial.print(t);\nSerial.println(" *C ");\n}<\/pre>\n<\/p>\n

\u6885\u96e8\u6642\u306a\u306e\u3067\u3001\u6e7f\u5ea6\u304c\u9ad8\u3044\u304b\u3057\u3089\u306d\u3002\u6e29\u5ea6\u306f\u3001\u5e38\u590f\u306e\u6c17\u6e29\u3067\u3059\u304c\u3002\u6691\u3059\u304e\u306a\u3044\uff1f<\/p>\n

\u307e\u3041\u3001\u3053\u3093\u306a\u611f\u3058\u3067\u6e7f\u5ea6\u3068\u3001\u6e29\u5ea6\u304c\u3068\u3089\u308c\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6e29\u5ea6\u3068\u6e7f\u5ea6\u306e\u30bb\u30f3\u30b5\u30fc\u304c\u5408\u4f53\u3057\u305f\u306e\u3067\u3001\u5358\u7dda\u3067\u4f7f\u3048\u308b\u3082\u306e\u3092\u63a2\u3057\u3066\u3044\u305f\u3089\u3001DHT\u30b7\u30ea\u30fc\u30ba\u3068\u3044\u3046\u306e\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u3053\u308c\u3092\u30c6\u30b9\u30c8\u3002 \u30e1\u30fc\u30ab\u30fc\u306f\u3001Aosong Guangzhou Electronics Co., Ltd.\u3067\u3001\u4e2d\u56fd\u306e\u5e83 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","footnotes":""},"categories":[6,9,63],"tags":[],"acf":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false},"uagb_author_info":{"display_name":"JunkHack","author_link":"https:\/\/hack.gpl.jp\/author\/junkhack\/"},"uagb_comment_info":1,"uagb_excerpt":"\u6e29\u5ea6\u3068\u6e7f\u5ea6\u306e\u30bb\u30f3\u30b5\u30fc\u304c\u5408\u4f53\u3057\u305f\u306e\u3067\u3001\u5358\u7dda\u3067\u4f7f\u3048\u308b\u3082\u306e\u3092\u63a2\u3057\u3066\u3044\u305f\u3089\u3001DHT\u30b7\u30ea\u30fc\u30ba\u3068\u3044\u3046\u306e\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u3053\u308c\u3092…","_links":{"self":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts\/729"}],"collection":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/comments?post=729"}],"version-history":[{"count":0,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts\/729\/revisions"}],"wp:attachment":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/media?parent=729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/categories?post=729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/tags?post=729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}