## IR Sensing

To determine which dispenser and basket the Jawa Ship is pointed at is no trivial task. The problem with using a trans-resistive circuit to detect beacon signals is that the signal can simultaneously be saturated at close distances and too weak to be detected at far distances. This problem can be mitigated by extracting the vertical edges of the square wave emitted by the beacons through filtering and amplify the periodic signal of vertical edges.

The Fourier transform of a square wave tells us that a square wave is composed of sine waves at odd multiples of the original frequency of the signal (fundamental frequency). These sine waves are known as the harmonics of the original signal. Although, the higher harmonics more closely approximate the vertical edges of the square signal compared to the lower harmonics, the higher harmonics have amplitudes that are inversely proportional to the harmonic number. This demonstrates the tradeoff in vertical edge approximation and signal strength that needs to be considered when choosing the harmonics of the signal to extract.

Empirically, we found that we could filter out a square wave signal at the 17th harmonic and still be able to detect a signal from the edges of the playing field. Capturing a high harmonic reduces the variation in the high times of the square wave because the higher harmonics are more similar to the vertical square wave edges.

A high pass filter with a 22K resistor and 470 pF capacitor was used to extract components of the signal around 15392 Hz. These components will be very similar to the vertical edges of the square wave.

Empirically, we found that we could filter out a square wave signal at the 17th harmonic and still be able to detect a signal from the edges of the playing field. Capturing a high harmonic reduces the variation in the high times of the square wave because the higher harmonics are more similar to the vertical square wave edges.

A high pass filter with a 22K resistor and 470 pF capacitor was used to extract components of the signal around 15392 Hz. These components will be very similar to the vertical edges of the square wave.

Low Pass filters were integrated within the Op-Amp Circuitry to reduce the high frequency noise at the signal output leading to the comparator. This was done by adding a capacitor in parallel with the feedback resistor.

Lastly, another high pass filter is inserted between the trans-resistive circuit and the gain stage of the circuitry because a lot of noise was present in the output signal. Adding this high pass filter eliminates ambient noise and centers the signal at the virtual ground of 2.5V. A 39K resistor and 0.1 uF capacitor removes frequencies near 40.81 Hz and lower.

The comparator was implemented with a hysteresis band of 0.1V using resistors R8 and R9. This allowed us detect the rising edges of the square wave when it is far away and the signal has attenuated down to low voltages.