Skip to content

albertaloop/Mechatronics-Showdown-2026

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AlbertaLoop Mechatronics Showdown 2026

AlbertaLoop Logo

Thank you for participating in the AlbertaLoop Mechatronics Showdown 2026.

This repository contains helpful code and resources to get you started.

Good luck, and have fun building!

Quick Start

If you just want to get the robot moving quickly:

  1. Install the Arduino IDE.
  2. Connect the Arduino board to your computer.
  3. Open the code in AMS 2026 Starter Code.
  4. Select the correct board (Arduino Mega 2560) and port in the Arduino IDE.
  5. Upload the code to the Arduino.
  6. Wire the robot according to the schematic in Figure 1.
  7. Power the robot and test the joystick controls.

If everything is wired correctly, the joystick should control the robot's movement.

General Advice: For each peripheral you decide to use, it is recommended that you first read the documentation and understand how it works before integrating it into your robot. Most libraries include example code that you can use to test the peripheral individually before adding it to your main robot program.

ELEGOO Starter Kit

You have been provided with an ELEGOO Starter Kit. Please refer to ELEGOO_starter_kit.pdf, which contains basic lessons for each component included in the kit.

Some helpful lessons include:

  • Lesson 0: Installing the IDE
  • Lesson 1: Adding Libraries and Opening the Serial Monitor
  • Lesson 2: Blink an LED
  • Lesson 4: RGB LED - introduces PWM
  • Lesson 5: Digital Inputs - will be needed for interfacing the controller
  • Lesson 9: Servo
  • Lesson 10: Ultrasonic Sensor
  • Lesson 16: GY-521 Module
    • Note: Some kits may include the MPU6050 instead of the GY-521. In that case, you will need to use the MPU6050 library instead.
  • Lesson 13: Analog Joystick Module

We have also provided L298N motor drivers for controlling the DC motors. These are not part of the ELEGOO Starter Kit but are included in your competition kit. If you are unfamiliar with this module, the following tutorial is a helpful resource: L298N Motor Driver Tutorial. The starter code in this repository already implements basic motor control using the L298N driver.

You may also find the following resources helpful for understanding and implementing PID control for the balance beam challenge:

The starter code reads input from the joystick on the controller and converts it into motion commands for the robot’s four DC motors. The vertical axis of the joystick controls forward and backward motion, while the horizontal axis controls turning left or right. Based on the joystick position, the code sets the direction of each motor using the motor driver control pins and adjusts motor speed using PWM signals sent to the enable pins. When the joystick is centered, all motors stop. The code also includes a small deadzone to prevent unintended movement when the joystick is near the center, and it limits motor speeds so they remain within the valid PWM range. Overall, this provides a simple differential-drive control scheme that allows the robot to move forward, backward, and turn in place using the controller.

Starter Code Schematic

Starter code schematic
Figure 1: Starter code schematic

Troubleshooting & Help

The motors must be powered using the external battery pack through the L298N motor driver.
Do not power the motors directly from the Arduino 5V pin, as this can damage the board.

Robot moves in the wrong direction

  • Swap the HIGH/LOW direction pins for that motor in the code, or swap the motor wires on the motor driver.

Robot does not move

  • Check that the motor driver is powered.
  • Verify that the enable pins are connected (these can be connected directly to 5V if you do not need to control motor speed).
  • Ensure the Arduino is powered through USB, or an external 9V battery, or the VIN pin from the L298N motor driver.
  • Check that all grounds are connected together (this is often overlooked).

Debugging Tips

  • Use Serial.print() to monitor sensor values while testing.
  • Test each component (motor, sensor, servo, etc.) individually before integrating it.

About

Repository created for Albertaloop Mechatronics Showdown 2026

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages