Download Lab 2

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Wien bridge oscillator wikipedia , lookup

Negative resistance wikipedia , lookup

Index of electronics articles wikipedia , lookup

Test probe wikipedia , lookup

Nanofluidic circuitry wikipedia , lookup

Josephson voltage standard wikipedia , lookup

Power electronics wikipedia , lookup

Regenerative circuit wikipedia , lookup

Integrated circuit wikipedia , lookup

Wilson current mirror wikipedia , lookup

Multimeter wikipedia , lookup

Charlieplexing wikipedia , lookup

Surge protector wikipedia , lookup

Schmitt trigger wikipedia , lookup

Operational amplifier wikipedia , lookup

Valve RF amplifier wikipedia , lookup

CMOS wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Ohm's law wikipedia , lookup

RLC circuit wikipedia , lookup

Transistor–transistor logic wikipedia , lookup

Rectiverter wikipedia , lookup

History of the transistor wikipedia , lookup

TRIAC wikipedia , lookup

Electrical ballast wikipedia , lookup

Current source wikipedia , lookup

Two-port network wikipedia , lookup

Network analysis (electrical circuits) wikipedia , lookup

Power MOSFET wikipedia , lookup

Opto-isolator wikipedia , lookup

Current mirror wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Transcript
Laboratory 2
Photoresistor, Photointerrupter and Transistors
Pre-Lab
= Required to submit your Multisim circuit files before you start the lab.
Pre-lab Questions
1.
(Figure Plab2.1). Explain the theory of operation of this circuit.
Figure Plab2.1 Light-controlled LED
2. Use the 2N3904 datasheet provided in the UCO wiki to help you draw and label the pins
on the figure below and to record the following values:
IC(max) = ______
VCE(max) = _______ VBE(sat) = _________
Figure Plab2.2 2N3904 Pin-out
3.
(Figure Plab2.3). In the following circuit, L1 is a light bulb rated at 0.5 A at 5 V, and
the transistor’s hfe is 100. The light bulb L1 starts to glow when the current flow through
it reaches 100mA, and if the current is higher than 1A, it will burn out. If the resistance of
the variable resistor VR is gradually lowered from 10kΩ, at what value of VR will the
light bulb start to glow? Is there a value of VR, for which the light bulb will burn out?
What is it if so?
Figure Plab2.3 Lamp Control Circuit
Page 1 of 8
Laboratory 2
Photoresistor, Photointerrupter and Transistors
Purpose
• To introduce photoelectric components and transistors used as power switching devices.
• To become familiar with the capability of the Basic Stamp 2SX to measure the change of
resistance of a sensor
• To build and experiment with a light-controlled switch
Introduction
Photoresistor
A photoresistor is simply a resistor whose resistance depends on the amount of light incident
upon it. They are used to make light-sensitive switching and devices. Photoresistors are often
made from cadmium sulfide (CdS). The resistance of a CdS photoresistor varies inversely to the
amount of light incident upon it. In other words, its resistance will be high in the dark and low in
the light.
Figure 2.1 Photoresistor
Transistor
Figure 2.2 illustrates the nomenclature used to describe the behavior of an NPN bipolar
transistor. It is a three terminal device consisting of the base, collector, and emitter. The
transistor acts like a current valve by using the voltage bias across the base and emitter (VBE) to
control the flow of current-emitter circuits (IC). The circuit connected to the collector and emitter
along with the bias voltage dictates how much current flows.
Page 2 of 8
Figure 2.2 NPN Bipolar Transistor and Nomenclature
Here are some general relationships between the variables shown in Figure 2.2:
Page 3 of 8
Components
Qty.
1
2
1
1
1
1
1
1
1
1
1
1
Item
OEM Basic Stamp 2SX microcontroller
1kΩ resistor
10kΩ resistor
330Ω resistor
220Ω resistor
470Ω resistor
0.1µF capacitor
2N3904, NPN transistor
Photoresistor
Photointerrupter
Potentiometer
LED
Procedure
1. Measure the photo-resistor’s resistance in the ambient lighting of the lab. Once this is
recorded, repeat the measurement, only this time covering the cell with your hand. These
two extremes will be used in calculations later on.
2. Figure Plab2.1 shows a simple ‘light-controlled-LED’. The circuit should turn-off the
LED as the photo resistor is covered. Based on the information obtained above, what is a
good supply voltage to use? (Hint: V should be high enough so that enough current flows
through the LED when the photo resistor has low resistance, and yet should be low
enough so that the current is not enough to turn on the LED when the photo resistor has
high resistance.) Build the circuit and check its function.
3.
(Figure 2.3)
Page 4 of 8
Figure 2.3 Transistor Switch
4.
5.
Page 5 of 8
6.
(Figure 2.4). Figure 2.4 shows a light-controlled-switch circuit using a 2N3904, NPN
transistor. With a properly selected resistor R1, the voltage at the base of the transistor in
the dark state is less than 0.7 V, and therefore the transistor is in the cut-off state. As the
photoresistor’s resistance decreases (as the result of an increase in light intensity), the
base voltage increases. Once the base voltage reaches 0.7 V, the base current starts to
flow, and any further decrease in the photoresistor’s resistance causes an increase of base
current. This base current increment will be amplified by the current gain of the
transistor.
Choose the supply voltage. The supply voltage is often a predetermined value rather than
a design choice. For example, if battery is to be used, the voltage should be either 3, 6, or
9V. In the following calculation and in later circuit construction, use any voltage of your
choice between 6 V to 15 V.
Figure 2.4 Improved Light-Controlled Switch Using a Transistor
7. Select R1. First, determine a value of the photo resistor’s resistance (call it Ron) at which
you would like the LED to be turned on. The resistance value can be that for when the
photoresistor is covered or uncovered, it’s up to you. (Just make it clear in your report).
The value of R1 should be such that 0.7 = V*R1/(R1+Ron). A variable resistor (trim pot)
can be used so that the turn-on value can be adjusted.
8. Select Rc, the current limiting resistor. With this resistor, the collector current is limited
to Imax=(V- VLED - 0.4)/RC , where VLED is the voltage drop across the LED, and 0.4 V is
a typical saturation voltage between the collector and emitter. Select RC so that the LED
current is limited to be less than 20 mA (preferably 5-10 mA). Using RC, construct and
test the circuit.
9.
(Figure 2.5). Examine the photointerrupter and look at its specifications. Build the
circuit shown in Figure 2.5, using the resistors indicated. Note that a single 5V source can
be used to provide both voltage signals, and the ground for the input and output circuits
must be connected to be common. Measure the output voltage (Vout) with and without
the beam interrupted (e.g., with a thick sheet of paper or a plastic card). What conditions
(interrupted or not) correspond to the high and low states of the output? Explain why
each condition results in the respective state. Why are the resistors required?
Page 6 of 8
Figure 2.5 Photointerrupter
10. Build the part of the circuit in Figure 2.6 labeled ‘A’. Connect the 1k resistor to any of
pins P0 through P15 on the Basic Stamp 2SX (denoted xx below). Don’t forget that you
need to supply power and ground to the Basic Stamp 2SX.
Figure 2.6 Light-Controlled Switch Using the Basic Stamp 2SX
11. Run the following program, and see if you can make the LED blink:
'Blinktest
'Put the date here
'Put your name here
loop: high xx ‘substitute the pin number you chose in place of xx
pause 500
low xx ‘substitute the pin number you chose in place of xx
pause 500
goto loop
Page 7 of 8
12. When you have successfully completed step 11, build the rest of the circuit shown in
Figure 2.6. Connect the 220 ohm resistor to another one of the pins P0 through P15 (but
different from the pin you chose in step 11, denoted yy below).
13. Run the following program:
'Light-Controlled Switch
'Put the date here
'Put your name here
loop:
result var word
high yy ‘substitute the pin number you chose in step 12 in place of yy
pause 1
RCTIME yy,1,result ‘substitute pin no. you chose in step 12 in place of yy
debug ? result
if result > 40 then turnON
low xx ‘substitute the pin number in step 11 in place of xx
goto loop
turnON:
high xx ‘substitute the pin number in step 11 in place of xx
goto loop
14. Look at the value of the variable ‘result’ in the Debug window. What happens to ‘result’
when you cover the photoresistor? Based on the value for the variable result that is being
displayed in the Debug window, you can adjust the threshold value of 40 to a value that
will cause the LED to be off under ambient light conditions, but turn on when a shadow
falls on the photoresistor. Experiment with the threshold value.
Questions
1. For the figure 2.6, what changes need to be made to the software (note: no need to change
any hardware) if you want to have the LED stay on under ambient light conditions and
turn off when a shadow falls on the photoresistor? Try it.
2.
(Figure 2.7). Replace the LED circuit in the figure 2.6 labeled ‘A’ with a 12V,10W
lamp circuit. Use the multisim to design and simulate the 12V, 10W lamp circuit. You
are only allow to use three components shown in figure 2.7 for your new circuit design.
You now have the knowledge to control devices that require more power than the Basic
Stamp 2SX can supply by itself.
Figure 2.7 Components for 12V, 10W lamp circuit
Page 8 of 8