The push button initializes the game when pressed.
The IR proximity sensor detects obstacles that are placed close to the sensor. When an obstacle is detected, the blimp servo motor is stopped. Once the obstacle is cleared, the servo starts moving again.
The IR proximity outputs LOW for blocked state and HIGH for cleared state.
The potentiometer controls the game difficulty and speed of the blimp servo motor. When the speed is increased, the probability of a trial returning true is increased (and vice versa), causing the plague doctor more likely to be triggered. The probability in the trial is determined based on the analog potentiometer input (which is MotorSpeed), with a baseline of 20% probability. It is linearly increased as the MotorSpeed increases, and saturates at 100% with a 80% speed.
The LED matrix displays the time countdown during the game and the messages for idle timeout, game start, game failure, and game success where applicable.
The red LED current-limiting resistors were selected as 680Ω. With a 5V supply and an estimated forward voltage on the LED of 1.8V, this yields an operating current of approximately 4.7mA. While this exceeds the LED's nominal 2mA rating, it remains well within the absolute maximum rating of 7mA for standard indicator LEDs. The higher current results in increased brightness, which improves visibility of the indicator during operation. 1 LED is for indicator on top of the screen, and 2 LEDs are for the eyes of the plague doctor.
A 74ACT244 octal buffer was used to drive the indicator LEDs for two reasons. Current capacity: The three LEDs, each drawing approximately 4.7mA, require a total of ~14mA. While this is within the per-pin current limits of the PIC32 GPIO, the 74ACT244 can comfortably source up to 50mA per output. MCU protection: Buffering the outputs isolates the PIC32 from potential overcurrent conditions and reduces loading on the microcontroller's power supply rails.
The limit switches are located at the two ends of the blimp motor track. The end limit switch is triggered when the user successfully reaches the end of the track and indicates game success. The home limit switch is used to indicate the homing position during each game reset.
A 180 degree servo motor is used for the gear dispenser and the plague doctor. The motor is actuated using the PIC PWM library. The gear motor dispenses one gear every time the game is won. The plague doctor motor does a 180 degree rotation for each trial that returns true.
A continuous servo motor is used for the blimp and controls its linear movement along a track. The motor is actuated using the PIC PWM library.