The Mbots should be equipped with two sonar sensors. The current activity assumes that the left sensor is connected to port 1 and the right sensor is connected to port 2. The left motor should be connected to M1 and the right motor to M2.
<aside> ⚠️ The left sonar sensor should be connected to port 1 The right sonar sensor should be connected to port 2 The left motor should be connected to M1 The right motor should be connected to M2
</aside>
The sonar sensors can be mounted in various ways. In the picture, I have attached the sensors to L-shaped 3D-printed brackets. The brackets are connected to the robot using Velcro (see detailed picture). This arrangement allows for easy re-positioning of the sensors on the robot, as is required for this activity.
The 3D models of the mounting brackets can be found on Thingiverse:
Thingiverse - Digital Designs for Physical Objects
View of the Mbot robot, equipped with two sonar sensors. The sensors are mounted on the robot using a 3D-printed L-shaped bracket and velcro. This arrangement allows reorienting of the sensors.
Detail of the velcro used to keep the 3d printed bracket in place.
A robot arena can be easily built and does not require special care. Just create an arena with a nice number of obstacles. One consideration might be to avoid large, specularly reflecting surfaces that are difficult to detect by sonar sensors. The specularity of the arena walls can be reduced by placing other objects along them.
I provide a prepared program for this activity. The program needs to be uploaded to each robot. By uploading the program, the robot does not need to be connected to a computer to run the program. The program will run as soon as the robot is turned on.
<aside> ⚠️ Link to the program on the Makeblock website: https://planet.mblock.cc/project/3857632 (sonar_program_version02)
</aside>
The program can be directly uploaded to the robots from the Makeblock website. This requires installing mlink (https://mblock.makeblock.com/en-us/download/mlink/).
source
button. This will bring you to an editor showing the blockly program. For this to work, you must install the Mlink program (https://mblock.makeblock.com/en-us/download/mlink/).connect
button on the left-hand side of the screen to connect to the robot. This will bring up a screen allowing you to select the port for the robot connection.