Electronics and Instrumentation - Project 4 TITLE: Optical Detection Up/Down Counter For this project, each student will work in a group of 2 (or 4?). Diagrams of the basic up/down counter circuit and decoders to drive the 7-segment displays LEDs are available in the studio. Goal: Using the given design of an up/down counter with 7-segment display decoding, the counter will receive its input from a pair of light-sensing phototransistors (the same ones used in the optical transmitter/receiver project). The objective is to use two detectors side by side that can determine the direction of an object's shadow interrupting the light illuminating the phototransistors. An object moving from left to right will darken the left detector before the right and vice versa. The two phototransistor signals going to the counter will be used to determine if the count should be incremented or decremented. The mechanism is fairly simple. One signal drives the CLOCK input of the counter while the other controls the UP/DOWN counting direction. If the clock edge arrives before the count direction is switched, the counter will increment. If the direction is set LOW before the edge of the clock arrives, the counter will increment. There are two options that can be completed for extra credit. Every group must complete at least a single digit bi-directional counter, but those looking for a bit more of a challenge may try to implement a 2-digit counter with drivers to two 7-segment displays. The trick on adding the second counter chip is to disconnect its Cin connection from ground (as it is for the first digit) and give it the carry out signal from the first digit counter. The second option is the addition of an automatic power-on reset to the counter that will clear its count value to zero every time the circuit is powered on. This is done with a simple RC circuit with a time constant of a couple hundred msec that holds the PE pin HIGH briefly whenever the circuit is powered up. Application: The optical detection/counter circuit will be used to count events in one of several applications. The various applications may require adjustments to the detection circuit in terms of changing the resistance or capacitance of the components around the phototransistors to adjust the sensitivity to changes in light. You may decide to use a separate focused light source instead of ambient light. Three suggested applications are: 1. Count the spokes on a plastic wide-spoked child's bicycle wheel as they rotate by the phototransistors. If the direction is reversed, the count should decrement. 2. Keep track of the total number of people in a room by counting up when a person enters the room and counting down as someone leaves (people will be assumed to enter and exit one at a time). Because the movement of walking people can be jerky and erratic, the sensor output circuit may be required to go through a Schmitt trigger buffer before being used as an input to the counter. 3. Count small objects moving on a track or rail by the sensor. Special Considerations and Enhancements: 1. What is the purpose of the capacitor across the phototransistors? What happens if C is increased or decreased? How will it affect the detection and counter performance. Can the sensitivity of the detector be increased or decreased by adjusting the R value? What are the advantages and disadvantages of using ambient light or a separate directed light source? 2. Characterize the sensitivity of the detector in term of voltage vs. distance of light blocking object from the sensor. You should check the maximum count speed of the detector and counter to be able to document the any limitations of the overall system. You should be able to model and simulate how the R and C on the phototransistor affects its switching speed or response speed to changes in illumination. 3. What does the decoder chip do? How does it work (what kind of logic function does it perform)? 4. What happens if you count down from 0? Why? What happens if you count up from 9 (or 99 if you have a 2 digit counter)? Why? 5. A set of LEDs (with 200 ( current limiting resistors) may be added to the Q0 to Q3 outputs to display the count output in binary. 6. How does the optional power-on reset circuit work (if you implement it)? 7. The PE (RESET) pin actually loads in a binary value set by the P0 to P3 pins (LO « 0, HIGH « 1), which are all held LO here to set the counter value to zero. A non-zero value could be loaded into the counter used as a down counter. When the count goes below zero, Cout could be used to drive an LED to indicate a predetermined number has been hit. Group Responsibilities: Each group will need to write a pre-project and final report. (Note: Both reports can be handed in together on the last day of class. You still need to write both reports to be sure that you cover all the standard questions. The signature sheets from the last experiments can also be handed in on the same day.) The format will be the same as before, following the guidelines posted on the course web page under the syllabus. All issues should be addressed in the final reports. The group should pick one of the application areas suggested above and build and optimize the circuit for that particular application. There are a few open component choices in the diagrams, and you should decide whether you are going to use ambient light or a directed source. That decision will influence how you will modify the detector to make it more or less sensitive and whether you will what to use a Schmitt trigger. As always, you should consider methods to improve performance accuracy and sensitivity by, for example, blocking unwanted light or using different sources. Voltage levels at all points in the detection circuit must be measured and documented. If possible, try to obtain scope traces of the transitions to determine response speed. This should be compared to simulations or simple models of the detection circuits. For each measurement made, there should be some discussion regarding which features of the data make some sense and which do not. Finally, any questions on whether or not some task should be part of the project should be sent to one of the course staff. Questions and answers will be appended to this list posted on the web. Pre-Project Report: Your pre-project report must address the questions and issues listed in the syllabus and should include most of the following information or address most of the following questions/issues: 1. Include a diagram of the circuit(s) you are going to build, that is, a diagram of the receiver or transmitter and the appropriate variations for different sources or loads. 2. Discuss the operation of the circuit 3. Discuss the operation of the ICs (integrated circuits) in your circuit. 4. What function do the components perform? 5. Over what frequency range will your circuit work? How fast can it count? 6. What restrictions are there on the size of the objects being counted? What assumptions are being made as to how it moves past the detectors? 7. Describe your input and output signals (e.g. units). 8. How might you simulate your circuit on PSPICE? What components might you have to approximate? 10. How will you test your circuit? Write up a simple procedure that you will follow. 11. What parameters might you use to quantify the fidelity of your setup? 12. What variables/factors do you expect to affect the operation of your circuit? 13. What changes in the circuit design would you suggest that could improve its performance? 14. What kind of noise might you expect to find and how might you minimize it? 15. List the name of your partner and the names of the partners in the other group you are working with.