White wizard Temperature and Humidity sensor module. See this page : http://wizard.nestegg.jp/thsensor.html

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
halfpitch
Date:
Tue Aug 02 17:57:16 2011 +0000
Commit message:
Rev.A

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 13b6d85b6dbd main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Aug 02 17:57:16 2011 +0000
@@ -0,0 +1,35 @@
+//HIH-5031
+//0% = 0.6V
+//80% = 2.0V
+//H% = (80-0)/(2-0.6)*(Vout-0.6V)
+
+//MCP9700
+//0C = 0.5V
+//100C = 1.5V
+//T = 100*(Vout-0.5V)
+
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+AnalogIn ad19(p19);
+AnalogIn ad20(p20);
+
+int main() {
+    float   ADdata19,ADdata20,temp,humid;
+    
+    while(1) {
+        ADdata19 = ad19.read()*3.3;
+        ADdata20 = (ad20.read()*3.3);
+        
+        //temp = ((ADdata20*1000.0)-500.0)/10.0;//temp
+        temp = 100*(ADdata20-0.5);//temp
+        //humid = 43.24*(ADdata19-0.4);
+        humid = (80.0/1.4)*(ADdata19-0.6);
+        
+        printf("p19 = %f V, p20 = %f V , H = %f , T = %f C \n", ADdata19,  ADdata20, humid, temp);
+        myled = 1;
+        wait(0.2);
+        myled = 0;
+        wait(0.2);
+    }
+}
diff -r 000000000000 -r 13b6d85b6dbd mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Aug 02 17:57:16 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912