An Overview of Using Makeblock in Arduino ProgrammingDecember 06, 2016 by Mark Hughes
Makeblock allows young inventors to have early success in electronics through intuitive color-coded connections and an easy-to-use programming interface.
This is an overview of how to use Makeblock's Arduino-based boards, sensors, and Scratch-based graphical programming environment. This article features miniature projects on how to measure distance ultrasonically and how to build an XY plotter.
Getting Started with Makeblock ME Orion
To follow along with this tutorial, you'll need to purchase a Makeblock Me Orion (based on an Arduino Uno) or the Me Uno Shield which will plug into the headers of an Arduino Uno board that you supply. Additionally, you will need compatible sensors and a way to program the boards. Makeblock ME is unique among Arduino clones and accessories due to its easy-to-use plug and RJ25 jack connection system.
Makeblock also makes MegaPi, a shield for the Raspberry Pi that allows users to control four stepper motors to create their own 4-axis CNC machinery. Take a look at some of the creations made with the MegaPi here.
The Makeblock Orion (left) and the Me UNO Shield. Image courtesy of Makeblock.
Both the Makeblock Orion board and the Makeblock Orion Shield are populated with RJ25 jacks. The colors of the stickers on top of each jack indicate which electronics modules can be connected to the board at that location. An electronic module with a yellow sticker can connect to the board at a port with a yellow sticker (for example, port 4 on both boards) and a motor module with a red sticker can connect to the board at a port with a red sticker (for example, port 2 on both boards).
The hardware's intuitive connection system, combined with a custom Scratch programming environment, makes it a wonderful system to introduce children and novices to the fields of robotics and computer science.
|Makeblock Orion||$30||User Guide|
|Arduino IDE 1.0.6 (53 MB)||Installer | Download Page||Installer||32 bit | 64 bit|
|mBlock (117 MB), optional||3.3.8||Mac|
|ArduBlock (3.43 MB)|
The Makeblock Orion can be programmed through iOS apps, mBlock, or the Arduino IDE (with or without the customized ArduBlock Scratch add-in). For this example, intended to minimize download size, install Arduino IDE 1.0.6, Arduino Drivers if necessary, and ArduBlock.
Scratch is a visual programming language that allows inexperienced programmers to create functional programs out of building blocks that are combined with snap action. ArduBlock is a Scratch-based GUI that functions as an extension of the Arduino IDE; it is not a separate program.
Each block in ArduBlock creates an Arduino compatible code-snippet. Once the program in Scratch is complete, the Arduino IDE is populated with those code snippets to form a complete Arduino program that is equivalent to the diagram created in ArduBlock.
Creating a working program begins by connecting electronic modules with the Makeblock Orion via RJ25 jacks and cables. Then programs are created using ArduBlock and uploaded to the Makeblock Orion.
Image courtesy of Makeblock.
Example Project — Ultrasonic Distance Measurement in 5 Minutes
|Part Required||Cost||More Information|
|Me 7-Segment Display||$8||Datasheet|
|Ultrasonic Distance Monitor||$20||Datasheet|
Here's how you can use a Makeblock Orion and an ultrasonic distance monitor to measure distance with ultrasonic sound waves.
Begin by connecting the Me 7-Segment Display to port 4 and the Ultrasonic Sensor to port 3. Then follow these steps:
- Open Arduino 1.0.6
- Open ArduBlock in Arduino 1.0.6 by clicking "Tools" >> "ArduBlock"
- In ArduBlock
- At the bottom, click "Check Update"
- On the left, click "Control"
- Click and drag "Program" into the main workspace
- On the left, click "Makeblock"
- Click and drag "7-Segment Display" next to "Loop" of "Program"
- Click and drag the default number "123.4" created by the "7-Segment Display" to the far left to delete it
- Click and drag "Ultrasonic Sensor" to the right of "7-Segment Display" and connect it to the "Number" portion
- On the left, click "Control"
- Click and drag "delay MILLIS milliseconds" below 7-Segment Display
- Click the "Port_#" drop-down for "7-Segment Display" and change it to "Port 3"
- Click the "Port #" drop-down for "Ultrasonic Sensor" and change it to "Port 4"
- Click the number to the right of "delay MILLIS milliseconds" and change it to 250
- At the top, click "Upload to Arduino"
- In Arduino
- At the top, click the right arrow or "File" >> "Upload" to send the code to the Arduino
Ultrasonic distance measurement with display using a Makeblock Orion ME, a 7-segment display module, and an ultrasonic module.
Example Project — Create an XY Platform
|Part Required (x Quantity)||Cost||More Information|
|Makeblock Orion||$30||User Guide | Arduino IDE | Scratch | HD App|
|RJ25 Adapter (x3)||$3||User Guide|
|Stepper Motor Driver (x2)||$18||http://wiki.makeblock.cc/index.php?title=Me_Stepper_Driver|
|Wireless Serial Module (optional)||$20||YouTube Guide|
In addition to the ArduBlock add-in for the Arduino IDE, Makeblock has created proprietary software (available on GitHub) that allows you to create your own XY drawbot, laser engraver, or egg bot (i.e., a spherical object plotter).
Makeblock sells an XY Plotter that provides everything you need in one kit. However, the XY plotter is a bit spendier and a bit smaller than I'd like.
My plan was to make my own out of rack and pinion or ball screw drive using linear bearings (see example 1 here and example 2 here). However, months of waiting for overseas shipments along with receiving damaged parts from eBay sellers has delayed the project long enough. So I decided to create an XY gantry out of MakerBeam parts I had stumbled upon at a local scrap-metal yard.
I combined these parts with a few laser-cut pieces that I've provided plans for in the files below (in .cdr and .dxf format).
However, I do not recommend that you re-create the XY gantry on the scale that I have for various reasons: the cost of MakerBeam parts and hardware if purchased new, the deflection of the horizontal 1-cm extruded aluminum channel, and the backlash and slop inherent in the design (which admittedly could be solved with better mechanical design).
Custom parts used with MakerBeam hardware.
Connection diagram from inside the mDrawBot program.
A pen lifter created with a servo, two ball-end linkages, and two pairs of round bearings arranged to create a linear roller guide.
Makeblock offers additional functionality through Arduino and iOS apps that was not explored here. The wide assortment of sensors, interfaces, and hardware makes Makeblock a good option for novice builders in particular, but it can also help projects be quick and successful for experienced builders, as well.