The entire circuit of the SpaDL is composed of a PIC32, 8 different active components and their respective circuits. The entire circuitry is composed of: the IR/Phototransistor circuit, the timer shift register circuit, the timer LED circuit, the game button circuit, the LED matrix circuit, the servo motor circuit, the joystick circuit, and the Button LED circuit (also called the PIC32 LED circuit). The MPLAB Snap featured in the circuit diagram is primarily used to program the PIC32 and is not used for the operation of the game.
The IR/phototransistor circuit corresponds to the circuit that checks for when two poker chips has been inserted into the SpaDL. It is primarily comprised of the IR LED, the photodiode, as well as the LM393 comparator. When a poker chip passes through the coin slot and pass the circuit, the IR light emitted from the IR LED is reflected into the photodiode -with the photodiode outputting a signal to the comparator. The comparator then swings the signal high to be received into the PIC32. This circuit is based on the datasheet of IR infrared sensor that integrates all three of these functionalities (IR LED, photodiode and LM393) together into one component.
The timer shift register circuit corresponds to the circuit that controls the LEDs indicating to the player how much time is left in the game - with each going dim representing 10 seconds having been passed. For this circuit, the shift register that is mainly used is a 74HCT595 and four ports of the shift register are connected to the PIC32. Since the game lasts only 60 seconds, only 6 LEDs will be used and they correspond to 6 of the output ports of the 74HCT595. Each port will be connected to an N-type MOSFET (which corresponds to the 2N7000 component in the timer LED circuit) that would allow current to flow from drain to source when a signal is sent to the gate of the MOSFET from the 74HCT595.
The game button circuit is primarily composed of the button, a pullup resistor, a resistor leading to a port on the PIC32, and a capacitor. When the button is pressed, current can flow to ground instead of the PIC32 - resulting in a signal indicating that the button has been pressed being sent to the microcontroller.
The LED matrix circuit corresponds to the circuit that controls the LED matrix that is used to indicate to the player their score, when to insert 2 coins to start the game, and the congratulatory message. The circuit is composed of mainly 2 components: the 74ACT244 and the LED matrix. The 74ACT244 is primarily used to interface, and buffer signals into, the LED matrix. The 74ACT244 is controlled by 3 ports from the PIC32 and 3 of its outputs controls the LED matrix.
The servo motor circuit corresponds to circuit that controls the servo motors during the operation of the game. The PWM port of the servo motor is connected to a port on the PIC32 that is also configured as PWM. At that port on the PIC32, signals will be sent in pulses to the motor with a certain frequency at certain pulse widths to rotate the motor to the desired position during the game.
The joystick circuit corresponds to the circuit that reads the inputs from the joystick during the operation of the game. The VRx ports and the VRy ports of the joystick control what directions the inputs into the joystick will be registered as during game operation. These two ports are connected to two ports on the PIC32 that are configured as analog inputs. The 10-bit ADC reads values in the 0-3.3V range, converting the signal to a value between 0 and 1023. In the neutral position, the joystick reads a value of approximately 512, and an input is detected based on a threshold of 400 in any direction (excluding diagonals).
The button LED circuit corresponds to the circuit that lights up the LED when the player has to press the button in the sequence. The LED is connected directly to a port on the PIC32 and, when the LED has to be lit up during the sequence, a signal is outputted of the PIC32 into the LED - lighting it up.
The PIC 32 circuit corresponds to the circuit that controls the actuation of the servo motors, the coin detection of the IR/phototransistor circuit, the joystick input detection, the LED outputs, and the LED matrix outputs. It is primarily comprised of the PIC 32 that is the microcontroller in which the game application, and the respective services for each of these functionalities, is loaded onto. The Snap connections are primarily used to load the program from MPLAB into the PIC 32.