1 of 13

Training

2 of 13

Agenda

3 of 13

What do we need to play �with mBots ?

  • mBot hardware
  • Makeblock software
  • Arduino ide software
  • Batteries (a lot!)
  • …and space !

4 of 13

mBot hardware

  • Arduino board
  • 2 motors
  • 2 RGB LED’s
  • 1 buzzer
  • Light sensor
  • Distance sensor
  • Line sensor
  • IR sensor + remote control
  • 1 button
  • Wifi or BT module

5 of 13

Assembly

6 of 13

Assembly

  • Count 15 – 30 minutes par mBot
  • Could be done by kids under supervision
  • Final result should be reviewed tested by coach
  • Wrong assembly
    • Could cause bugs difficult to trace
    • Could damage the boards or its components
    • Could cause fire (in case of short circuits)
  • See “mBot instruction.pdf”

7 of 13

Software installation

  • Install MakeBlock
    • MakeBlock 5 is not (yet) compatible with wifi dongle
    • https://www.mblock.cc/en-us/download/
  • Install Arduino ide
    • You can program mBot using C and Arduino
    • https://www.arduino.cc/en/main/software

8 of 13

First connection

  • Start MakeBlock
  • Place batteries in mBot and turn it on
  • Connect with USB cable
  • In MakeBlock select Board > mBot(core)
  • In MakeBlock select Connect > Serial port (choose the port)
    • If it does not work, unplug USB cable and load Arduino driver (in MakeBlock select Connect > Install Arduino) and restart the computer
  • You should be able to control the mBot using one of the robot block
    • If it does not work, reload mBot (in MakeBlock select Connect > reload default program) and switch off/unplug/plug/restart the Mbot
  • See “getting started with mblock”

9 of 13

mBot : mode of operation

  • Demo mode (only available with default program) – activated by pressing button
    • Obstacle avoidance
    • Line follower
    • Remote controlled
  • Interactive mode
    • mBot is waiting for command coming from Makeblock
    • When command is received it is immediately performed by mBot
  • Stand-alone mode
    • The default program was replaced by another program
    • It can happen from Makeblock using “Arduino mode”
      • In MakeBlock select Edit > Arduino
    • Requires to use the “Arduino” block to identify what code needs to be uploaded on mBot
    • Requires the Arduino IDE
  • See “getting started with mblock”

10 of 13

MBot Arduino Mode

Arduino Mode

“Online” mode

Edit -> Arduino mode

Connect -> Reset Default Program

11 of 13

Arduino and mBots blocks

  • Arduino blocks to have direct access to Arduino board
    • Set / Unset a pin (
    • Read a pin
    • Output a PWM signal
    • Control a servo
  • mBot blocks allow to directly use motors and sensors
    • Determine speed of each motor
    • Turn leds on/off
    • Play sounds on buzzer
    • Read values from sensors (light, distance, IR, button)

12 of 13

Your turn…

  • Mbot1_brandweerwagen.pdf
    • licht + sirena
    • automatische stofzuiger
    • line follower
  •  Winnen.pdf
    • use button
  •  mbot3 – parkeren.pdf (difficult)
    • Use sensors and 2d motions in space

13 of 13

References