Project 1:
Dusk-to-Dawn Light
 



Introduction

In this project, we will create an automatic lighting system. A photocell - a light-sensitive resistor - will be used in a voltage divider to change a voltage based on the ambient light level. A Bipolar Junction Transistor (BJT) will be used as a switch to turn on a light-emitting diode (LED) when the ambient light level becomes low. A schematic of the circuit we will use is shown in Figure 1.

A brief discussion of the components used in this project is provided below. Links to slightly more detailed descriptions of the various components are provided in the subsections below.




Figure 1. Dusk-to-dawn lighting circuit.


Resistor and Photocell

Resistors are typically used to restrict, or "resist", the flow of current. Resistors are thus commonly used to adjust the current provided to other circuit components. Photocells (sometimes called photoresistors or photo-conductors) are devices whose resistance changes according to the light intensity applied to them.

The resistor and the photocell in Figure 1 above form a voltage divider. In a voltage divider, the total voltage difference across the two components is divided among the individual components in proportion to their resistances. (This concept is presented in mathematical terms on the Key Topic page for sensors and voltage dividers.) Thus, when the photocell's resistance is low, the voltage difference across the photocell is low. Conversely, when the photocell's resistance is high, the voltage across the photocell is high.

 


Step 1: Implement the voltage divider

We will start by creating the voltage divider portion of our dusk-to-dawn light. A schematic of the circuit is shown below. (Note: this is similar to the circuit of Figure 1, but without the BJT or the LED.) We are using a 10kΩ resistor for our fixed resistor, and 5V as our voltage supply. The Key Topic page on resistors explains how to apply and measure voltages, how to choose resistors based on their color code, and how to use a DMM to measure resistance.


  1. Choose a 10KΩ resistor from your parts kit, and verify the resistance value by measuring it with your DMM.
  2. Construct the circuit shown above. Use VMTR2 to measure the voltage across the photocell (VB in the figure above). Use VP+ on the EE board to apply the 5V source to the circuit. The physical circuit should look similar to the circuit shown below.
  3. Note the voltage displayed on VMTR2 when the photocell is uncovered. Cover the photocell; the voltage across the photocell should increase.




Bipolar Junction Transistors (BJTs)

Bipolar Junction Transistors, BJTs, act as dependent sources - that is, the BJT can control the power provided to one part of a circuit, based on the current or voltage in another part of the circuit. BJTs are three-terminal devices; the terminals of a BJT are called the base (B), the collector (C), and the emitter (E). The symbol used to represent the type of BJT we will be using is shown in Figure 2(a). Our circuit employs a PN2222 BJT; the physical appearance of this BJT is shown in Figure 2(b), along with the relative locations of the base, collector, and emitter for that BJT.

 


 

(a) BJT symbol
 
(b) PN2222 BJT


Figure 2. BJT symbol and physical appearance of PN2222 BJT.


If we apply a voltage to the base of the BJT, current is allowed to flow from the collector to the emitter of the BJT. Typically, the higher the voltage applied to the base of the BJT, the more current flows from the emitter. In this project, the BJT can act as a switch; low base voltages turn off the switch (the emitter current is zero) while high base voltages turn the switch on (the emitter current is non-zero).




Light-Emitting Diodes (LEDs)

LEDs are two-terminal semiconductors that conduct current in only one direction. The LED terminals are called the anode and the cathode; current flows from the anode to the cathode. (Thus, it is important that the LED be correctly placed in your circuit - if you try to flow current from the cathode to the anode, the LED will not work.) The LED chips are typically enclosed inside a plastic housing; these chips emit light when a small electric current (typically 10mA to 25mA) flows through them.

 


Figure 3 shows the schematic symbol for a diode, along with its physical appearance. The anode terminal is longer than the cathode, and that the plastic cover of the diode is beveled off on the cathode side of the diode; you can use these characteristics to determine the cathode vs. anode terminals when you are wiring circuits.



Figure 3. LED schematic symbol and physical appearance.


Step 2: Add the BJT and the LED

We will now add the BJT and LED to our circuit to create the overall circuit shown schematically in the figure below. The Key Topic pages for MOSFETs and LEDs explain how to use dependent sources such as BJTs and MOSFETs, and how to use LEDs to emit light.


  1. Connect the base of the BJT to the terminal connecting the photocell and the 10kΩ resistor. Connect the collector of the BJT to VP+, and the emitter of the BJT to the anode of the LED. Connect the cathode of the LED to ground. Use VMTR1 to measure the voltage applied to the anode of the diode (VD in the figure above). The resulting circuit should appear
  2. Construct the circuit shown schematically above. Use VMTR2 to measure the voltage across the photocell (VB in the figure above). Use VP+ on the EE board to apply the 5V source to the circuit. The circuit should look similar to the circuit shown below.
  3. Cover the photocell. The LED should light up. Check the base voltage of the BJT (VB in Figure 1) and the voltage difference across the diode (VD in Figure 1) as you cover and uncover the photocell. Do they behave as you expect?