I have been recently contacted about a very interesting project that I thought to share with you today. Students from Anderson University in Indiana have been working on open-source software to interact with LEGO Powered Up elements via Twitch chat using a Raspberry Pi.
The project was inspired by a question on Bricks Stack Exchange asking about the ability for multiple users to control a single LEGO train. If you have been working with the LEGO Powered Up elements, you know this is not possible out-of-the-box; however, there are some creative ways to work around this.
The solution the students came up with is similar in concept to the classic Twitch Plays Pokemon (link to video demo). A LEGO model is streamed via Twitch.tv, and viewers are able to control it by sending commands over Twitch chat.
To break this down, LEGO Powered Up hubs are paired with a host device (Raspberry Pi) via Bluetooth. The host device monitors a Twitch chat room for commands and uses those commands to control LEGO elements connected to the hubs. The host device also streams a webcam via Twitch showing the live state of the LEGO model.
The Twitch Powered Up software has been designed and tested to run on a Raspberry Pi 4, but it should be able to run on most devices that support Bluetooth Low Energy. The software has been tested on the following components: #88006 LEGO Powered Up Move Hub, #88009 LEGO Powered Up Hub, #45303 LEGO Powered Up Simple Medium Linear Motor, #88005 LEGO Powered Up Lights, and #88011 LEGO Powered Up Train Motor. The software should also be compatible with any other device supported by node-poweredup.
The creators of the software hope that it will benefit the LEGO fan community. It could be especially beneficial to LEGO User Groups that cannot hold physical events under the current circumstances related to COVID-19. Instead, they could run some fun interactive virtual activities within their communities using the Twitch Powered Up software.
The Twitch Powered Up software is presented today in a live demo from 9 AM to 5 PM EST. If you’re interested, the project is hosted on Github at this link: Github.com/JNCraton/Twitch-Powered-Up. And the live demo is running on Twitch here: Twitch.TV/TwitchPoweredUp.
Also, as this project is open-source, contributions are welcome. If you have suggestions for features, improvements, or bug fixes, you can suggest them at Github as well. And of course, you can also share your thoughts and discuss the project in the comment section below.