System Description
The system is made up of one PIC32MX170F256B (PIC32) microcontroller. All the subcomponents are controlled by the singular PIC32. At power on, a singular LED matrix displays "Welcome" and waits for the user to start the game.
After powering on the game, the player sets the difficulty level (through a potentiometer) and starts the game by swiping a card (through an infrared break beam sensor). NeoPixel lights that are wrapped around the base of the game box change color as the difficulty level is changed.
Three objects (balloon, blimp, and satellite) attached to three separate servos with pulleys begin descending when the game starts. The players can raise the objects by shining the laser diode inside the 3D printed airplane yoke at the center of each object, which each house an analog light sensor.
When the timer runs out, regardless if the player wins or loses, a gear is dispensed using another motor servo.
Due to time constraints, we did not transfer the breadboard circuit onto a protoboard, but many measures were taken to ensure the wiring was as robust and decluttered as possible. Wires or breakout pins of each subcomponent were permanently elongated with solder and heatshrink or electric tape, and the power and ground of each component were connected with twisted pair cable. Red and white twisted pair cables were used for 3.3V connections, and green and white twisted pair cables were used for 5V connections to reduce confusion and loose wiring.
Finally, two wires connected external power to the box internal electronics. The 3.3V source plugged into the power source located on the breadboard, where all of the rails were made 3.3V. The 5V source came from an external 5V regulated power supply which connected to a terminal block that was housed inside the game box. All 3.3V power electronics were connected to the breadboard, and all 5V power electronics were connected to the terminal block.
Dot LED Matrix - Display
The LED matrix connects to both the PIC32 microcontroller and the 74ACT244 buffer, which increases the signal voltage from 3.3V out of the PIC32 to 5V as required by the LED dot display.
Potentiometer (Difficulty Slider)
The slide potentiometer serves as an analog input device for user-controlled position or value adjustment. It forms a variable voltage divider, outputting a continuous analog voltage proportional to the slider’s position. This voltage is read by the PIC32’s ADC (Analog-to-Digital Converter), allowing the microcontroller to interpret the slider’s position for real-time control or parameter tuning within the system. The 10 kΩ resistance provides stable, low-noise analog signals while minimizing current draw.
NeoPixels (1 of 60)
The NeoPixel strip consists of RGB LEDs with integrated driver ICs, allowing each LED to be individually addressed along a single data line. The strip operates from a regulated 5 V supply, with a common ground shared with the PIC32 microcontroller. The PIC32 sends a timing-specific PWM data signal that encodes color and brightness information for each LED. This configuration enables complex lighting patterns using only one control pin while minimizing external circuitry and preserving consistent LED performance across the strip.
IR Break Beam Sensor (Card Reader)
The IR break-beam sensor uses an infrared emitter and a corresponding receiver placed opposite each other. The emitter continuously sends an invisible IR beam; when an object interrupts that beam, the receiver detects the interruption and changes its output. The receiver’s output is a digital signal (open-collector) that goes LOW when the beam is broken and HIGH when the beam is intact. The sensor can be powered from 3.3 V to 5 V (5 V giving the best range, up to ~50 cm), with common ground shared with the microcontroller. A pull-up resistor (internal or external ~10 kΩ) is required on the signal line so the microcontroller reads a clean digital HIGH/LOW.
Motor Servo (Gear Dispensor)
The HS-318 is a standard-size hobby servo motor providing a controlled rotational shaft output, used to actuate the gear dispenser in the mechatronics project. It operates over a 4.8 V–6.0 V supply range, driven by a PWM control signal from the microcontroller.
Internally, the servo contains a DC motor, a small potentiometer for feedback, and nylon (resin) gears — together forming a closed-loop mechanism that positions the output shaft precisely according to the pulse-width of the control signal. When commanded, the PIC32 sends a periodic pulse with the pulse width specifying the target angle. The servo’s internal controller drives the motor until the internal potentiometer matches the desired shaft position — enabling reliable, repeatable movement of the gear dispenser.
The HS-318 has moderate torque (≈ 3.0–3.7 kg·cm) and speed (~0.15–0.19 sec/60°) and is suitable for actuating small mechanical loads like a gear dispense
Motor Servo - Target Object (1 of 3)
The 2000-Series Dual-Mode servo is a standard-sized servo that can operate in two different modes: 1) Default mode (positional mode), which accepts a PWM control signal, directly determining the angular position of the output shaft, and 2) Continuous-rotation mode, in which PWM controls rotational speed rather than absolute position. This mode allows for dynamic motion or repeated up/down cycles if needed
Key electrical/mechanical characteristics: the servo operates over a supply voltage range of roughly 4.8 V to 7.4 V. Supporting hardware includes steel gears, dual ball-bearing shaft support, and a 25-tooth spline output. These servos were used to drive the up/down motion of three separate targets via pulley systems — leveraging their positional control (for precise placement of targets) or continuous rotation mode if smooth/repetitive motion was required. The combination of sufficient torque, speed, and durable mechanical design makes them well-suited for cyclic motion designed in our game.
Laser Diode (Player Laser)
The laser diode module is a 5 mW, 650 nm red laser used to create a narrow, visible beam for precisely indicating the target location in the game. It operates from a 2.8 V–5.2 V DC supply and draws approximately 25 mA, making it compatible with standard low-voltage rails in the system. The module’s compact cylindrical housing allows it to be rigidly mounted so the beam remains aligned with the target. The laser diode provided a stable visual aiming reference for players. When the beam is directed onto an Adafruit light sensor breakout (phototransistor-based), it causes a measurable change in the sensor’s output voltage, which is read by the PIC32 to detect when a target object is successfully aimed at or “hit.”
Analog Light Sensor (Target Object Detector)
The analog light sensor breakout consists of a phototransistor that outputs a voltage proportional to the intensity of incident light. Each of the three sensors was mounted at the center of the target objects in the game, allowing it to detect illumination from the laser diode. The sensor operates from a 3.3 V–5 V supply, with a common ground shared with the microcontroller, and produces an analog voltage that varies with light intensity. The PIC32 reads the detected voltage changes when the laser diode beam strikes the target.