LAB 2: Phototransistors and Display

Objectives

The purpose of this lab was to work on the treasure detection aspect of the robot.

Materials

IR Light emission and detection (Part 1)

Base Station Display (Part 2)

Procedure

It was divided into two sections.the fist part consisted
of building and testing an IR light detection circuit with
Phototransistors. the second part was building the display
component of the base station.

Part I: Light Detection and Frequency Measurement

The parts needed for the light detection were gathered.
Three phototransistors were placed on the robot (one on
its left, forward and right sides). This was to allow the
robot to detect and measure treasures from these direction.
Then, one phototransistor's circuit was build on the robot's main breadboard.

Small Circuit with Infrared LED

On a breadboard, a 65.5Ω resistor was connected in series with the IR LED. First, the signal generator set at an amplitude of 1.2 V and a frequency of 1 kHz, was used as a power source for the LED. Then, the Oscilloscope was used used to measure the square wave signal coming out of the signal generator. Secondly, the red lead of the Oscilloscope was connected to the point of measurement of the phototransistor circuit. Its measured electrical signal was displayed using the Oscilloscope at 1 kHz. For higher frequencies (> 9 kHz), the signal appeared to be disorted. We attributed his behavior to the phototransistor. At higher frequencies, its capacitance increases due to the large area of the collector base region. This affects the phototransistor's ability to convert optical signal into electrical signal. These observed behaviors are illustrated in the figures below.

Oscilloscope's trace at 1kH

Oscilloscope's trace at 9kHz

Thirdly, the previously built phototransistor's circuit output was connected to the analog pin A1 of the Nano Every board on the robotframe. The integrated peripherals analog comparator and TCB of the Nano were used to measured the frequency of the IR signal. The measured frequencies were displayed on the serial monitor (Fig. 3) withthe signal generator set to 1kHz. It is worth mentioning that we built off our implementation from the AC_readPhototran code provided in lecture. Upon testing the one phototransistor circuit, the other two phototransistor circuits were completed. Each cicuit was connected to an individual analog pin on the Nano. For testing, the code was updated to cycle through each phototransistor and determine if there was an IR signal. If present, the measured frequencies were displayed on the serial monitor.

Serial Monitor Display 1kHz

Part II:4-Digit 7-Segment Display

In this section of the lab, the shift register, 7-segment display circuit was built as shown below. The outputs of the 7-segment display were connected pins D2-D8 on the Nano.

7-segment Schematic

7-segment Display: 2468

Testing the 7-segment Display

The circuit was tested by displaying whole and decimal numbers.