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
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.