I’ve been playing with Arduino boards in my limited spare time over the past few months.  It’s a fun way to spend quality hands-on geek time that is clearly distinct (at least to me) from my day job.  Plus, I’m able to start actually instantiating some of the ubiquitious computing / distributed sensor ideas that have been floating around in my head.

I’ve been working on a simple wireless light, temp, and motion sensor.  Light was a trivial CDS photocell connected to the analog port of the arduino.  My first attempt at temp is using the Dallas Semiconductor DS-18B20 digital one-wire sensor, which is pretty slick for $4.25.

There was some good sample code on the main arduino site, but I spent a small bit of time to flesh it out more completely, adding the ability to configure sensor resolution and extracting the temp value from the returned data.  Code is here, if this is interesting or useful to you.

  10 Responses to “temperature sensing from arduino”

  1. Yeah, this is going to be endlessly useful to me. I have many ideas of what you’re talking about. =)

  2. Hi, trying to get this working myself with either Max/MSP or Processing. Think I’m missing something basic. Could use some help. Could you e-mail me if possible? I promise not to take up too much of your time. Thanks.

  3. Was very glad to see that you had implemented a translation of the two’s complement temperature into something human readable. It looks, though like the interpretation of the resolution is backwards? With bits 5 and 6 set the device should is full resolution, so the resolution floor should be lowest (rather than highest). I could be reading something wrong, though.

  4. Hi Casey -

    You’re completely right — thanks for the close eye! I had the logic around resolution_floor carelessly backward, and obviously wasn’t really paying attention to the less significant parts of the readings while testing.

    This seems to take care of it (already applied to the file linked above):

    ds.reset();
    ds.select(addr);
    @@ -172,15 +172,15 @@
    */
    if ((data[CONFIG_REG] & (1 0) {
    if ((data[CONFIG_REG] & (1 0) { // bits 6 and 5 are set
    - resolution_floor = 3;
    + resolution_floor = 0;
    } else { // bit 6 is set, 5 is clear
    - resolution_floor = 2;
    + resolution_floor = 1;
    }
    } else {
    if ((data[CONFIG_REG] & (1 0) { // bits 6 is clear, 5 is set
    - resolution_floor = 1;
    + resolution_floor = 2;
    } else { // bit 6 and 5 are clear
    - resolution_floor = 0;
    + resolution_floor = 3;
    }
    }

    thanks again,
    Josh

  5. Hello mates, how is the whole thing, and what you desire to say
    about this post, in my view its truly awesome in favor of me.

  6. s most eco-destination and the alternative safari destination, Rwanda now
    boasts the mountain gorilla, authentic African culture,
    comfortable weather and excellent year-round wildlife viewing, unparalleled scenery and great food.
    Enfield, for instance, has seen a rise in the number of burglaries from 857 in 2011 to
    936 this year. Mosquito netting is important simply because it prevents an
    insect bite that carries infectious diseases.

    Also visit my web page; มุ้ง

  7. In fact, the Internet has an important impact on us.

    They are responsible for making sure the newspaper is
    marketable in appearance. By accomplishing the task of designing
    and building high- tech website you can easily gain much traffic to your website
    because a clever design will stay in everyone’s mind and help them to start associating with
    your product or services that results higher ROI instantly.

  8. Hello! This is kind of off topic but I need some help from an established blog.
    Is it difficult to set up your own blog? I’m not very techincal but I can figure things out pretty quick.

    I’m thinking about creating my own but I’m not sure where to start.
    Do you have any ideas or suggestions? Thanks

  9. Hmm is anyone else experiencing problems with the pictures
    on this blog loading? I’m trying to determine if
    its a problem on my end or if it’s the blog.
    Any feedback would be greatly appreciated.

  10. Hiya! Quick question that’s totally off topic. Do you know how to make your site mobile friendly?
    My weblog looks weird when viewing from my iphone 4.
    I’m trying to find a template or plugin that
    might be able to fix this issue. If you have any recommendations,
    please share. Thank you!

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam Protection by WP-SpamFree

   
© 2011 Joshua Heling Suffusion theme by Sayontan Sinha