The generic humidity and temperature sensor module I bought did not come much with instructions on how to use it or anything. I went to the vendor site and all they had was a translated datasheet and the necessary library/sample code. It turns out you need to use this with a 5K pullup resistor. Luckily I had the mega-*bay assortment pack of resistors from which I was able to find something close to use.
Since this was the "cheapest" sensor board I really didn't go in expecting much. It was only spec'ed out to give readings in the 0-50 *C range within a couple of degrees accuracy and likewise with the humidity readings. When it ran I viewed a lot of errors and timeouts. It is a slow updating sensor so even changes to the interval of when the sensor is read did not clear up the number of errors. I then found that it was not returning the temperature in Fahrenheit even though the parameters were set for it to do so.
I did a manual conversion from Celsius in the code to compensate but was still thinking I got a wonky piece of kit. I then go back and look up an Adafruit part which I originally intended to get and browsed through the Adafruit tutorial which led to an optimized library code for the DHT11. I downloaded that, installed, and everything worked fine.
Okay, now I got humidity,temperature and heat index readings coming through on the serial monitor. How about I use that to make a visual thermometer?
I had some neopixel strip segments and neopixel rings to make a thermometer looking setup.
The neopixel strip and the neopixel ring were on their own data pins and needed to be coded as two instances of neopixels..
The visual effects animations for the neopixels were pulled in from the strandtest sample code. I figured out how to get the lights to blank out and go in reverse without the i-- looping since decrement looping did not seem to work.
I had the rainbow wipe run only upon initialization to show that the all the neopixels are in working order.
I used the arduino map function to scale the actual temperature reading into how many neopixels to light up.
I usually don't post up any code since it was still a mishmash work in progress but someone asked for it. The other color animations are in the code so you can play around with it. You can go on the Adafruit Learning System to find the links to their library code used in the sketch. Good luck. (note that you might have to check for wordwrap and wonky code block here)
- update - editor seems to mangle the code - will attach file