vindar
Well-known member
Hi everyone,
Here is a project I have been working on and off since covid, which I finally found some time to complete this summer... So I proudly present:
S.A.R.C.A.S.M : a Slightly Annoying Rubik's Cube Automatic Solving Robot.
Here is a short video in action:
My goal was to create a "desk toy" I can play with when I get bored at work...
Its main features are:
Currently, there are over 900 dialogs and 100 songs loaded in (thanks to ChatGPT for helping create the dialogs!), so using it still feels fresh every time. I am quite pleased with the result (and my kids love to play with it).
From a technical pov, I think this project really showcases the power of the Teensy 4.1. In particular, here, the T4.1 performs
On the hardware side, I created a custom PCB and a 3D printed enclosure (it's a tight fit!). On the software side, this means using many peripherals simultaneously: 2× SPI, 2× Serial, 1× I2C, 1× I2S, SDIO, 2× ADCs, many GPIOs... several interrupts/hardware timers/DMA channels, multithreading... and a lot of memory (980KB RAM, 3 MB of EXTRAM, 7.7 MB FLASH and 400 MB on the SD card). I always like to use Teensies for my project but, for once, using a T4.1 does not feel overkill
Here are a few more photos from its inside (a bit outdated: cable routing was improved and the usb data line is now properly shielded).
I will try to provide technical details on the build and the code in another post.
I may also make the github repo public at some point but it is currently too messy...
Cheers,
Arvind
Here is a project I have been working on and off since covid, which I finally found some time to complete this summer... So I proudly present:
S.A.R.C.A.S.M : a Slightly Annoying Rubik's Cube Automatic Solving Robot.
Here is a short video in action:
My goal was to create a "desk toy" I can play with when I get bored at work...
Its main features are:
- Compact: it does not take much desk space.
- Autonomous: battery powered with USB-C charging port (also used for flashing code), no internet or external computer required.
- Near instant power on/off: this ruled out using an rPi Zero for the mainboard...
- Compatible with any standard Rubik’s Cubes: no alteration of the cube is required (it works with hard-to-turn cubes, non-standard sticker colors...).
- Robust: it can withstand children mishandling the machine (e.g. interfering with the motors, misplacing the cube...) without risk of damage.
- Fun, perfectly useless, and completely over-engineered: many unnecessary gimmicks (rgb lights, audio, 3D graphics...). Well, as you can guess from the design, I am a Portal fan.
Currently, there are over 900 dialogs and 100 songs loaded in (thanks to ChatGPT for helping create the dialogs!), so using it still feels fresh every time. I am quite pleased with the result (and my kids love to play with it).
From a technical pov, I think this project really showcases the power of the Teensy 4.1. In particular, here, the T4.1 performs
- JPEG decoding and color analysis from cube images (taken by an ESPCAM camera).
- Running the cube-solving algorithm (using my port of Kociemba's algorithm)
- Driving the display with real-time 2D/3D graphics (using my graphics library TGX and my display driver library ILI9341_T4).
- Running real-time audio speech synthesis (using my port of the espeak-ng library for T4).
- Driving the audio chip via I2S (using PJRC's Audio lib).
- Driving 2x servos and 1x stepper motor using custom drivers with precise real-time feedback monitoring.
- Driving the RGBW led strip (using the OctoWS2811 library).
On the hardware side, I created a custom PCB and a 3D printed enclosure (it's a tight fit!). On the software side, this means using many peripherals simultaneously: 2× SPI, 2× Serial, 1× I2C, 1× I2S, SDIO, 2× ADCs, many GPIOs... several interrupts/hardware timers/DMA channels, multithreading... and a lot of memory (980KB RAM, 3 MB of EXTRAM, 7.7 MB FLASH and 400 MB on the SD card). I always like to use Teensies for my project but, for once, using a T4.1 does not feel overkill
Here are a few more photos from its inside (a bit outdated: cable routing was improved and the usb data line is now properly shielded).
I will try to provide technical details on the build and the code in another post.
I may also make the github repo public at some point but it is currently too messy...
Cheers,
Arvind