Stopshinal, in my experience the DHT22 can be quite finicky. However, you first say it is 5-6 degrees high and then you ask why your reading is a bit low! Not sure what you mean but you can try putting a pull-up to see if that makes a difference. Normally when a DHT22 is not working you won’t get any reading so in your case, it could also be ambient affect from the heat of the Spark.
Whoa whoa whoa… timeout… where’d you get the Black Spark Core from?
Oh my mistake- it is reading too high! And it’s pretty far from core, but regardless I’m sure it’s reading high. Pull up didn’t change a thing.
Black cores are the latest shipped from these guys! Pretty sweet.
Didn't get that memo!
I'd say your DHT is probably not going to be that accurate... but then again I don't have a lot of experience with them... just a hunch.
The core does heat up just a bit and that can heat up the whole breadboard slightly.
I just measured my cores with an infrared non-contact thermometer and they read 98.4 degrees F and 95.0 degrees F. The DS18B20 temperature sensor reads about 2-4 degrees F hotter than the overall surrounding area due to this. So right now the table reads 75.2 F on the infrared thermometer and temperature sensor is reporting 78.3 F.
I can get better readings if I move the temperature sensor off of the breadboard.
They are very sensitive–it you are reading it in real time, try breathing on it or putting your finger on it and see what happens.
I've used a handful in the past, and they've all been relatively accurate. Everything I've seen says 0.1°C accuracy. I've also heard of people just getting bad ones that are off.
You may be able to place a small fan near it and see if it cools it off to room temperature and gets rid of some of the ambient heat from the Core.
That’s the digital one right? Well I guess then it should be better than 5-6 degrees off… I would have guessed 1 degree max then, but 0.1C? wow.
Besides localized heating affecting the temperature, I can’t think of anything else except a poor sensor.
BDub, this is really great! I tried to piece this together from other libraries and failed! I am using your code as is, have set to DHT11 and am getting both temp and humidity as 0.00. Status result sometimes comes back as 1 and other times as 0. Any idea what may be wrong?
{
“cmd”: “VarReturn”,
“name”: “status”,
“result”: 0,
“coreInfo”: {
“last_app”: “”,
“last_heard”: “2014-05-21T05:25:35.163Z”,
“connected”: true,
“deviceID”: “53ff6e065067544859341287”
}
}
Can you post your code or the relevant snippets you are using to get the data?
Using web call:
https://api.spark.io/v1/devices//status?access_token=
https://api.spark.io/v1/devices//temperature?access_token=
To confirm, I have the middle lead connected to D2 and power lead connected to 3V3.
I meant your actual firmware code that you flashed to your Core. I’m assuming you deleted your device ID out of the links you posted. Just want to double-check! I’ve forgotten device IDs and access tokens many times!
Oh, I see! Yes, the device ID/access token are correct (I get a response from the core). The firmware code is literally cut-and-paste from BDub’s posted code (above), only change is to set DHT11. I made some assumptions on pins to wire to, and since the values are coming out zeros maybe that’s it? I’ve wired the data lead (middle) to D2.
If the only thing you changed was #define DHTTYPE DHT11
then you should hook that data pin to D2, GND to GND and power to 3V3. There should also be a 4.7k pull up to 3V3 on the D2 pin. See this previous image in the thread…Paul had used D4 as the input, but D2 should work fine.
Wow… That’s just pretty.
some help here…
i just copy the code from @wgbartley ( application.ino / DHT22.cpp / DHT22.h ) paste it and i received a bunch of errors. Is there something i missed ???
btw is my first time programming for the spark, i just have experience with arduino.
Thanks
this is what i got:
In file included from …/inc/spark_wiring.h:30:0,
from …/inc/application.h:31,
from /DHT22.h:1,
from /DHT22.cpp:1:
…/…/core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning “Defaulting to Release Build” [-Wcpp]
In file included from …/inc/spark_wiring.h:30:0,
from …/inc/application.h:31,
from /DHT22.h:1,
from /application.cpp:1:
…/…/core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning “Defaulting to Release Build” [-Wcpp]
/application.cpp:2:27: fatal error: elapsedMillis.h: No such file or directory
compilation terminated.
make: *** [/application.o] Error 1
Check your dht22.h tab to see if it includes ’ #include “application.h” '
I’m not sure if that’s where the problem lies, but it doesn’t hurt to check I guess…
@Intike, you are missing the .h file for the elapsedMillis() library.
@Moors7 check!
@peekay123 that is what i guess i was missing but didn’t know where to find it.
But still getting errors
In file included from …/inc/spark_wiring.h:30:0,
from …/inc/application.h:31,
from /DHT22.h:1,
from /DHT22.cpp:1:
…/…/core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning “Defaulting to Release Build” [-Wcpp]
In file included from …/inc/spark_wiring.h:30:0,
from …/inc/application.h:31,
from /application.cpp:2:
…/…/core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning “Defaulting to Release Build” [-Wcpp]
/application.cpp: In function ‘void loop()’:
/application.cpp:29:5: error: ‘dhtElapsed’ was not declared in this scope
make: *** [/application.o] Error 1