Finally! Correct temperature

So, I have been investigating why the ADC lines were not reading the temperature sensor correctly.  As they always say “Read the freaking manual.”  I was looking at the datasheet and noticed that they put voltage dividers on the RN-XV sensor input lines.  I am sure they needed to do this to make it compatible with some XBEE stuff to make it drop in replaceable… blah, blah, blah.

I am not using this board to replace an XBEE, so it is time to make a modification. Pictured below is the board with two resistors circled.

These two resisters do a voltage divide by approximately 10/57 on pin 19, which is sensor 3 or GPIO 2.  There are many resources out there to explain how voltage dividers work.  Do a quick Google search and you should be able to figure out the rest.  The problem is that I don’t want the input divided down.  Knowing I had to do a modification, I chose pin 19 since there was one less resister to remove.  So now the LM35′s output voltage is routed to pin 19 of the WiFly.  All you have to do is remove the #1 resistor and replace the #2 resistor with a zero Ohm resistor or a wire to bridge the gap between the pads.  Writing this down is much easier than it actually was to accomplish.  I don’t have the right tools or skills to work with surface mount parts but I was able to make it work even if it was not pretty.

WARNING: You now have a direct connection to the ADC and you must not input more than 1.2 Volts into the sensor pins.  The LM35 will output 0 to 1.5 Volts depending on the temperature but since it is my garage, I doubt it will ever go above 0.43 Volts.  0.43 Volts is 43°C or 110° F.  So I am pretty safe.

I did a few quick tests with the multi-meter to make sure the output of the temperature sensor matches the voltage going into input to sensor 3 of the WiFly by probing on the pads where the #2 resister was.  Then I verified that the voltage out of the temperature sensor was the same as the voltage read by the WiFly module.

For example, the voltage out of the temperature sensor was 0.26 volts ( 26° C).

telnet 192.168.1.2 2000
Trying 192.168.1.2...
Connected to 192.168.1.2.
Escape character is '^]'.
*HELLO*$$$
CMD
show q 3
show q 3
8401b0,

The return value always starts with an 8, so ignore that. Convert 0x401b0 into decimal and you get 262576, which is the sampled voltage in microvolts.  Dividing by 1000 gives you 262.576 millivolts, which is what was measured on the multi-meter!  Now I can sleep peacefully because I understand why it was not working correctly.

I think I will make a weather station next with another WiFly module.  I will have to make similar modifications to it but now that I am experienced, I may be able to do it a little better.  The weather station will have temperature, humidity, and air pressure.  Maybe some other bells and whistles.   Check back as I start working on this more aggressive project.

This entry was posted in Uncategorized. Bookmark the permalink.

8 Responses to Finally! Correct temperature

  1. JP says:

    Instead of doing the hardware modifications can’t you just do the math on the webserver side and multiply the readings by 10/57?

    • bjorn says:

      I could have but I did not for two reasons. First, I wanted to know why it was not working the way I expected. Second, the resister’s inaccuracies at different temperatures will throw off the true reading of the temperature. It was good experience for me to try and make the mods. Just anal I guess.

      • Phuoc says:

        Chris,Thanks for the comment and link from your page. I rveomed the resisters for a couple of reasons. One is that they are not necessary for my needs and I hate clutter. The second is that the divide is only approximate. The resister values are advertised but the actual value may be a few % off, so I did not want to have to deal with that. The last reason is because the voltage divider reduces the input signal to 20% of what is intended to be. If you know anything about analog to digital converters then you will know they have a minimum step size or quantization. Reducing the signal size creates more quantization error and leads to less accurate readings. While my application does not depend on very accurate readings, it is the principle of it all.Keep up the good work. Bjorn

  2. Jose F says:

    Hello. I thank you for this post. If I want to use pin # 17 do I need to remove the resistors also to have a accurate reading like the way you did it with ping #19? Also
    which resistor do I need to remove? Thank you in advance.

  3. Pingback: WiFly Sensor Pins

  4. Chris says:

    Nice work! It seems there’s a load of people all over the net trying to get these little babies to work. It promises to be a great little radio, but then there’s all these weird obstacles thrown up. It seems Roving Networks would do with updating the literature for the WiFly family…

    I’ve not removed the resistors from mine, but I’ve done the conversion on the reported pin value to get reasonably accurate results.

    Thanks again,

    Chris

    • bjorn says:

      Chris,
      Thanks for the comment and link from your page. I removed the resisters for a couple of reasons. One is that they are not necessary for my needs and I hate clutter. The second is that the divide is only approximate. The resister values are advertised but the actual value may be a few % off, so I did not want to have to deal with that. The last reason is because the voltage divider reduces the input signal to 20% of what is intended to be. If you know anything about analog to digital converters then you will know they have a minimum step size or quantization. Reducing the signal size creates more quantization error and leads to less accurate readings. While my application does not depend on very accurate readings, it is the principle of it all.

      Keep up the good work.
      –Bjorn

Leave a Reply

Your email address will not be published. Required fields are marked *

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>