mBot2 / mBot Neo · CyberPi · mBlock 5
mBot2 ultrasonic obstacle avoidance
Build the official Case 30 block program. Use ultrasonic readings to trigger turns, and upload it for operation away from the computer.
Some coding and debugging
What you will build
The car moves forward and changes direction when its program detects an obstacle.
Before you start
- Understand loops and conditions, connect a device and add mBlock extensions.
Model and software requirements
- Use mBot2, also called mBot Neo. Do not substitute mBot1, Ranger or Rover instructions.
- Select CyberPi and add the mBot2 Shield and Ultrasonic Sensor 2 extensions. Use Upload, not Live, for standalone operation.
- The public tutorial uses block images, not a verified one-click project download. Software screens may change.
Similar products, older hardware and other software versions are not automatically interchangeable.
Materials & equipment checklist
Check items as you prepare them. Follow each source for part specifications, kit contents and assembly requirements.
0 of 2 required materials ready
Checks stay on this page only and are not uploaded. Refreshing or leaving resets them.
Required materials
- × 1
This route uses CyberPi, mBot2 Shield, Ultrasonic Sensor 2 and encoder motors from the standard assembly.
Material referencehttps://support.makeblock.com/hc/en-us/articles/1500006253942-Assemble-mBot-Neo-mBot2 - × 1
For CyberPi; check the cable included with your package and any computer adapter needed.
Material referencehttps://support.makeblock.com/hc/en-us/articles/6566636705559-Case-30-mBot-Neo-Avoids-Obstacles
Equipment & tools
- Use a computer with mBlock 5, or the web editor with mLink. Testing suggestion: prepare an open area and simple obstacles; their number is not specified by the example.
Build route
Follow the original instructions in order. This overview does not replace wiring diagrams or calibration procedures.
- 1
Assemble the standard kit
Follow the manufacturer's motor, sensor and CyberPi connections.
Open this step - 2
Check power
Use the Shield's rechargeable battery and follow its charging guidance; no extra AA cells are specified for this route.
Open this step - 3
- 4
- 5
Compare clear and blocked paths
Observe forward travel and turning separately. Use the official firmware procedure only if troubleshooting requires it.
Open this step
First-run checks
- mBlock identifies CyberPi and uploads the program.
- Forward motion and obstacle-triggered turns can be observed separately.
- After Upload, the program runs with the computer disconnected.
Outside this project's scope
- This reactive example is not mapping, route planning or a guarantee of escaping every maze or avoiding every object.
Assembly and operation notes
- Use the documented battery and connectors without modifying the battery pack. Do not disconnect CyberPi or USB during a firmware update.
- Testing suggestion: use a clear, level area away from stairs and table edges.
What to include in your budget
- Count the standard kit, any missing charging supply or USB adapter, test materials and shipping. Classroom-pack extras are not assumed to come with a single robot.
Original documentation and code
- Standard assemblyPublic resourcehttps://support.makeblock.com/hc/en-us/articles/1500006253942-Assemble-mBot-Neo-mBot2
- Program with mBlock 5Public resourcehttps://support.makeblock.com/hc/en-us/articles/1500006184281-Program-mBot-Neo-with-mBlock-5
- Case 30 block programPublic resource
The code is presented as block images on the original page.
https://support.makeblock.com/hc/en-us/articles/6566636705559-Case-30-mBot-Neo-Avoids-Obstacles - Shield and batteryPublic resourcehttps://support.makeblock.com/hc/en-us/articles/12739821665687-About-mBot2-Neo-Shield
- Firmware update procedurePublic resourcehttps://support.makeblock.com/hc/en-us/articles/4402418785687-Update-the-Firmware-of-mBot-Neo-mBot2
Sources accessed: 2026-10-14. This page is compiled from the original documentation and has not been hardware-tested by RoboFacet. Check the original source for kit contents, prices and software updates.