Joystick controlled labyrinth
Marko Kosonen, Olli Knuuttila, Oskar Björkgren
Project goal:
The goal of this project is to modify a traditional labyrinth marble game so that it can be
controlled with a joystick, instead of the turning wheels that are used in the base version of
the game. Motors will be used to turn the game base on its axis.
One additional feature we would like to add as well is a calibration function where the board resets to starting position, which can be achieved with data from an accelerometer.
The pre circus look of the project:
Side view without teeth belt
Side view with teeth belt attached, tape will be replaced with a 3D printed clamp
Arduino connections, set up so we can easily connect the stepper motors to this.
Under side view, here we can see how the two stepper motors are connected to the game board
The final state of the project:
The labyrinth is now controlled by the joystick and there is a calibration function, that levels the board using an accelometer.
The final look of the project with the breadboard inside the black box.
Closer picture of the box
Electrical Circuit
Picture of the circuitry connecting the project components. Including 2 Nema 17 stepper motors, 2 A4988 tepper motor drivers, Arduino Uno, ADXL335 accelerometer and connections for the power supply.
Demo videos
List of components used:
- Arduino Uno R3
- 2X Nema 17 stepper motors
- 2X A4988 Stepper motor drivers
- 24V 1.5A Power supply
- ADXL335 Accelometer
- Jumper cables
- 2x pulleys
- 5mm timing belt
- Labyrinth game
- 2x 3D printed clamps (link to design used: https://www.thingiverse.com/thing:627214)
The budget was 190€ that was sponsored by a group member.
The code used in the project:
Two additional Arduino libraries were used in the project code. The accelstepper library (https://www.airspayce.com/mikem/arduino/AccelStepper/classAccelStepper.html) is an improvement to the default Arduino stepper functionality.
It is a powerful library for controlling stepper motors, and it provided a good framework for our project. Two stepper objects are initiated, and are then controlled by calling specific target and motion functions to achieve the desired movement.
The accelstepper library has options to control motors with acceleration using run(), or with constant speed using the runspeed() function.
The second additional library is called ezButton(https://easybtn.earias.me/), which was used to add an interrupt function to the code that balanced the labyrinth platform.
Additional code with accelstepper acceleration enabled. This was not used in the final version, since it had significantly more control lag. Even though it provided more smooth motion.