| Dr. Durant > Courses > GE110 > Lab 5 |
So far, we have used two types of sensors on the LEGO RCX. The first of these was a touch sensor that sensed two values: on and off. The other was a light sensor, which detected light levels on a scale of 0 (pitch black) to 100 (direct, bright light).
Although the Robolab language allows you to choose a variety of sensor types, they all use the same basic electrical principle. For many sensors (including light and temperature sensors), materials are used that vary in an electrical property known as "resistance" as the stimulus level varies. A high resistance means that very little electrical current will flow through a device for a given difference in charge across its leads. Electrical current is made up of electrons moving in a particular direction and measured in units of Amperes. Charge difference, known as potential and measured in units of Volts, can be thought of as electrical "pressure".
These 3 quantities, potential in Volts (V), current in Amperes (A), and resistance in Ohms (Ω), are related by Ohm's Law:
| V | = | IR |
| voltage | = | current * resistance |
Typically, bright light or high temperature decreases the resistance of the specially selected sensor materials, while a lower light level or cooler temperature has the opposite effect. The LEGO RCX (and most signal conditioning circuits for devices of this kind) applies a particular electrical potential (5 Volts) to the sensor and measures how much current flows to determine the resistance value. (Actually, there is a little more to it than that. To prevent too much current from flowing, which could burn the sensors out, a resistance of 10 kΩ is placed in series along the path that the current flows through the sensor. The potential, or electrical pressure, then changes in two steps — one across the sensor and one across the 10 kΩ resistor. The RCX measures the potential (Voltage) across the sensor to determine the temperature, light level.)
For this part of the lab, you will be "fooling" the RCX into thinking that a temperature sensor is attached even though you will be attaching resistors (electrical components having fixed resistance values). These resistors would not make good temperature sensors since their resistance hardly changes at all with temperature.
Use the Investigator mode to write a program that reads temperature sensor data. (It is important to select temperature mode; light mode powers the sensor, which we do not want to do.) You could write a program that logs a data point when the touch sensor is pressed, but it is recommended that you just record the values off of the RCX display (after using the View button to select the correct sensor). You will need to touch the two wire leads of the resistor to two adjacent metal contacts on the sensor port that you have used in your RCX program. (Note that your body has some resistance, but it is much, much higher than that of the resistors being used, so your resistance will have negligible effects on the outcomes.)
From the tech. support center, check out and measure 10 resistors of each of the following types. The color stripes on each resistor indicate its nominal (ideal) value, but the actual resistance may vary by several percent.
| 3.3 kΩ | Orange Orange Red |
| 10 kΩ | Brown Black Orange |
| 47 kΩ | Yellow Violet Orange |
The RCX thinks that a temperature sensor is attached, so it will give you a temperature in degrees C. To convert this to Ohms, use the following formulas in your Excel spreadsheet.
| InternalReading | = | 785 - 8 * temperatureC |
| Vs | = | InternalReading / 204.6 |
| Rs | = | 10 kΩ * (Vs/(5 V - Vs)) |
Characterize and briefly discuss both the accuracy and precision of each set of 10 resistors.
Check out a thermistor (temperature sensitive resistor that can be used as a sensor) from tech. support and connect it to your RCX running the program from Part I.
Submit your spreadsheet. It must clearly show all experimental data and calculations. Be sure to include the names of all your group members at the top of the first worksheet.
This lab was developed by Dr. Eric Durant. Much of the RCX technical data was provided by MindStorms guru Mike Gasperi.
This page was last updated on Friday, 14-Oct-2005 15:34:37 CDT.