Thursday, September 13, 2012

Testing a 38KHz IR Sensor

Thanks to the tutorial on the AdaFruit Learning System, testing a new 38KHz IR sensor was a 5 minute exercise.  The parts used for this test were:
  • 1 x TSOP38238 38KHz IR Sensor [AdaFruit-157]
  • 1 x T 1 3/4 Blue LED [Mouser 604-WP7113QBC/G]
  • 1 x 220ohm 1/4 watt resistor [Mouser 291-220-RC]
and were connected as follows:


In order to test the sensor, an LED was connected between Vcc and the Vout pin (via a current limiting resistor).  If the IR sensor detects a 38KHz modulated pulse wave (PWM), it pulls the Vout pin low, thereby completing the circuit and lighting the LED.
 

After powering the circuit, the closest TV remote control was used to test the sensor.


Sunday, September 2, 2012

Using the RHT03 temperature and humidity sensor

Continuing along with temperature observation weekend, today an RHT03 temperature and humidity sensor was interfaced to an Arduino.  As far as I can tell, the RHT03 sensor also goes by the name DHT22.  A number of articles are already online on this device; The best review I found was on Hacker Reviews, with the best set of documentation located here at AdaFruit.

Using the code library provided from AdaFruit, the sensor was hooked up and running within 30 minutes.  Instead of using the serial monitor, I piped the output to my LCD panel, and all appeared well on the first run.

First impressions are good - the temperature reading is very stable compared to the TMP36 (but as 5x the cost, I'd expect that), and the humidity sensor agrees with another reader I have on hand.  The footprint of the device is quite large compared to the TMP36, and the code baseline is a little larger to get comms going, but if you need something a bit more accurate, it appears this component is the answer.  See below for pictures of the implementation...


Saturday, September 1, 2012

Using Analog Devices TMP36 Temperature Sensor

In order to get some interesting data to display on the LCD panel, a TMP36 temperature sensor was purchased.  A tutorial on AdaFruit was followed for this exercise, and I found it to be quite thorough and well written.

Before connecting the TMP36 to the Arduino, an initial test was performed on the sensor.  It was connected to +5V and GND, and using a multimeter, the Vout pin was read and gave a result in the expected range for my lab which is in desperate need of a little more air conditioning.  Placing a finger on the TMP36, the reading was seen to go up, and putting a soda can against the sensor was also observed to make the reading go down.


The next step was connecting the TMP36 to analog pin 0 on the Arduino.  A quick sketch later, and the LCD panel was reading the rooms ambient temperature.  Unfortunately, the readings (even taken every few seconds) were fairly erratic (values of +/- 8 degrees were observed).  After a bit more reading and investigation, this would seem to be due to noise on the +5V line.


In efforts to get a better reading, the TMP36 was moved from +5V power to +3.3V power, and the AREF pin on the Arduino was used to adjust the analog pin readings.  That calmed the reading jitter down a little (but it was still a bit too unstable for my tastes), and as an unfortunate side-effect, the values started reporting the room temperature to be a bit too high.  Going back to the multimeter, I discovered that my +3.3V line was actually closer to +3.2V.  Adjusting the math in the sketch to account for this voltage difference put the room temperature within expected limits.


Going back to the TMP36 datasheet, the vendor recommended putting a .1uF ceramic capacitor with short leads onto the positive pin of the sensor.  Unfortunately, I did not have one of those laying around, but did have a 100uF 100V capacitor that I plugged in to the circuit (a bit of overkill, but when its all that was available...).  That immediately calmed the readings down to fluctuate between the expected +/- 1 degree.


That is about as far as I plan to take this circuit for the moment.  I have a DHT22 temperature and humidity sensor I'll try out first, before deciding whether its worth my time to go back and write some temperature averaging code to clean up the LCD display.