Optical Sensor - Embedded System Design - Lab Notes, Study notes of Computer Science

These are the Lecture Notes of Embedded System Design which includes Exceeded, Limit, Drive Slower, Larger Ticket, System Functions, Similar Principles, Basic Types Of Control Systems, Signals, Closed Loop etc. Key important points are: Optical Sensor, Circuit Detects, Counting Objects, Computing, Interrupted, Rotating Shaft, Transistor is Appropriately, Depending, Photons Generate, Voltage

Typology: Study notes

2012/2013

Uploaded on 03/22/2013

dhritiman
dhritiman 🇮🇳

4.7

(6)

106 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lab 3 - Optical Sensor
This circuit detects when a light path is interrupted and when it is completed. Uses
typically include counting objects or events such as computing RPM’s of a rotating shaft
with a “blade” that interrupts the light path every 1 or ½ cycles.
Circuit 3 An Optical Sensor that Reports ON/OFF
Background
Light incident at the base of the optical sensor/transistor causes a much larger current Ic
to flow. The transistor is appropriately doped so that when its base is exposed to light
(visible or IR depending on the device) the incident photons generate a base current.
When the NTE3100’s light path is not blocked it produces +5V at Vc. R1 is a current
limiting resistor.
The concept of a buffer is interesting. In a circuit it is possible that one component
operates over a range of voltages that differs from other components. For example, a
sensor might operate from 0V to 10V where any voltage above 5.0V is considered “1”.
However, TTL devices operate from 0V to 5V, where “1” is 1.75V or greater. So a
sensor value of “0” (4.5V) would be considered a “1” by TTL chips.
The solution to this mismatch is a buffer. This is a device that translates digital signals
from one protocol to another. Just to confuse the issue, the term buffer is also used with
regards to op-amps.
An ideal op-amp has low (zero) output resistance and high (infinite) input resistance.
The low output resistance ensures that later circuits only “see” the op-amp’s output
voltage looking back into the op-amp. That is, the output resistance of an op-amp is
usually in series with the input resistance of the next downstream device. This
relationship forms a classic voltage divider. Minimizing the op-amp’s output resistance
maximizes the amount of input voltage seen by the next device.
A typical use of an op-amp buffer is to magnify by 1 a signal from a device with high
output resistance into a low output resistance signal. Later circuits can then reference
that signal as a low output resistance voltage source with minimal signal loss.
Docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Optical Sensor - Embedded System Design - Lab Notes and more Study notes Computer Science in PDF only on Docsity!

Lab 3 - Optical Sensor

This circuit detects when a light path is interrupted and when it is completed. Uses typically include counting objects or events such as computing RPM’s of a rotating shaft with a “blade” that interrupts the light path every 1 or ½ cycles.

Circuit 3 An Optical Sensor that Reports ON/OFF

Background

Light incident at the base of the optical sensor/transistor causes a much larger current Ic to flow. The transistor is appropriately doped so that when its base is exposed to light (visible or IR depending on the device) the incident photons generate a base current. When the NTE3100’s light path is not blocked it produces +5V at Vc. R 1 is a current limiting resistor.

The concept of a buffer is interesting. In a circuit it is possible that one component operates over a range of voltages that differs from other components. For example, a sensor might operate from 0V to 10V where any voltage above 5.0V is considered “1”. However, TTL devices operate from 0V to 5V, where “1” is 1.75V or greater. So a sensor value of “0” (4.5V) would be considered a “1” by TTL chips.

The solution to this mismatch is a buffer. This is a device that translates digital signals from one protocol to another. Just to confuse the issue, the term buffer is also used with regards to op-amps.

An ideal op-amp has low (zero) output resistance and high (infinite) input resistance. The low output resistance ensures that later circuits only “see” the op-amp’s output voltage looking back into the op-amp. That is, the output resistance of an op-amp is usually in series with the input resistance of the next downstream device. This relationship forms a classic voltage divider. Minimizing the op-amp’s output resistance maximizes the amount of input voltage seen by the next device.

A typical use of an op-amp buffer is to magnify by 1 a signal from a device with high output resistance into a low output resistance signal. Later circuits can then reference that signal as a low output resistance voltage source with minimal signal loss.

Figure 3-1 – Transfer Diagram of a Hex Buffer

Voltages

V

V

DD

CC

(^0 15) Time(ns) x x+

Input

Output

0V

In reality the corners of the Input and Output signals are not so square. If interested wire- up a hex buffer. Use a function generator to drive the buffer, an oscilloscope to observe the input and output signals and a power supply for the rail voltage.

Figure 3-2 – Transfer Diagram of a Schmitt Trigger

Volts

V

V

(^0 15) Time x x+

Input

Output

0V

5

A Schmitt Trigger or Hex Schmitt Trigger is another type of buffer. Consider Figure 3- and estimate how the output would behave if the input had a “debounce” problem. That is, if the input quickly rises and falls several times then the output would also rise and fall. A Schmitt Trigger handles a partial loss of an input voltage by having two thresholds: V+ where any voltage above this value turns the Schmitt Trigger ON; V- where any excursion less than V- turns the trigger OFF.

The input to a buffer is a signal from a transistor. The transistor is half of a photon coupled interrupter switch (NTE3100). The other half is an infrared emitting diode. A specification sheet for the NTE3100 is available on the course web site. Print this sheet and read it. The following background material should remind you about the basic principles of diodes and transistors. You will need to correlate the specs (which are sparse at best) to the actual device and you will need to design supporting circuitry.

Recall, diodes are non-linear devices. A forward biased diode exhibits a linear relationship between current and voltage until a threshold voltage is impressed across a diode, at which point current flows virtually un-impeded. The polarity of the threshold voltage determines if a diode is forward or reversed biased.

The next step is to decide if the logic state is derived from Vc or Ve. This in turn determines the placement and value of R2. Also, the value of R2 is constrained by the current ratings defined in the NTE3100 specifications sheet. This has been completed and is shown in Circuit 3-4.

Circuit 3-

Pre-Lab assignments

  1. Read B, C, and O (course text), chapter 2.
  2. Read the data sheet for the NTE3100 on the course web site.
  3. Complete the Pre-Lab Questions

In-Lab Tasks

  1. Design and build the supporting circuitry for an interrupter module. Do not connect it the STK500. Test the interrupter module as standalone circuit.
  2. Wire a buffer and connect the interrupter to it. Verify that VC has appropriate voltages when the light path is both blocked and unblocked. Repeatedly block/unblock the light path. Is there a “debounce” problem? If the light path is not blocked, use the oscilloscope to measure VC. Hint. Ground all unused pins on the buffer.
  3. Now, complete Circuit 3-4 by connecting it to Port B/B 0 and use the VTG/GND pins on the STK500 as the circuit’s power supply.
  4. Write software for the ATMEL 8535 that counts the number of times the optical sensor is blocked/unblocked. Use a software loop to poll the input pin, Port B/pin B 0. Your design should include hardware and software so that the user can indicate when to start and stop the count. Also, the user should “know” when the counter is operating.

One solution is to designate and read start/stop buttons and status LED’s on the STK500. Again, when using CodeVision to generate code be sure to specify all of the ports that you are going to use and whether they function as input or output pins. Once you see how CodeVision sets the various control registers then you can start to write your C-code from scratch. Hint. When using the code generator be sure to update the Program Information tab. The text you enter is automatically inserted into your code.

  1. Refer back to Lab 1 for details on the strappings necessary to use the STK500’s switches and LED’s if you want to use them.

Parts List

  1. Hex Buffer or Schmitt Trigger
  2. Interruptible Light Path
  3. 10-wire cable for STK500 I/O (2)
  4. RS-232 Cable
  5. two-wire cables with a connector at one end (2)

Deliverables

Demonstrate to the lab instructor how your device functions as it is activated/deactivated and as the light path is blocked/unblocked. Your write-up should include how you characterized the interruptible light path and it should document the meanings of status LEDS and of start/stop buttons. Software requirement as described in class notes Lecture2-Lab

Software design needs to support (1) a start button (2) a stop button (3) a reset button to reset counter (4) counter recording number of objects blocking the light. (5) a heartbeat signal on LED

(6) LED7 toggles when a block is detected.