Updating the Firmware

Hackerbot contains four microcontrollers responsible for essential real-time control tasks—such as SLAM base locomotion, expressive audio-visual output on the head, and precise control of the arm and


Hackerbot contains four microcontrollers responsible for essential real-time control tasks—such as SLAM base locomotion, expressive audio-visual output on the head, and precise control of the arm and gripper mechanisms.

All of the microcontrollers used are identical Adafruit QT PY SAMD21 Arduino boards (Adafruit QT Py - SAMD21 Dev Board with STEMMA QT).

In order to program updated firmware versions you will need:

  • USB-C Data cable

On your computer you will need:

  • Hackerbot Firmware Files

  • Arduino IDE

  • Required Libraries

  • SerialCmd Library Modification

The first section below describes how to set up the programming software on your computer and then the following four sections after that describe how to update the firmware on each of the four microcontrollers. The final section describes how to update the firmware for the eyes on the Hackerbot Head.


Arduino IDE, Board, Library, and Library Modification Setup

🔹 Step 1 – Install Arduino IDE

Download and install the latest version of the Arduino IDE (v2.3.4) for your operating system. During installation, make sure to include all drivers when prompted.

Arduino IDE Download Page

🔹 Step 2 – Add Adafruit Board Support

  1. Open the Arduino IDE.

  2. Go to Settings (via the gear icon or File > Preferences).

  3. In the Additional Board Manager URLs field, paste the following URL:

https://adafruit.github.io/arduino-board-index/package_adafruit_index.json

🔹 Step 3 – Install Adafruit SAMD Boards

  1. Click the Boards Manager icon (second icon on the left panel).

  2. In the search/filter box, type: adafruit

  3. Install the package: Adafruit SAMD Boards by Adafruit

🔹 Step 4 – Install Required Libraries

Click the Libraries icon (third icon down on the left panel) and search for and install each of the following libraries:

  • Adafruit Arcada Library by Adafruit (Install all dependencies when prompted)

  • STM32duino VL53L7CX

  • SerialCmd by Guglielmo Braguglia

  • Dynamixel2Arduino by ROBOTIS

🔹 Step 5 – Modify SerialCmd and RingBuffer Libraries

Due to Hackerbot’s command processing requirements, you’ll need to modify some internal constants in the libraries:

🛠️ Modify SerialCmd.h

Navigate to the following directory based on your OS:

  • Windows: C:\Users\<username>\Documents\Arduino\libraries\SerialCmd\src\

  • macOS: /Users/<username>/Documents/Arduino/libraries/SerialCmd/src/

  • Linux: /home/<username>/Arduino/libraries/SerialCmd/src/

Edit SerialCmd.h and update lines 80–82 to:

#define SERIALCMD_MAXCMDNUM  60                    // Max Number of Command
#define SERIALCMD_MAXCMDLNG  32                    // Max Command Length
#define SERIALCMD_MAXBUFFER  128                   // Max Buffer  Length

🛠️ Modify RingBuffer.h

Navigate to the core Arduino files directory:

  • Windows: C:\Users<username>\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\cores\arduino\

  • macOS: /Users/<username>/Library/Arduino15/packages/adafruit/hardware/samd/1.7.10/cores/arduino/

  • Linux: /home/<username>/.arduino15/packages/adafruit/hardware/samd/1.7.10/cores/arduino/

Edit RingBuffer.h and update line 32:

#define SERIAL_BUFFER_SIZE 1024

Your development environment is now fully configured. You can proceed to the next sections to upload firmware to each microcontroller.


Firmware Upload Instructions

Each Hackerbot unit contains up to four microcontrollers, depending on the model (Lite, AI, AI Pro, AI Elite). The following sections describe how to upload firmware to each controller.

⚠️ IMPORTANT: Always disconnect power before plugging in your USB-C cable. Be extremely careful with USB and power cable polarity to avoid damaging the hardware.


🧠 Main Controller Firmware

Present on: All models (Lite, AI, AI Pro, AI Elite)

Steps:

  1. Power Down

    1. Unplug the battery from the Main Controller.

    2. Hold the power button on the SLAM base for ~7 seconds until the robot says “Goodbye.”

  2. [AI Pro & AI Elite Only] Disconnect Head

    1. Unplug the head's USB Audio and Camera connections from the Raspberry Pi 5.

    2. Remove the 4 head-mounting screws using a PH2 screwdriver.

    3. Gently place the head in front of the robot.

Using a PH2 philips head screw driver, remove the four screws securing the head to the base and very carefully place the head in front of the robot

  1. Connect USB-C

    1. AI models: Unplug the right-angle USB-C between the RPi5 and Main Controller.

    2. Lite model: You may need to remove the battery to access the USB-C port.

    3. Carefully connect your USB-C data cable from your computer to the Main Controller.

Be VERY careful not to break off these posts!
Disconnect the USB-C cable from the right angle connector

Connect your USB-C programming cable from your computer to the Main Controller. On the Lite model you may need to remove the battery. On all other models, plug into the right angle connector.

Connect your USB-C Data cable between the right angle connector and your computer
  1. Get Firmware

    1. Download or clone the latest main controller firmware from the Hackerbot GitHub repo.

  1. Upload in Arduino IDE

    1. Open main_controller.ino

    2. Select "Adafruit QT Py M0" in the board dropdown.

    3. Ensure the USB cable is fully inserted and data-capable.

    4. Click the Upload icon (right-pointing arrow).

Upload Icon
  1. Reassemble

    1. Unplug the USB-C cable.

    2. Reconnect the RPi to Main Board USB-C cable

    3. Reconnect head components (if applicable).

      1. Place the head back on the mount (make sure the I2C/power cable runs out the back)

      2. Screw down the head using the 4 screws and your PH2 screwdriver

      3. Plug the USB to Audio and Camera USB plugs back into the RPi

    4. Plug the power cable back in — double-check polarity.


🤖 Dynamixel Controller Firmware (Head)

Present on: AI Pro, AI Elite

Steps:

  1. Power Down

    1. Unplug the battery from the extension cable.

    2. Turn off the SLAM base (hold power ~7 sec).

  2. Connect USB-C

  • Connect your USB-C data cable to the top USB-C port on the Hackerbot Head.

  1. Get Firmware

    1. Download or clone dynamixel_controller.ino from the repo.

  1. Upload in Arduino IDE

    1. Open the file and select "Adafruit QT Py M0" as the board.

    2. Click the Upload icon.

Upload Icon
  1. Finish

    1. Unplug the USB-C cable.

    2. Reconnect power — check polarity carefully.


🎤 Audio / Mouth / Eyes Firmware (Head)

Present on: AI Pro, AI Elite

Steps:

  1. Power Down

    • Unplug battery and shut down the SLAM base.

  2. Connect USB-C

    • Plug your USB-C cable into the bottom USB-C port on the Hackerbot Head.

  1. Get Firmware

    1. Download or clone audio_mouth_eyes.ino from the repo.

  1. Upload in Arduino IDE

    1. Open the file, select "Adafruit QT Py M0", and click Upload.

Upload Icon
  1. Finish

    1. Unplug the USB-C cable.

    2. Reconnect power — verify polarity.


🦾 Arm Controller Firmware

Present on: AI Elite only

Steps:

  1. Power Down

    1. Unplug the battery extension cable.

    2. Power off the SLAM base.

  2. Connect USB-C

    • Connect your USB-C data cable to the back of the arm base.

  1. Get Firmware

    1. Download or clone arm_controller.ino from the repo.

  1. Upload in Arduino IDE

    1. Open the file, select "Adafruit QT Py M0", and click Upload

Upload Icon
  1. Finish

    1. Unplug USB-C.

    2. Reconnect power — check polarity.


👀 Eyes Firmware

📌 Coming Soon Expanded instructions for programming the Eyes controller will be added shortly.

In the meantime, refer to the Eyes Programming Guide in the Eye Firmware repository.

Last updated