Sky Juggler

A mechatronics carnival game that challenges users to keep 3 falling aircraft airborne for 60 seconds by aiming at each one with a laser. Final project website found at this link.

Course
ME218A: Smart Product Design Fundamentals

Timeframe

2 weeks [Co-term Fall]

Skills

Event-driven embedded C software for PIC32 microcontroller, electrical circuit design, 3D printing, laser cutting

Game Requirements

  • Power up into a welcoming mode

  • Time out after 20 seconds of no user interaction

  • 60 seconds of gameplay

  • Display the passage of time

  • Hold 50 gears, dispense 1-3 when gameplay is complete

  • 3 distinct user interactions

    • At least one form of non-sensing contact (IR, audio, etc)

    • At least one analog input (IR, joystick, potentiometer, etc)

  • 3 distinct modes of feedback

  • At least one electromechanical actuation (servo motor, fan, vibration, etc)

Inputs

  • Sliding Potentiometer - Adjusts difficulty (falling speed)

  • IR Beam Break Sensor - Card swipe triggers start of game

  • Photocell - Direct laser hit triggers aircraft ascent

Outputs

  • Aircraft Servo Motors - Direction and speed dependent on laser hit and difficulty

  • Gear Dispensing Servo Motor - Dispenses two gears

  • LED Display - Difficulty, countdown, and score

  • Neopixels - Colors change when difficulty adjusted

Instructions

  1. Adjust difficulty using sliding potentiometer

  2. Swipe card to start game

  3. Point laser at photocell centered on each aircraft to raise it

  4. There's a danger line—for every second that an aircraft stays above it, you get a point

  5. If an aircraft crashes in under 60 seconds, you lose and restart

  6. If all 3 aircraft stay airborne for 60s, you win and receive a score!

  7. Either way, you get two prize gears for effort :)


Game Demo

Winning

Losing

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 (Laser 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. 


Mechanical

Full Assembly

The full assembly was designed in Fusion 360. The frame was made out of 0.125" clear laser-cut acrylic, held together by 8-32 x ½" screws and a 0.015" interference between the teeth for a slight press fit. 

Pulley Sub-System

The idle and driver pulley wheels engage with the ridges on the timing belt to vertically translate the aircraft. ¼" ID bearings are press-fit into the idle pulley wheels for low-friction rotation about the ¼" diameter aluminum rod. Each idle pulley wheel is split into two halves to reduce print time, with the halves fastened together with 8-32 x ⅜" screws. The driver pulley wheels are rigidly attached to the servo hub via M4 screws. The pulley wheels were 3D-printed in white PLA. The aluminum rod, timing belts, and servos were purchased off-the-shelf components.

Flight Yoke

The flight yoke provides pitch and yaw control via a pan-tilt mount. Pitch is enabled via a horizontal ¼" x 2" D-shaft, while yaw is enabled by a vertical ¼" x 6" D-shaft that is press fit into the pan-tilt mount. The body is split into two halves, allowing the laser to be inserted when the front panel is removed. A pass-through hole routes the laser's power and ground wires through the mount toward the breadboard in the final assembly. The flight yoke was 3D-printed with black PLA.

Gear Dispenser

The arm mounted on the servo horn swings out 90 degrees and displaces two laser-cut gears simultaneously. The column that holds the gears in place is a separate component that slots into an opening in the ramp body. All components were 3D-printed in white PLA.

Aircraft Mounts

The 3D-printed mounts align with the grooves in the timing belt, allowing them to simply slide in without the need for adhesives. The laser-cut aircraft were secured to each mount with acrylic cement, and a hole was cut to press-fit the photocell into place.  The mounts were 3D-printed with black PLA. The blimp, hot air balloon, and satellite were laser-cut on neon yellow, neon pink, and neon orange acrylic respectively.

Card Reader

The card reader houses an IR beam-break sensor, which is triggered by a black acrylic card. Note: Transparent or non-black solid-colored cards did not reliably activate the sensor. The card reader was 3D-printed with black PLA.

Engineering Drawings


Electrical

Circuit Diagram

Electrical System Overview

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, two gears are 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 MAX7219 Dot Matrix Module 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.

Interactive View

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

The NeoPixel strip consists of 60 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 Beam Break 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.

Servo Motor (Gear Dispenser)

The HS-318 is a standard-size servo motor providing a controlled rotational shaft output, used to actuate the gear dispenser at the end of the game. 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.

Servo Motor (Pulley System)

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.

Software

State Diagram

Code


This section outlines the three services we wrote and consist of a top level Game state machine, a Motor control service and an LED service. The entire code repository can be found here.

GameSM

The GameSM controls the main actions of the overall game. This service keeps track of the different states and posts events to the LEDService and MotorCtrl. Game FSM will also handle gameplay and user inactivity timers. There is also a testing mode built in which was used for debugging.

MotorCtrl

This service is responsible for commanding the motors for each balloon as well as the gear dispenser. 

LEDService

This service is responsible for controlling the LED display as well as the neopixel array we used.

Gallery


Previous
Previous

CS230: DeepSea

Next
Next

CS225A: PickleBot