Just a quick note on those DHT11/DHT22 sensors. Ignoring the fact that their humidity sensor is absolutely craptastic and permanently breaks if humidity goes too high(*), the one wire sensor protocol needs very tight timing, see Basics of Interfacing DHT11/DHT22 Humidity and Temperature Sensor with MCU.

The problem with running these (or other protocols that have implicit timing requirements like WS28xx LED strings) is that you simply can't guarantee that from a user land process (or even "at all") on a system like Linux or Windows. Especially, if you have a high process load. Your process simply might not get scheduled at the right times. In all likelyhood, the sensor will work most of the times, but you'll sometimes get random data and/or errors. For me, a cheap microcontroller and Device::SerialPort usually solve the trick for these kind of problems.


(*) DHT11 - temp ok, but RH values wildly off. I generally now recommend using a Bosch BME280 breakout board instead. At least from the limited tests i've done on my projects, this sensor seems to be a lot more reliable long term.

PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP

In reply to Re^4: XS Modules - why and when? by cavac
in thread XS Modules - why and when? by Bod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.