Adding voice commands to a LEGO planetarium set with an Arduino Nano 33 IoT
From Mindstorms to Technic, LEGO has produced a wide variety of sets that give users new learning and creative experiences, and for Electromaker’s Robin Mitchell, this was the LEGO planetarium set. With it, rotational input will cause the Earth and moon models to orbit around the sun while maintaining realistic positions and even accurate axial tilt. Interested in taking things a step further, Mitchell sought to motorize the entire display and give it an IoT integration for voice control.
After assembling the set, Mitchell found that three rotations of the drive shaft would advance the model’s time by one day, meaning that a NEMA 17 motor could be easily connected and turned with precision. As for the electronics, he opted for an Arduino Nano 33 IoT, an A4988 stepper motor driver module, and a 16×2 character LCD to show the current network connection status. Thanks to the Nano’s Wi-Fi connectivity, the model can automatically sync to the current time and move accordingly upon boot.
The last feature of this motorized planetarium set is the voice control aspect, which was made possible through a combination of a simple web app and a web server hosted on the Nano. When a user connects with their browser, they are able to provide instructions for advancing time in a unit such as days, weeks, or months via the JavaScript SpeechRecognition module. Then, once the Nano receives these values, it commands the stepper to rotate for the equivalent number of steps.
To see more about how Mitchell built this LEGO planetarium project, watch his Electromaker video below!