mBot Mastery

Contributed By: Tri Ngo &          Jacob Lingley

Questions? 

Click here for a forum post that is associated with this classroom project. I would be happy to help you out with any questions you or your students may have. 

Inspired by Nature? So are we. 

The story behind this little nightlight is as heartwarming as the warm glow it provides. It began with the addition of a talented new member to the Brilliant Labs team. Mary Webber is our Artist in Residence. She is used to working with a number of materials, however really enjoys using felt to express her creative ideas. Fast forward to New York Maker Faire 2018, we were completely enamoured with Jackie Huang's booth of his expertly crafted and ultra adorable Woolbuddies. If you haven't seen his work, you should definitely check it out here, and maybe even pick up a copy of his recently released book

Knowing Mary's talent for roving wool, and our proclivity to add a dimension of electronic expression to traditional materials, we asked if she could design a "fanciful figure" inspired by the local New Brunswick landscape that incorporated felt, code, habitats and of course creativity. What appears in the video above is an expert conceptualization of this goal. We love how the boundaries between each discipline fade away and you are left with such a cute and functional art piece. 

What's more is that this nature inspired, electronically enabled, soft material is very easy to put together. Like many maker projects, it will take time, but it is so rewarding when you are able to bask in the ambient glow of your nightlight. 

 
Materials List

When possible, it is always best to source local wool for your roving projects.

3501_top_lit_demo_ORIG.jpg
Gemma M0
from adafruit.com
($97.42 CAD)
1463-00.jpg
16 x Neopixel Ring 
from adafruit.com
($94.99 USD)
window-163.jpg
Slide Switch 
from adafruit.com 
($94.99 USD)
14299-02.jpg
2 x AA Battery Holder
from adafruit.com
($94.99 USD)
ID641_v2_1024x1024.jpg
3 Ply Conductive Thread
from adafruit.com 
($94.99 USD)
615-03.jpg
Needles from 
adafruit.com 
($94.99 USD)
400x268.jpg
Felting Sponge
from amazon.ca
($94.99 USD)
81YH+J+yTUL._SL1500_.jpg
Felting Needle
from amazon.ca
($94.99 USD)
61hWeLC0SUL._SL1000_.jpg
Roving Wool 
from amazon.ca 
($94.99 USD)
Project Title Goes Here

Felt + Code = Mushroom Nightlight

It's amazing to watch these raw materials turn into a finished product. We have listed all of our product sources on the right sidebar, but you can feel free to use this as an idea and curate your own materials. 

Let's #MakeSomethingBrilliant
 
mBot Setup
Materials
  1. Adafruit Gemma M0

  2. Neopixel Ring (we used the one with 16 neopixels)

  3. Slide Swtich

  4. AA Battery Pack 

  5. Conductive Thread

  6. Needles

  7. Scissors

  8. Tape

  9. Felting Sponge (for a cheaper alternative a car wash sponge works well too)

  10. Regular Cleaning Sponge

  11. Felting Needles

  12. Selection of Roving Wool Felt (we chose colours that best reflected the NB landscape)

  13. Small Terracotta Planter

Some General Assembly Guidelines
  1. Adafruit Gemma M0

  2. Neopixel Ring (we used the one with 16 neopixels)

  3. Slide Swtich

  4. AA Battery Pack 

  5. Conductive Thread

  6. Needles

  7. Scissors

  8. Tape

  9. Felting Sponge (for a cheaper alternative a car wash sponge works well too)

  10. Regular Cleaning Sponge

  11. Felting Needles

  12. Selection of Roving Wool Felt (we chose colours that best reflected the NB landscape)

  13. Small Terracotta Planter

The setup instructions below have been written with the New Brunswick teacher in mind. Their latest teacher laptops run Windows 10, and therefore we have designed these step-by-step instructions with that operating system in mind. These mBots however have been designed to run on other versions of Windows and Mac OS X. If you are planning on connecting via iOS, please scroll down. 

For manufacture instructions, please click here. 

 

Computer Software Installation

Click the appropriate link above to download the appropriate version of mBlock software for your operating system. If your system requires administration credentials to instal software, you will have to submit a "help-desk" request with your system administrator. 

Driver Installation

If your technician is visiting you to install the software, we highly encourage you to have them install the associated arduino driverThis will allow your students to use the USB cable to send programs directly to their mBots without depending on bluetooth connection. 

To install the driver, launch your newly installed version of mBlock, click Connect --> Install Arduino Driver. If you run into issues, please consult the instructions found here

How to Connect Your PC to Your mBot ​(Bluetooth Version)

1. Open mBlock, and click Connect --> Bluetooth --> Discover.

2. The first time you attempt to connect to your mBot, Windows 10 may provide a pop-up as follows. Simply click YES and the pairing process will begin. 

3. If you have more than one mBot with a bluetooth connection, you will see the following. Each bluetooth module on your mBot has a unique identification number. This number can be found on the underside of your bluetooth module, or in your bluetooth settings on your computer. Once you identify your specific mBot, we encourage you to label your mBot. 

4. After you have selected to connect to your desired bluetooth enabled mBot, you can verify the connection either by clicking on Connect --> Bluetooth --> and there will be a checkmark next to the correct Makeblock (ID NUMBER) or clicking on the green ROBOTS category where you will see a green dot (rather than a red dot) confirming the mBot connection. 

How to Connect Your PC to Your mBot ​(2.4 GHz Module)

This is the mBot model with a separate grey USB dongle. 

*We have just discovered that there is an issue with the 2.4GHz module connecting with PCs using Windows 10. We are working on a solution, however if this problem persists, we recommend replacing your 2.4 GHz module with a bluetooth module, available for purchase here.*

(mBot 2.4 GHz Module)

  1. Begin the connection process with your mBot off, and the USB dongle NOT connected.

  2. Power-on the mBot.

  3. Press the small grey button on the 2.4 GHz module. This will change the rate at which the on-board LED is blinking.

  4. Insert the USB Dongle. This will cause the on-board LED to stop blinking.

  5.  Open mBlock, and navigate to Connect --> 2.4 G Serial --> Connect. When a successful connection occurs, the green dot will appear under the robots category. 

* Please note that the USB dongles are not specific to the mBots. However, it may be easier to label both the dongle and the corresponding mBot. If the dongles and mBots do become mixed-up, repeat the process above to reconfigure the dongle to the mBot. 

 

Mobile Programming with iOS mBot Compatible Apps

Makeblock has two compatible iOS apps that you can use to program your mBots. They are very simple to use. Please follow this link to learn more. 

How to Code your mBot

We are excited to see what you and your students will come up with for mBot programs. The following examples are only provided as introductory resource to get you started. 

Basic Programming Example: Follow the on-screen block placement to create a program that will allow you to control your mBot with your keyboard. It's very important for you to use both "when key pressed" as well as "when key released" or else your mBot may run straight into a wall (which isn't the worst that can happen). 

This basic program will likely only keep you and your students satisfied for so long. Sure, it is fun to use this program to create your own mBot soccer game, or to introduce your friendly robot friend to your neighbouring classroom, however it would be much better if your program included some conditional control statements. In the two examples below, your students will learn about branching (a sequential set of actions) and looping (deciding how many times an action will take place). 

More Advanced Robot GoalmBot runs forwards, then stops at a fixed distance from an obstacle. When obstacle is removed, mBot continues to run forward. 

1. In mBlock, connect to your mBot. 

2. Click on the category "Data & Blocks"

3. Click on "Make a Variable"

4. Name that variable "Distance" for all sprites. Click OK.

5. Now create your block of code, beginning with the event "When Flag Clicked"

6. Drag over the corresponding blocks as shown in the image below, on the left.

 

 

It's important to note that the units used by the ultrasonic distance sensor are centimetres. Go ahead and try your code to see what happens. By using the conditional statement "if/else" the robot should run forward until it is less than (or equal) to 10 cm away from the obstacle. Unfortunately, because of this code, it will not continue to run forward when the obstacle is removed... hrmmm... did we talk about looping yet? 

7. Drag over the "repeat until" block found under controls. 

8. Drag the "key pressed" block found in sensing into the modifier in "repeat until" block. 

9. Create the program found in the image below,  on the right. 

If done correctly, your robot should now interact with your environment as your goal intended. 

Now what about the other sensor: The Line-Following Sensor?

As you have likely noticed, the mBot comes packaged with two input sensors: one to sense distance, and the other to sense contrast between a light and dark surface (line-following). The mBot comes with a paper track that you can use out of the box, but we have had great success with simply using  sharpie, or even the contrast between the top of a table and the floor below (use a safety net for your poor mBot). 

There is quite a bit of science happening in order for the mBot to follow contrast variation. As the photo below demonstrates, the line-following sensor contains an infrared emitting LED as well as a infrared sensing LED. When the light energy from the emitting LED reflects off of a surface, information about the reflective properties of the surface is transmitted back to the mBot. As grade 8 optics has taught us, the lighter colour the surface, the more light is reflected in comparison to the amount of light that is reflected from a dark coloured surface. 

Let's get that mBot following a line! 

You are likely looking for your mBot to do something like the image below suggests: 

mBot moves forward as it is sensing black, or limited reflected light. 

mBot turns left as the left LED only, senses black, or limited reflected light. 

mBot turns left as the right LED only, senses black, or limited reflected light. 

In order to get this to happen, we will need to write the following code. 

1. Turn on your mBot and connect as you have done before. 

2. Click on the category "Data & Blocks"

3. Make a block named "Move" 

4. Make the following variables for this sprite: "Speed" and "Line Sensor Value"

5. Create the following program. 

Classroom Considerations
 

We hope you enjoy using your mBots with your students as much as we do. In addition to the above tutorials, we have had success with issuing simple challenges to students. Don't worry about creating challenges that you don't even understand how to code, they will collaborate with one another to reach the goal. Here are some of our favourites: (1) By pushing one key only, have your mBot navigate around an obstacle in a circle; (2) By pushing one key only, have your mBot run forward, stop, turn around, and come back to the starting position; (3) Have your mBot create the perimeter of different polygons. 

We can't wait to hear about all of your coding success! Thanks for reading. 

support:

We are here to help with your planning and evaluation.  Let us know if you have any questions. Plus, we'd  like to share your project work so please keep us updated. 

Tri Ngo & Jacob Lingley

Tri is the Engineer in Residence at Brilliant Labs and a mechatronics genius. We are very grateful to have Tri assist students and teachers throughout Atlantic Canada in all of our brilliant projects. 

Jacob is a self-proclaimed geek and the New Brunswick Program Director for Brilliant Labs. A long time middle-level mathematics teacher, Jacob travels throughout Atlantic Canada hoping to inspire the geeks of tomorrow with tales from 3D Printers to interactive clothing. Joined Brilliant Labs in 2015.

  • Facebook Social Icon
  • Twitter Social Icon
  • YouTube Social  Icon

© 2019. Créé par Labos Créatifs