Automated Tilt-Maze Mechatronic Prototype
Timeline: May 2025
Contributors: Claire Mayder, Mila Filippova
Core Technologies: Arduino Elegoo 3R, SG90 Micro-Servos, C++ (in Arduino IDE), Foam Poster Board, Breadboard, and a whole lot of hot glue.
1. Project Overview
An electromechanical marble maze that utilizes dual-axis servo motors to dynamically tilt a physical playing surface, guiding a marble along a controlled path.
2. Mechanical Design & Material Analysis
Before building, we analyzed structural materials to optimize the balance between structural rigidity and servo load limitations.
Material Density and Mass Calculations
We chose to make our maze base 7 in x 7 in, with a wall height of 1 in.
We also had to consider the thickness of the 2 materials we were considering: Cardboard or Foam Poster Board.
Cardboard has a thickness of 0.1 in
Foam Poster Board has a thickness of 0.185 in
Cardboard
Foam Poster Board
But looks can be deceiving; the foam poster board looks way too big, right?
Wrong. Our goal has nothing to do with volume; it has everything to do with mass.
From this, we can see that the foam poster board is the no-brainer. It is what we ended up choosing for cost reasons as well.


Torque & Load Calculations
Since the outer ring of our design is 8 in long, our axle will need to be a little longer so the maze can be supported on each side. We assumed 10 in for safety
We know from online specifications that the SG90 motor has a non-stall range of up to:
Which means we could have made this bigger and heavier (I will come back to this later!).
3. Electrical Engineering & Power Management
The Problem: SG90 micro-servos have a stall current that can spike up to 2.2A under friction or heavy centering loads. Standard laptop USB ports max out at 0.5A, which can cause immediate voltage drops and system brownouts if servos draw power directly from the board’s logic line.
The Solution: We isolated the power architecture





4. Code
Great, now we’ve fixed our design. But the servos still need commands from the Arduino, and the Arduino needs commands from our computer. Below is Mila’s Code in C++, made in Arduino IDE.
#include <Servo.h>Servo servoX; // D9 β X-axisServo servoY; // D10 β Y-axisconst int centerX = 90;const int centerY = 50;int x = centerX;int y = centerY;const int smallRot = -40;const int bigRot = -80;int stepDelay = 20; // Delay between degree steps (ms)// Smooth motion function for low angular velocityvoid smoothMove(Servo& servo, int& currentAngle, int targetAngle, int customDelay = stepDelay) { int step = (targetAngle > currentAngle) ? 1 : -1; for (int pos = currentAngle; pos != targetAngle; pos += step) { servo.write(pos); delay(customDelay); } servo.write(targetAngle); // Ensure final position currentAngle = targetAngle;}void resetPos(){ smoothMove(servoX, x, centerX, 40); smoothMove(servoY, y, centerY, 40);}void setup() { servoX.attach(9); //plugged into the arduino D9 pin servoY.attach(10); // plugged into the arduino D10 pin resetPos(); delay(2000); smoothMove(servoY, y, y + smallRot); delay(250); smoothMove(servoX, x, x + bigRot); smoothMove(servoY, y, y - (bigRot * 2)); delay(250); smoothMove(servoY, y, y + bigRot + smallRot); delay(250); resetPos(); smoothMove(servoX, x, x - smallRot); delay(500); smoothMove(servoY, y, y - bigRot - smallRot); delay(1000); smoothMove(servoY, y, y + (bigRot * 2)); resetPos(); smoothMove(servoY, y, y - bigRot - smallRot); delay(250); smoothMove(servoX, x, x - smallRot); //RIGHT DIRECTION? delay(500); smoothMove(servoX, x, x + bigRot); //RIGHT DIRECTION? delay(500); smoothMove(servoY, y, y + (bigRot * 2)); smoothMove(servoX, x, x + bigRot); delay(250); smoothMove(servoY, y, y - bigRot); delay(250); smoothMove(servoX, x, x - bigRot); smoothMove(servoY, y, y - (bigRot * 2)); resetPos(); while (true);}
5. Working Videos!!!
Plans for the future?

Current ideas for making the maze modular and 3D print it are on the table, and am working on the design as of now.
Here is an early CAD model of the design:
It will likely be made of PLA, as that is what the 3D printers on campus have an abundance of.
The largest 3D printer I have access to prints a max 12 in x 12 in x 12 in, and due to clearances of the inner element of the max tilting, the maze base would have to be 10 in x 10 in or smaller.
This makes the external walls 10 in x (1 in + chosen thickness) x 4 walls
The external maze walls as 8 in x (1 in + chosen thickness) x 4 walls
Then the internal walls that will be modular as (1 in – chosen thickness) x 1 in x 35 walls
It would also make r = 5 in
Reverse-engineering this and maxing out the range on the SG90 Servo Motors:
That isn’t going to work for us; therefore, the conversation about adding gear ratios to bridge this gap came up!
We can do our calculations again, and find:
Where N = our gear ratio.
Since I don’t need the walls to be more than 0.2 in in thickness, we can find our gear ratio as:
12:1 gear ratio would work, but to play it safe, a gear ratio more like 20:1 would be nice. But a 20:1 gear ratio isn’t easy to come by, so I will need to 3D print those gears as well, and plan to use composite gears to be able to miniaturize the design. This will also help account for any extra weight and design flaws.