Adapt example TMP36 for DHT11 ?

87 views
Skip to first unread message

Raducki Frédéric

unread,
May 28, 2016, 4:35:41 PM5/28/16
to Ardunity Forum



Hello.
I don't own a tmp36 temperature sensor but i wanted to experiment the example with my DHT11 (temp + humidity) sensor.
(Your file i use is DisplayTemperature(TMP36))
Some data arrives properly in unity but the values are just crazy (200 .. 50... degrees ..)


Could you please guide me in WHERE i should act in order to calibrate the outputs to give me proper temperature.
Is it more in unity or in the sketch ? or in both ?

the only thing i see related with the VALUE is 
ArdunityApp.resolution(256, 1024);
in the sketch. 
i tried to uncomment this or put (0,1024) but it does not helps.
 
PS: here is the datasheet of the module http://www.micro4you.com/files/sensor/DHT11.pdf
+ library http://playground.arduino.cc/Main/DHT11Lib

Also could you please tell me how i'm supposed to obtain temperature AND humidity ?
Is there a way for me to see the exact data received like its explained here in the DataSheet : 
Data consists of decimal and integral parts. A complete data transmission is 40bit, and the sensor sends higher data bit first. Data format: 8bit integral RH data + 8bit decimal RH data + 8bit integral T data + 8bit decimal T data + 8bit check sum. If the data transmission is right, the check-sum should be the last 8bit of "8bit integral RH data + 8bit decimal RH data + 8bit integral T data + 8bit decimal T data".

If i could see these Bits in unity then i could make the proper calculations by myselft to obtain Celcius or Fahrenheit etc... 

Thank you

Ardunity

unread,
May 28, 2016, 10:31:24 PM5/28/16
to Ardunity Forum
DHT11 is not controlled by Analog Input.
It is needed DTHLib for Arduino.
I will think about considering to support DHT11 in ARDUnity.
You can develop it, but I think that it is very hard because, document are not good.

"ArdunityApp.resolution(256, 1024)" means to set resolution for Analog Output/Input.
It is set by inspector UI of ArdunityApp in Unity. (property of PWM and ADC resolution)
So, I recommend that you should not modify it.

TMP36 is temperature sensor generally to use.
You can find many example of TMP36 in Arduino.

Raducki Frédéric

unread,
May 29, 2016, 6:14:23 AM5/29/16
to Ardunity Forum
Ok i understand. i have the module working properly in one of my projects directely on the arduino using it's own library DTHLib

So now my other question :
what if i use the proper library of the sensor INSIDE the .ino sketch, along with everything needed by your plugin ARDunity...
Could i SEND-OVER the temperature and humidity to unity via Serial.Write or Serial.Print for example ?

i understand that your block for wire editor <commSerial> makes use of serial communication but i hope that it does not
empeach users to send-over other things.
For example if i could make a hello world from arduino side and then have it appear on unity i would be glad.
than all the rest becomes possible ;-)

Reply all
Reply to author
Forward
0 new messages