When I first heard about the Alexa LEGO Mindstorms Voice Challenge the idea of coding, playing with toys, building things and having fun was very appealing! I decided to stay with the toys theme and build a voice enabled bobblehead display. The idea is that without any modification to any bobblehead you should be able to use Alexa to gently shake that bobblehead. Let the building begin!
I didn't have the full required LEGO Mindstorms EV3 kit, but was familiar with the older electronic Mindstorms kits and always thought they were neat. To keep costs low I found a used EV3 Mindstorms "Brick" and a large motor on ebay. I shopped locally and found two matching, inexpensive, Technic kits (model 42088 Cherry Picker truck) and a small assortment of old school LEGOs, just right for this project!
LEGO Design: Designing the Bobbler stand was more challenging than I thought it would be. My first design basically slid the stand forward and backward, attempting to "shake" the bobblehead. Problem: this sliding action was too smooth, not enough bobble! My next design worked better, the stand is essentially on an axis and the Mindstorms motor uses a cam action to tip the stand up and down, this results in more vigorous action and more bobble! The attached zip file bobbleheadBOMfilesAndInstructions.zip breaks the design into three sections...the Platform (shown below), the Gear Box and the Platform Bottom. For each section, there is a Bill of Materials (LEGOs required) and an .lxf file. The .lxf files can be imported into the free software LEGO Digital Designer so you can see the 3D image of the LEGOs, the count and type of pieces needed AND step by step build instructions.
Installing the software: This phase was also a bit longer than I expected, but thanks to great instructions, quite painless. The hackster.io Setup and Mission 1 through 4 are found here, and were more than enough to get up and running with LEGO Mindstorms and the Alexa Gadget toolkit. The biggest problem I ran into was flashing the software onto a microchip, the update process took a looong time (think hours) and had to be restarted over and over before finally completing. I understand the process has recently been improved significantly because the Alexa Gadgets Toolkit is now incorporated into the latest ev3dev image. That brings up another nice feature of this project, the discussion boards can come in very handy.
Creating your own version of this project: the following are steps you can use to create your own variation of the Bobblehead Bobbler. You'll likely want to make slight variations based on the size and weight of your bobblehead. You may need to expand or shrink the stand, increase or decrease the speed of the motor, or change the length of time the motor runs. Hopefully you'll have enough info for this and even to add your own new features.
- Parts required: LEGO Mindstorms EV3 Intelligent Brick, Mindstorms Large Motor (and cord), Mindstorms touch sensor (and cord), microSD or microSDHC card (2GB to 32GB), chip adapter for your computer, a USB wireless adapter (I used a TP-Link Nano adapter), 6 AA batteries (ideally rechargeable) and the LEGOs and Technics listed in the design files mentioned above.
- Start by installing LEGO Digital Designer and building the LEGO portion of Bobblehead Bobbler using the attached .lxf designs files.
- Next follow the hackster.io LEGO Voice Challenge setup instructions to get the Alexa toolkit enabled on your EV3 brick. One nice thing about this process is the software is all located on your microSD chip so there's no risk of accidentally flashing bad or broken software on the Mindstorms brick itself.
- In the setup section you downloaded a file named alexa-gadgets-mindstorms-2019.nnn....zip. For the Bobblehead Bobbler you'll need to use the attached version of this file named alexa-bobblehead.zip. Unzip this software and use Visual Studio Code to copy it over to the Mindstorms brick. The process is the same as described in Mission 1 except my project folder is named mission-07 and the files are mission-07.ini and mission-07.py If you are familiar with the Mission code this file is similar but smaller. For this project I did not want to leave an Alexa session active for a long period of time. Instead the Alexa skill will simply launch a request each time we want to shake the bobblehead. One interesting point is that the Mindstorm software not only listens for the Alexa command, but has a thread running listening for a touch sensor. I modified the Proximity sensor thread for this purpose since I found the touch sensor useful for positioning the motor cam to the best initial position. Additionally if you have a motion sensor it might be fun to modify things to bobble when someone walks by.
- Next upload the software for the Alexa Skill to your Alexa Developer console, as described in Mission 3. This main file is called index.js and is very similar to the Mission skill code, Note the comments at the top of the file, here you can customize the speed, duration and direction you want your motor to spin. Also of note is this skill occasionally and randomly plays a phrase or sound effect when the bobble action occurs. This is done just for variety's sake, but again you can easily customize what (if anything) is played.
Let's See the Bobblehead Bobbler in action:
Start the Bobblehead Bobbler by saying "Alexa, open Bobble head". Here is the video:
Here's video of the touch sensor being used to fine-tune the position of the motor and cam. Note the touch sensor is to be plugged in to port 1 of the EV3 Brick and the motor is plugged in to port C.
Wrap Up
Thanks for checking out this Alexa LEGO Mindstorms Voice challenge project. I enjoyed learning while playing and encourage you to try this out as i think you will too!
Comments