REQUEST: Anyone have a sketch for temp/humidity logging?

  • Hi,

    I'm planning to see how accurate the temperature sensors I use in my MySensors setup truly are. At work, we have calibrated temperature/humidity loggers that I plan to test a DHT22, DS18B20, and LM35 sensors against. I want to use a RTC and SD card module, simply so that the info I can get from where I work, matches the data I plan to collect.

    I've been looking around for a sketch, since I figure this has to have been done before. Just wondering if anyone knows of a link to one that they know works?


  • Mod

    I might be missing the point, but wouldn't it be easier to extract the log from your controller? It has the current time and I think most controllers support csv export.

  • Hi @mfalkvidd

    I think you may have. What I am trying to do is test the accuracy of the temperature modules (dht, lm35, etc) against calibrated temperature equipment.

    Ex. At when we have climate controlled areas, and the temperature and humidity devices reading the climate are calibrated bi-yearly, to assure they are accurate. What I want to do is, make a temp/humidity data logger with the cheaper components available to see if when they read a temp of say, 24deg and 50% relative humidity, it's actually those numbers.

  • Mod

    I guess you'd have to bring a controller to work then, which might be a hassle unless you have an extra Raspberry Pi laying around.

  • I am logging temperatures from sensors in Vera scene once a minute with luup code that gets the sensor variables and makes http request to ThingSpeak website for generating graphs.
    What controller are you using? If you use Vera I might be able to help. is also another similar graphing service, but the free tier got new limitations for allowed data frequency.

  • I guess i'm not being clear in how i'm describing it.

    It's not the data logging to a controller i'm interested in. I want to compare these cheap e-bay/Ali temperature sensors, against some of the $200+ ones that we use in the factory I work at. I can get a copy of their data, and it's all time stamped. What I want to do is make a small data logger with an Uno (or similar); A RTC (Real Time Clock), SD Card module, and a variation of either a DHT22, LM35, DS18B20, etc, and compare that data to the one I get from my work. I'm curious to see if these modules are precise and if not, can they be made to be more precise.

  • Hero Member

    Maybe you should also include the Si7021 temp humidity sensor in your adventure? It seems quite accurate.

    Maybe this article can be helpful for you?

    Or This

    There is lots of info out there 😉

  • Mod

    Is exactly how the data ends up on the SD card really important?
    Since a controller usually has a rtc and is able to stora data on a sd card, does it matter if the sensor sends the data via radio to the controller?

    What I'm suggesting is to use existing, easy to use solutions instead of developing something on your own.

    On the other hand, if you want to learn how to write to a sd card directly from an Arduinio, a data logger sounds like a good project.

  • Thanks @korttoma that was the kind of info I was looking for. And i'll add the Si7021 to the list, thanks.

    @mfalkvidd if I was trying to implement this where I work right now, and integrate it into their existing systems I would agree 100% with you. But right now, this is just to gather data to compare against. If I can somehow prove to them that a MySensors network for temp/humidity logging would be accurate, then I can propose it. That being said, it would have to be a good argument since the temps monitor millions of dollars worth of inventory/potential sales, so it all has to be VERY accurate. That's why I was looking for an already done, offline temp/humid data logger. I was hoping someone out there might have dabbled in them before, and have a known working sketch.

    I've searched online a few times, gotten the required libraries and sketch, only to have it compile but still not work right (even after wiring check, part replacement, etc). Sometimes its just good to go from a good known reference.

  • Admin

    IMHO, DHT sensors isn't exactly famous for being accurate.