9
Chapter 2 Resistive Sensors and the DataLogger 23

Resistive Sensors and the DataLogger

  • Upload
    lyquynh

  • View
    232

  • Download
    7

Embed Size (px)

Citation preview

Page 1: Resistive Sensors and the DataLogger

Chapter 2

Resistive Sensors and the DataLogger

23

Page 2: Resistive Sensors and the DataLogger

CHAPTER 2. RESISTIVE SENSORS AND THE DATALOGGER

2.1 Section Overview

This lab focuses on how to build resistor circuits and analyze them Ohm’s Law and the voltage divider equation.Resistive sensor circuits that will be used throughout this term will be introduced as well. Using the DataLogger,recording information, and storing the data on a computer is also included.

2.2 Procedure

In this section, the following items will be covered.

1. Protoboard use

2. Resistive sensor circuits

3. Sampling the signals

4. Retrieving the stored data

2.3 Protoboard Instructions

Protoboards, a.k.a. breadboards are tools used for temporarily construction of circuits. Rather than solderingcomponents together they are inserted into the nodes of the protoboard. This saves time and money creatingprototype circuits. Figure 2.1 shows an example of how a protoboard is internally connected.

Figure 2.1: The holes on a breadboard are connected internally with metal strips

If protoboarding is confusing, watch the video on the ENGR201 lab webpage. The video iscalled Protoboarding Tutorial.

2.4 Resistive Sensor Circuits

This section will focus on resistors connected in series which can be used for manipulating an output voltage. Thesetypes of circuits are known as voltage dividers. Ohms law and a DataLogger can be used to analyze them. Noticethat one of the resistors in each circuit does not have a value attached to it, these are known as resistive sensors.The sensors that will be used in this lab include thermistors and photocells. Later in the term, the functionality ofthese same circuits will be improved by using more circuitry. Build one of the circuits shown in Figure 2.2.

24 ENGR 201 Manual c�2010 Oregon State University

Page 3: Resistive Sensors and the DataLogger

2.4. RESISTIVE SENSOR CIRCUITS

Figure 2.2: Build one of these circuits on a protoboard

Thermistor: A resistor that changes its value based on its temperature. There are manydifferent types - the one in the lab kit has a ‘negative thermal coefficient’ (NTC), meaningthe resistance goes lower as it gets hotter. Thermistors change their value slowly, takingseveral seconds to change per degree of temperature difference.

Photocell (photoresistor): A resistor that varies with the intensity of light striking it. The morethe light, the lower the resistance. Photocells are sensitive to the visible light spectrum, notinfrared light. Photocells respond relatively quickly to changes in light, taking less than 0.1seconds to change.

Implement a series resistor circuit by following these steps:

1. Begin by building one of the circuits in Figure 2.2 on the protoboard. Choose whichever looks more interesting.Look at Figures 2.3 and 2.4 to see what a photocell and a thermistor look like.

Figure 2.3: This variable resistor reacts to light intensity Figure 2.4: This variable resistor reacts to temperature

Figure 2.2 shows the photocell following the fixed resistor in series and the thermistor pre-ceding the fixed resistor. This order is not important; their positions may be switched withoutconsequence. Keep in mind that this will reverse the way that the output changes as the lightor temperature changes (i.e. heating the thermistor will decrease Vo rather than increase it).

2. Neither the photocell nor the thermistor has polarity, so they can be connected in either direction in the circuit.

Be careful to not short out a resistor by putting both ends into the same protoboard node.

c�2010 Oregon State University ENGR 201 Manual 25

Page 4: Resistive Sensors and the DataLogger

CHAPTER 2. RESISTIVE SENSORS AND THE DATALOGGER

3. When adding power to the circuit, pay attention to which end of the circuit is connected to each lead from thepower supply: connect positive to positive, and negative to negative (ground). Adjust the power supply to 3.3volts.

4. Next, verify that the sensor circuit works. In order to do so, watch how the LED changes when the sensorchanges.

5. Turn the power supply off, disconnect it from the circuit, and remove the LED from the circuit. The schematic forthe circuit is shown in Figure 2.5.

Figure 2.5: After removing the LED the circuit schematics should look like this.

After disconnecting the power supply, there is no voltage source in the circuit. For now,just leave the two resistors in series with no power. During data capture, the DataLogger isconnected and supplies 3.3 volts. The power supply from this point forward is not required,but may be especially useful when debugging.

6. Before using the DataLogger to analyze the circuit, calculate the output voltage ranges. Draw the circuit toanalyze it. Apply Ohms law (to determine the current in the circuit) and the voltage divider equation (to find theoutput Vo). Use the space provided on the next page. Since the sensors are variable resistors, the current andvoltage readings will constantly change as the environment changes.

7. Find the maximum and minimum resistance of the sensor by either measuring the photocell under a dark andbright condition or measuring the thermistor at room temperature and when heated. By measuring theresistance at the expected extremes of the experiment, an approximate output voltage range can be calculated.

26 ENGR 201 Manual c�2010 Oregon State University

Page 5: Resistive Sensors and the DataLogger

2.4. RESISTIVE SENSOR CIRCUITS

(a) Draw the circuit schematic in the space provided below:

(b) Write down the calculations based on minimum resistance (Rmin) in the space provided below:

i. Vo at the provided Rmin is

ii. I at the provided Rmin is

(c) Write down the calculations based on minimum resistance (Rmax) in the space provided below:

i. Vo at the provided Rmax is

ii. I at the provided Rmax is

c�2010 Oregon State University ENGR 201 Manual 27

Page 6: Resistive Sensors and the DataLogger

CHAPTER 2. RESISTIVE SENSORS AND THE DATALOGGER

2.5 Setting up the DataLogger

The configuration of the DataLogger is controlled through the DataLogger 3.0 program installed on the labcomputers. In the final part of the setup, the series resistor circuit is connected to the DataLogger.

2.5.1 Assembly of DataLogger

The DataLogger will require soldering of a couple components. This section will guide you through the process.

Using figure 2.6 try to assemble to DataLogger. If you do not know how to solder ask a TA to explain how to do it.The correct assembly of this board will make the rest of the term flow smoother.

Figure 2.6: Image of location of all parts to be soldered

1. First assemble the blue connectors as shown in figure 2.7 like a lego piece, then Solder to board.

2. Place Integrated chip socket in figure 2.8 into place and double check the groove on the socket matches thegroove on the board. Then solder into place.

3. Place board in place on top of battery holder so the battery clip leads go through the correct holes on theDataLogger board.

4. Insert spacers between the battery holder and board and place screw in hole and tighten.

5. Solder battery clip holder lead to DataLogger board.

28 ENGR 201 Manual c�2010 Oregon State University

Page 7: Resistive Sensors and the DataLogger

2.5. SETTING UP THE DATALOGGER

Figure 2.7: Blue connector needs to be assembled like alego piece so there is a total of 4 connectors together

Figure 2.8: IC Chip and Socket, Take not of where thenotch is

The final board is shown on the DataLogger webpage given below.

2.5.2 Using the DataLogger program

There are several commands available to control the settings inside the DataLogger. This section explains the setupprocess to get the DataLogger ready to record data samples.

The DataLogger software can be found by clicking Start → All Program → Tekbots Software → DataLogger 3.0.

In order to learn how to use the DataLogger use the guide found at this website:http : //eecs.oregonstate.edu/education/products/data lgr.3/

In order to take measurements on the go you can place four AA batteries in the batteryholder.

2.5.3 Connect the sensor circuit to the DataLogger

In this step, the voltage divider sensor circuit (either the thermistor or the photocell sensor constructed earlier) isconnected to the DataLogger. Use one from Figure 2.5, which does not include the LEDs.

Refer to DataLogger User guide for help.

1. The V+ from the DataLogger is the sensor circuit 3.3 Volt connection. It is only turned on briefly when theDataLogger is sampling the circuit. This reduces the energy that the DataLogger uses.

2. The GND from the DataLogger is the sensor circuit ground.

3. Any of the CH0-CH7 can be connected to the sensor circuit Vo. Make sure the settings in the DataLoggersoftware match the channel you are connected to.

Use this process to insert wires into the DataLogger:

1. Place the wires in the channel you decide to use.

c�2010 Oregon State University ENGR 201 Manual 29

Page 8: Resistive Sensors and the DataLogger

CHAPTER 2. RESISTIVE SENSORS AND THE DATALOGGER

2. Insert the wire all the way into the connector opening.

3. Use a small screw driver to tighten the clamp

2.5.4 Sampling the Signals

Use this process to start collecting data, because the DataLogger has already been set up (earlier in this lab) to doautomatic sampling:

1. Move the RUN/STOP switch to the RUN position.

2. Changing the sensor environment: Either change the light striking the photocell, or change the surroundingtemperature for the thermistor, depending on the circuit connected to the DataLogger.

Do this in a controlled manner:The lab report will need to explain the changes in a graph ofthis data.

3. After having the DataLogger sample for one to two minutes, move the RUN/STOP switch to the STOP position.

2.5.5 Graphing the Stored Data

In order to graph the data, follow these steps:

1. Open the .csv file with Excel.

2. The data should be located in Columns A (the sample number) and B (the data). If the DataLogger isconfigured to use the other channels they will appear in the other columns.

3. Making a Voltage vs. Time graph of the data:

(a) The numbers that the computer has received reflect voltage readings from the sensor circuit. This voltagehas been converted from an analog to a discrete value ranging from 0 to 1023. In order for these values tobe useful they must be converted back to voltage. Use equation 2.1 and solve for V1:

i. The Digital Value term is the number returned from the DataLogger.ii. VREF is approximately 0V, and the battery voltage is 3.3V.

DigitalV alue =(V1 − V REF ) ∗ 210

BatteryV oltage(2.1)

(b) The sample numbers must be converted into units of time, using the frequency. Use equation 2.2 to solvefor Time:

i. The sample number is the value returned from the DataLogger.ii. Remember to consider the units of frequency, it is not measured in seconds.

Frequency =1

SamplePeriod=

SampleNumber

T ime(2.2)

(c) Once the analog voltage and time have been converted from the raw DataLogger data, plot the voltage vs.time graph.

If the DataLogger is run once, then ran again, there will be two separate sets of data in the.csv files. The division between the two sets is clearly marked to avoid confusion.

30 ENGR 201 Manual c�2010 Oregon State University

Page 9: Resistive Sensors and the DataLogger

2.6. LAB REPORT

2.6 Lab Report

At the end of this section a clear and concise report must be written. Turn in the typed report next week. The reportshould include the following:

1. Any data recorded in the lab.

2. All circuits built during lab (drawn using LTSPICE or a similar program).

3. Simulate the circuit with a variable resistance. A tutorial for this task can be found on the lab website.

4. If any modifications were made to a design, explain why such steps were taken and how it helped the endresult.

5. Explain how the lab relates to your discipline and where you might be able to use some of the informationlearned in lab. (Be as specific as possible, citing real-life examples)

6. Any calculations performed in this lab.

7. Length is not a requirement, but completeness is. Dont forget any important information.

Current guidelines and an example lab report are available on the lab website.

2.7 Challenge

Challenges can be completed for extra credit. This credit can be used to replace missing lab points. Points over 100

1. (3 points) How does the circuit (either circuit) change with the addition of the LED? At room temperature orambient light intensity, consider the currents and voltages at various points in the circuit. Record these valuesand compare and explain any differences. For assistance with the explanation, try looking up the HLMP1700LED datasheet.

c�2010 Oregon State University ENGR 201 Manual 31