Input Devices

The assignment this week was to build or use an input device or sensor. There were many possible options for the project, but I decided to use a potentiometer as my first attempt. I found a potentiometer lying around the lab, and did a bunch of research on how these little devices work. I found a sample code here, and used it to modulate the speed at which the onboard LED blinked. This was a very simple project, and it was a good first entry into input devices.

Next, I decided I would like to use a temperature sensor. I first looked into milling a board with a thermistor on it, but soon realized that the board wouldnt be waterproof, and as i want to use the thermometer as a part of a weather station, this would not be of use. I next tried a submersible sensor, available here. This sensor has 3 leads, a positive, a ground, and the lead which sends the data. I did some reserach on how the sensor works, and learned that it uses the Onewire interface. I like the Arduino platform, and as I already have already fabricated an Arduino, I decided I would like to use that as the base for the thermometer.

I found lots of information on the sensor, and how to use it with an Arduino. Here is a data sheet for a sensor that is very similar to the one I used. I learned that to make the sensor work, I needed two libraries; one called DallasTemperature, and one called Onewire. These libraries, once copied into the libraries folder in the Arduino folder in my documents, allow the Arduino to control and talk to the sensor. More info on all this available  here.

To get the sensor to work, I had to add a 4.7k OHM pull up resistor between the power and the data leads. I soldered this in, and connected it to the Arduino, and connected the Arduino to the computer. I ran the sketch that is included in the Onewire library. Next I opened the serial moniter option in the Arduino IDE, and got a reading that updated every second or so! I tested the accuracy of the device by holding it in my hand, and it slowly inreased to about 95 degrees, which seems pretty accurate. Overall I am happy with my results, and can't wait to make an ouput device that helps visualize the readings from this sensor.

 

Published on   April 17th, 2013