How often did you want to sit on your chair and let somebody else bring you something or do the home chores? That mess in the conner of the room and Mom asking you to clean it up every day. Imagine a life when your favorite toy can do it for you and you are in total voice control. And why not have fun and get Santa in town.
miCube is a multitasking robot designed to do several tasks around the house. It can navigate around by following voice commands, pick up and deliver some objects, clean up a mess and more. It has a secret compartment for a special guest.
It is build using elements of the Lego Education EV3 kit and additional Lego Technic parts for the cube shape. Programming is done on the EV3 Brick with Python 3.
miCube uses two large motors, two medium motors, ultrasonic and colour sensors. Two large motors are used to drive miCube around. One medium motor used to open and close the front grabber mechanism. The grabber mechanism is used to grab and hold various objects, e.g. bottle of water. The second motor is used to open and close the doors for secret a compartment located at the top of the cube. The colour sensor is used to find locations marked with specific colours and the ultrasonic sensor is used for detecting the distance to obstacles.
For the purpose of this competition I have developed the code for three scenarios, however the limit is your imagination and time.
I hope you enjoy miCube and will improve it in the future.
MiCube VideoIn the demonstration video I have added the music from YouTube library, it is free to use. The music is not included in to the programming of the miCube. I feel it is more fun to watch the robot with the music.
Building stepsFollow the instructions attached to build miCube and additional elements.
Connect four motors using Mindstorms cables. Left-drive motor to Port B, right-drive motor to port C. Grabber motor to Port D, upper doors motor to Port A. Colour sensor connect to Port 1 and ultrasonic sensor to Port 2.
This project has three additional elements to support different scenarios.
- Platform (built out of Lego Technic elements) to keep different subjects for miCube to pick from. The robot can pick up items from the floor, however it does not have lift mechanism and will have to drag an object over the floor. When an object is located on a platform it will be carried over without touching the floor.
- Christmas santa sleigh (built out of Lego Technic elements) to keep presents - small objects wrapped in a nice paper.
- Santa- this one from under my Christmas tree and you probably have one as well.
Alexa registration and configuration.
Hackster did an excellent job and prepared a step by step guide and training material for Alexa registration. Link to Guide.
Program miCube1. Download the latest ev3dev image from the ev3dev website. I have experienced numerous challenges until downloaded the latest code.
2. Insert the micro SD card into the computer and flash the image to the card with a program Etcher.
3. Log in to the Alexa voice service developer console Link
4. Click Create Product and fill in the required fields. Select Alexa Gadget as the product type, and No for commercial release and intended for users under 13
5. Download attached code repository (model.json, miCube.pyand, Lambda folder,miCube.ini) files and open the folder containing them in visual studio code. Install ev3dev-browser extension from the execution menu.
6. Open VS Code and then open the location for downloaded files, install the ev3dev-browser extension from the extensions menu.
7. Use VSCode to Open miCube.ini, replace YOUR_GADGET_AMAZON_ID
and YOUR_GADGET_SECRET
with the ID and Secret generated in the Alexa Voice Service console.
8. Switch on the EV3 brick
9. Navigate to Wireless and Networks, select Bluetooth
10. Enable Powered option
11. The Bluetooth icon should be displayed in the top right corner. If it is not displayed- restart the brick.
12. Connect your brick to the computer using USB cable
13. At this point the brick should be ready.
14. Use VSCode code and with ev3dev browser window click "connect to a device", select your device in the drop down menu. The colour of the dot should change to green when your device is connected.
15. Upload the code to your EV3 brick by clicking on the down arrow on the right of the EV3 Device Browser Menu
16. After the code was uploaded, navigate to micube code, select it and press RUN
I have used mission 4 example code as a foundation and added additional commands to support my project.
Time to play with miCubeThere are three missions for the miCube.
Mission 1 - Bring Me My Drink
In this mission the miCube will find, grab and bring back my favorite drink. In this mission the miCube uses the colour sensor to detect which item to bring, the target item used the white strip. The white strip is also used to stop the miCube when it returns to the original position. I realised that the white strip at the start will confuse the robot, so I suggest to place the robot after the white strip. As an alternative change the starting strip colour to any other one that the sensor can detect and update the programming with the colour of your choice.
The goal is to find the bottle and bring it back to the starting point.
The following voice commands starts the mission:
1. Alexa, open mycube
2. Alexa, bring me my drink
3. Alexa response: command bring me my drink activated
4. Alexa response: My master, here is your drink
Mission 2 - Clean My Mess
In this mission the miCube will clean Lego blocks from the floor. The starting point is marked by a white strip. In this mission two sensors are used. Colour sensor to detect start and return points and ultrasonic sensor to detect the distance to the wall or cabinet door in the way and initiate the drive backwards command.
The goal is to push all the Lego blocks under the cabinet.
The following voice commands starts the mission:
1. Alexa, open mycube
2. Alexa Clean my mess
3. Alexa response: command clean my mess activated
4. Alexa response: I cleaned your mess and I am ready for the next task
Mission 3 - Find Santa
This is where the fun part begins.
Let's find Santa, He is in town! In this mission we will search for the Santa, using ultrasonic sensor. miCube will stop in front of the Santa's sleigh and start the dialog with Santa. Several actions will take place, miCube will take the present from the Santa and place it under the Christmas tree, then it will offer Santa milk and a cookie, but only after Santa shares the secret password.
At the end of the mission Alexa will say "Goodbye" to Santa and drive away.
The following voice commands starts the mission:
1. Alexa, open mycube
2. Alexa, find santa
3. Alexa ask: Hi santa. Do you have a present for me?
4. Me: Alexa take the present
5. Alexa response: What is your password
6. Santa: Password is Ho Ho Ho
7. Alexa response: Command password ho ho ho activated
8. Alexa response: Goodbye santa. see you next year
Hope you enjoy the ride with miCube today.
Comments