Projects Research & Design Hub

An Itty Bitty Education

Written by Jeff Bachiochi

STEM at Home

There’s no doubt that we’re living in a golden age when it comes to easily available and affordable development kits for fun and education. With that in mind, Jeff shares his experiences programming and playing with the Itty Bitty Buggy from Microduino. Using the product, you can combine Lego-compatible building blocks into mobile robots controlled via Bluetooth with your smartphone.

I don’t know a kid who hasn’t played with Legos. I even know adults who still enjoy building something with Legos. I know because I’m one of them. When Christmas comes around, I always try to incorporate my love of Legos and fascination with robots into gifts for my grandkids. I wish I had the bucks to give every one of them Mindstorm EV3s. But at $350 each (times 13) there’s just no way I can swing that and eat too. So, I keep my eyes peeled for things that are a little less expensive but still seem to have a good value to them. This year I found the Itty Bitty Buggy (IBB).

This is a product put out by Microduino. You may know that Microduino makes a similar product that’s about one-fourth the size of an Arduino Uno yet has a similar bus structure. In other words, you can stack expansion boards atop the core microcontroller (MCU) board. There are more than 100 modules, sensors and actuators to solve most application requirements. As you might have guessed, you can use the Arduino IDE to program the Microduino series of parts. In addition, they offer mDesigner, which is Scratch-based and designed for young minds with no programming experience.

The IBB is Microduino’s newest product. They’ve taken the best of what they’ve learned and incorporated it into an inexpensive learning tool. Listed at $59, it fits my requirements for immediate fun, with a path for educational growth. First, we’ll take a quick look at the fun part.

CELL PHONE = FUN
The Itty Bitty Buggy is a mobile vehicle controlled via Bluetooth using your Android or iOS device. The app provides instructions for building and playing with the Buggy in one of five scenarios: Buggy movement (wheels), Dodo Bird (flapping wings), Sloth (suspended rope walker), Ladybug (legs) and Alien (arms). There are on-screen instructions for the simple “build” of each of the five critters. Each build instructs the user on how to assemble each character, in easy-to-follow pictorial steps. It has four modes: remote control (joy stick), line following (color sensors), voice control (phone microphone) and music (joy stick and color sensors). The other four scenarios are based on the buggy scenario—the difference being that each creature has different movements, based on similar controls.

No programming knowledge is needed for any of these scenarios. The hardest part is pairing your phone to the Buggy’s Bluetooth module! Once you’ve done this, the Buggy will make contact with your phone and is ready to perform its control of any of the preprogrammed scenarios.

If you’ve looked at the app’s screen in Figure 1, you may have noticed the word “program” at the top right of the screen. This button brings up the next level of control available to a user. So, after you had enough fun playing with all the scenarios prewritten on the IBB, hit “program” and let’s dive deeper.

— ADVERTISMENT—

Advertise Here

FIGURE 1 -The Itty Bitty Buggy phone app provides both “build”: step-by-step assembly of each creature and “play“: the Bluetooth controls to make your creature come alive.

Let’s assume we have the simple buggy built and it only has wheels. You can start a new project by tapping “+.” But instead tap “project1”, which has already been created for you (Figure 2). In programming mode, you create or alter projects using drag-and-drop selections from one of the menu icons: Switch (procedures), Control (repeat), Calculation (comparisons), Light (colors), Sound (beeps), Movement (drive) and Sensor (colors). Each project is a program made up of blocks placed on the project field. On the field’s left are two buttons: Stop (yellow square inside a red button) and Start (yellow right pointing triangle inside a blue button). On the field’s right are menu icons.

FIGURE 2 – Should boredom set in, switch to the programming mode. Here you will drag and drop instructions to make the creature do your bidding.

Each project should begin with the Start block. This has an icon of the start button on it and is found in the procedure group displayed when the switch icon is touched. Project1 has the Start block already on the project field, along with a few other blocks. Just below the Start block you’ll find two Light blocks and one Sound block. If you look at the Light blocks, you’ll see each one uses a different sensor: A (the driver-side LED/sensor) and B (the passenger-side LED/sensor). Each of these has an associated color. You can choose a different color by tapping the color swatch, tapping a new color from the pop-up menu and tapping the project field to select it. The Sound block allows you to select a note and to adjust its duration using similar taps.

To have the IBB execute this program, just tap the Start button in the lower left of the field. The blocks are executed from the top down, turning on the left LED, turning on the right LED and playing a note. You’ll see that when the note has finished playing, it sits there waiting to execute more blocks, but since we have run out of blocks to execute, the buggy waits. Tapping on the Stop button will halt the program—the LEDs are turned off.

You can alter this project to investigate all the menu groups, and when you leave (Exit), the project will be saved if it has been changed. There is plenty here for a kid to really begin to understand how programming is simply a list of instructions to follow. You will note that the Start button is grayed while the program is executing. Presently, the scrollable project field can’t be resized, which means that larger projects can’t be seen without scrolling. This makes them a bit difficult to see. When you need your phone back, you can move the learning from the phone app to a PC. We’ll explore those options right after looking more closely at the actual hardware.

BREAKING DOWN BUGGY
The Buggy is divided into two modules, which I call the head and body (Figure 3). The head contains a CPU with USB (wired) and Bluetooth (wireless) interfaces. All I/O is through two bus systems: the “mCookie” bus, which uses “pogo pins” and magnets to ensure connectivity between snap-together modules, and the sensor bus, which offers a number of 4-pin connectors carrying power/ground and two analog or digital I/Os. And speaking of power, an integrated lithium battery—which charges from the USB port—provides long run times and so there’s no worries about replacing batteries (Figure 4).

FIGURE 3 – The Buggy has many built-in features. I like the lithium ion power source. You can add features by stacking a “cookie” or cabling a sensor via the top of the Buggy’s expansion buses.
FIGURE 4 – Multiple cookies were combined to create a single PCB inside the top of the Buggy. The back of the PCB holds the two expansion buses. The front side holds most of the electronics (see inset).

The mCookie is a modular, stackable, building-block-compatible electronics platform that supports Arduino. The original series consisted of a CPU “core” module and several stackable expansion modules such as communication, functions and sensors. Because several modules have been incorporated onto the Buggy’s “mCenter+” PCB—CPU, communication, battery management, sound and so on—the stackable expansion can be used to add module-like GPS, RTC or Lego NXT interfacing. A typical module—such as the 128 × 64 OLED—is priced at $15.

The sensor bus breaks out all the CPU’s I/O ports. The tiny connector is a 4-pin JST 1.25 mm. This connector is compatible with the Microduino line of sensors. You can choose from a long list of inexpensive switch, LED, environment and other input and output sensors. The only downside I see is that, unlike Lego sensors that are integrated into Lego bricks, these are tiny PCBs with exposed sensors. A typical sensor—such as the digital temperature sensor—costs $4.

The body of the Buggy contains two motors, two LEDs and two color sensors. All this is multiplexed through one dedicated 4-pin I/O connector. Note in Figure 5 that the wheel shafts are gear-driven 1:1 from the motors, and each axle has a mechanical clutch to prevent breakage. This connector could have been eliminated—or at least internalized—if the Buggy had been a one-piece unit. I’m not sure of the reasoning for breaking this into two pieces.

You may have noticed that you didn’t see any way for the phone app to handle any of these additional I/O thingies. And you’d be correct. For some kids, just beginning to learn about programming and playing with the available blocks on the phone app will be sufficient for a good while. In fact, not every child will develop the curiosity to come out and ask: “What now?” And that’s OK! That said, don’t toss out the Buggy just yet because there is plenty more for those interested in learning more. You can find additional information about the modules and sensors I have already mentioned on the Microduino website.

— ADVERTISMENT—

Advertise Here

GRADUATION
Those who wish to graduate on to bigger and better adventures should grab their imaginations and download mDesigner from Microduino. After starting the application, you will find a screen divided into five areas: a toolbar (top-open/save/kit/port/settings), panes (left-code blocks/costume/sound), scripts (center-build area), stage (upper left-stop/start/sprite) and sprites (lower right-selecting sprites and backdrops). Realize that this environment was created to teach someone how to program by dragging and dropping instruction blocks onto the script area, not necessarily for the IBB. With that in mind, say you have a child that could not care less about robots. Invite them in right now. This is for them.

You can set aside the Buggy for now—it’s not required for this exercise. Make sure it says “online” on the right side of the toolbar. If it says offline, just click it. I’ll explain this later. Let’s begin by creating a new project that any kid will have fun with. Click “Create a new Project” in the toolbar. Now click the Costume tab in panes. Click “Choose a Costume” at the bottom of panes. Scroll through the icons and pick “Dog2.” This will be our Sprite. Next, click Stage on the right in sprites and the Costume tab will change to Backgrounds. Click “Choose a Backdrop” at the bottom of panes. Scroll through the icons and pick Theater. Again click “Choose a Backdrop” at the bottom of panes. Scroll through the icons and pick Farm. Okay, now we can start coding.

Click the Code tab in panes. One the left of side of panes there is a column of functions that you can hit to scroll the associated instruction “blocks” into view in panes. These are similar to those in the phone app described earlier. Here I’ll describe a selected block by using the syntax “function:block” to help you find it. Then place it in the script area and edit items in parentheses as necessary.

Events:when clicked
Looks:Say ‘You click the mouse and I’ll follow.’
Control:wait until <>
(Place Sensing:mouse down? into <>)
Looks:think ‘Hmm’ for ‘2’ seconds
Sensing:glide ‘1’ secs to ‘Mouse Pointer’

Your desktop application should look like Figure 6. Now click the green flag at the top of the Stage. You should see the Dog sprite, with a speech balloon that says “You click the mouse and I’ll follow.” After you click the mouse button, the dog’s speech balloon will say “Hmm.” Then, two seconds later—after contemplating where the click came from—the sprite will float toward where the mouse pointer was clicked, but will remain inside the Stage area. Add the remaining blocks shown here, and the project is finished.

FIGURE 6 – Here we’ve set the stage, so to speak, with our actor—a dog—front and center. Just a few function blocks are required to bring our furry friend to life.

Control:repeat ()
(Place Operators:pick random ‘1’ to ‘5’ into () )
Sensing:Mouse Down?
(Place previous code into repeat)
Looks:switch backdrop to ‘Farm’
Looks:say ‘I need a rest’ for ‘2’ seconds
Looks:say ‘Zzzzzz’ for ‘10’ seconds
(Place each of the following blocks between ‘when clicked’ and ‘say You click the mouse and I’ll follow.’)
Looks:switch backdrop to ‘Theater’
Motion:goto x: ‘0’ y: ‘0’
Looks:say ‘OK, let’s play’ for ‘2’ seconds
(Place ‘Control:forever around all the code block, with ‘when clicked’ at the top)

Remember the “When Clicked” block must always stay as the topmost block! You should now have what looks like Figure 7. Save by clicking “Save Project.” Let your kids play. Fido will tell you when he’s had enough, right? If you haven’t dragged and dropped before, it takes a while to figure out what to grab and where in order to rearrange blocks. There’s a bunch of different codes in this little project. Please feel free to play around. It’s a perfect opportunity to show your kids how easy it is to program. You can build and run at various stages to really get an understanding. Now, on with the show.

FIGURE 7 – Here I’ve expanded on the theme and given the pup a bit of random behavior, along with a change of scenery.

BRING ON THE BUGGY
Let’s begin with the difference between “online” and “offline.” When the Buggy is involved, a wired USB connection must always be used. I’m not sure whether the Bluetooth will be incorporated in the future. The online mode will download a small program, which runs on the Buggy and allows your projects to be run/stopped/edited from mDesigner. This is fine if you do not include any movement. Otherwise it’s like having a lively puppy on a leash. The offline mode downloads an executable copy of your project to be run even when unplugged and every time the Buggy is powered up.

If the last project is still loaded into mDesigner, click online to toggle to the offline mode. Two things happen: a notice pops up stating there are blocks that are unsupported in this mode, and on the right side of the screen, the stage and sprite areas are replaced by an area that looks an awful lot like the Arduino IDE! This is about to turn into an educational moment.

Click on “Create New Project” on the toolbar. Add the following blocks to the project:

Events:when clicked
Control:repeat ‘10’
(Place the following inside ‘repeat 10’)
Buggy:car ‘forward’ speed ‘255’ duration ‘1’ s
Buggy:buzzer note ‘c4’ duration ‘1’ s
Buggy:car turn ‘left’ speed ‘255’ duration ‘1’ s
Buggy:buzzer note ‘b4’ duration ‘1’ s

Note that as you add blocks, the code is generated on the right side of the screen. While mDesigner was always writing code when blocks were added, now you get to see that actual code. This makes it obvious what actual code must be written in an Arduino IDE to perform a described task. Whether or not the user is interested in this presentation, it is an effective learning tool for those interested in tackling the programming hurdle. Save the project and click “flash firmware.” You will need to have the Buggy connected with the included USB cable. If you don’t know which serial COM port to use, run the “Computer Management” application on your PC. On my PC, the port is COM18, as shown in Figure 8. When the download is finished, the project will begin running immediately. Note: you may wish to place the Buggy atop something to keep its wheels off the ground. Remove the USB cable and place the Buggy in an open area. It should begin to move and beep, turn and boop 10 times and then stop. The program will run every time you turn on the Buggy with its power switch.

FIGURE 8 – Under “Windows Administration Tools” you will find “Computer Management”, which shows your active COM ports. If you can’t figure out which one you need, try plugging and unplugging the device, to see what is added or removed from the list.

CUSTOMIZING YOUR CODE
You may have noticed while playing with the Buggy and your smartphone that, although you can drive the Buggy around using the joysticks or keep the Buggy within the playing area when line-following with the color sensor, it has no other input device. I looked at the tiny microswitch offered as a crash sensor and thought “That looks tough to work with. I can do better.” I dug through my “junk” boxes and found some small levered E-Switch microswitches that looked promising. The lever not only reduces the required force to engage the contacts (small, less than 1 oz), but also offers an easy way to affix “crash” extensions.

I grabbed a small piece of protoboard cut to around 0.3” × 1.5”—which is about the size of one of the 1 × 5 orange girders supplied in the Buggy’s extra parts bag. Two of these microswitches and pull-up resistors are mounted on the extreme ends of the PCB. I grounded the N.O. (normally open) switch contacts with the wiper connected to the pull-up and the Buggy input lines of a 4-pin connector. Although I wanted to add the appropriate connector so I could use one of the extra jumpers supplied with the Buggy, I didn’t have one. So, I clipped off one end of a jumper cable and soldered it to the PCB directly. I hope Microduino offers these male connectors for sale in the future for us DIYers.

A piece of double-sided foam tape holds the PCB securely to the girder, which is easily mounted to the front (or rear) of the Buggy. You can see the assembly added to my Buggy in Figure 9. Attached to the switch levers are cardboard ovals, which cover the total width of the Buggy and then some for complete protection of most frontal assaults. In robotics, many would say that your sensors should prevent any kind of collision, but even insects use their antennae to make contact with obstacles. Touch is an important sensation that we all use every day. The jumper cable is plugged into the Buggy connector marked D4/D5. This means the N.O. switches with pull-ups to VCC look like a logic-level high until an obstacle has closed a switch, which shorts the input to ground (logic low).

— ADVERTISMENT—

Advertise Here

FIGURE 9 – These tiny lever-action microswitches are just what we need to get this Buggy roaming the range. Arduino blocks let us use external sensors that we connect via the expansion buses.

FREE TO ROAM
Now we can remove the walls of the Buggy arena and let it roam freely on the range. We’ve added the hardware to prevent it from getting stuck once its run into a wall, furniture or other obstacle in its landscape. How can we incorporate this sensor into the Buggy’s programming? You’ve probably noticed that the “red” Buggy blocks do not include any mention of any I/O other than motor, color and buzzer. We will need to use the “blue” Arduino blocks, just above the Buggy blocks.

Start by entering the following Buggy block program:

Events:when clicked
Control:forever
(Place the following inside ‘forever’)
Buggy:car ‘forward’ speed ‘255’ duration ‘1’ s
Buggy:buzzer note ‘c4’ duration ‘1’ s

If you then download the program by clicking “flash firmware,” the buggy will begin executing your program. It will drive forward for 1 second before pausing 1 second to play “C4” (that’s note C in the fourth musical octave). You can set it free on the floor. Just realize it will eventually crash into something, but attempt to keep going.

A few more lines of code will solve that problem:

(Place the following inside ‘forever’, just under ‘buzzer c4 1s’)
Control:if ‘<>’
(Place the following inside ‘<>’)
Arduino:pin ‘5’ is ‘low’
(Place the following inside ‘if’)
Buggy:car ‘backward’ speed ‘255’ duration ‘1’ s
Buggy:buzzer note ‘c5’ duration ‘1’ s
Buggy:left ‘left’ speed ‘255’ duration ‘1’ s
Buggy:buzzer note ‘e4’ duration ‘1’ s
(Repeat the following, note the minor, but important changes)
Control:if ‘<>’
(Place the following inside ‘<>’)
Arduino:pin ‘4’ is ‘low’
(Place the following inside ‘if’)
Buggy:car ‘backward’ speed ‘255’ duration ‘1’ s
Buggy:buzzer note ‘c5’ duration ‘1’ s
Buggy:turn ‘right’ speed ‘255’ duration ‘1’ s
Buggy:buzzer note ‘g4’ duration ‘1’ s

Your blocks should now look like Figure 10. I saved this project as Buggy Bumpers, and then “flashed the firmware” and set this Buggy free. Note that if the left Buggy switch closes, the Buggy will back up before turning right, away from the obstacle, by executing one “if” statement. A right switch closure should turn the Buggy left (Figure 11). If the turns are wrong, that’s because your switches are wired or placed the opposite of mine. Then you need to change pins 4 to 5, and pins 5 to 4 in the “if” blocks.

FIGURE 10 – With just a few added blocks, our bumper switches can redirect the program flow to back the Buggy away from danger.
FIGURE 11 – My Buggy has run into the leg of a high chair. It’s tough creating avoidance routines that will work for all situations. That’s why more sophisticated robots typically have many levels of avoidance.

I’ve included the playing of notes, so you can easily identify which line in the program is executing. You will observe that these “notes” interrupt the movements of the Buggy. To make the movements smoother, eliminate those blocks. Once you do that, you might find that 1 second is too long for some movement—especially the forward movement. Referring back to an earlier project written on the cell phone app, you might say let’s shorten them up to some fraction of a second. But fractions of a second are not recognized in mDesigner. Hmm…. A look at the Arduino code (on the left of the screen) written when the blocks are placed will reveal the reason for this.

In the loop() code, you’ll find the function BuggyCarTime(1, 255, 1)—the numbers being values for the variables (direction, speed, duration). We placed the block “car () speed () duration () s” into our project three times. The same function is called each time with different parameters. If you look at this function, which was placed early on in the Arduino code, you find each variable type (_dir, _speed, and _time) has been typecast as uint8_t, or an 8-bit byte (0-255). So, the only legal values that these variables can take on are integers between 0-255. If the provider of the routines had defined _time as float (floating point), we could have used fractions of a second. You might want to try replacing all the “1”s with 0.1 and see what happens. Then, you can directly alter the Arduino code by replacing the text uint8_t with the text float, and then recompiling (flashing firmware). Does it act differently? What about the turns? That’s a separate function, but you can replace the uint8_t with float there also. Don’t forget to recompile.

Note: This is not a permanent change. And because the saved project only saves the blocks, when you reload your project the Arduino code is built again from its libraries. As a result, any changes you made in the code go away. To make this change permanent, you need to do so in the library, where the function is permanently stored.

CONCLUSION
Now you may be able to see that the Itty Bitty Buggy—while an inexpensive and fun “first robot”—is not limiting to your child (or the child in you) in any way. It introduces one to building and operating a number of fun projects that can stimulate one’s imagination and lead to a curious desire to dominate the universe—or at least improve on the program!

A couple things bother me, beyond what I may have already mentioned. Some of the application help is not available in English. However, the Microduino website does have an English Wiki link that is constantly being improved. I’m sure that as the popularity of IBB increases, so will the support.

The sensors available from Microduino were not designed specifically for integration into the Buggy—except for those cookie modules that plug on and have no physical position demands. I think some sensors could be integrated into the mechanical building system, so they could be easily secured to the vehicle/creature being built. Using the tiny connectors may save some real estate, but if they’re going to be made available, a more standard connector would be a plus.

It’s only fair that I praise those areas in which I think Microduino has done things right. The cost of entry is reasonable, and includes many immediately gratifying features. Their redesign of existing hardware has miniaturized what would otherwise be a growing stack of individual products. The inclusion of additional programming environments allows the Buggy’s shelf life to be extended after boredom has set in. The lithium ion battery is extremely important. I’ve seen many abandon any interest in a device just because low batteries unknowingly introduced erratic operations that didn’t make sense, creating unwarranted frustration.

If you want to provide someone with a fun toy that can encourage learning, I recommend the Itty Bitty Buggy. And don’t forget to add the Buggy Bumper, just to be safe!

RESOURCES
Itty Bitty Buggy                   Microduino’s newest STEM educational toy
Microduino Inc.

E-Switch, Inc.
SS0750301F015V1A           SS Series Sub-Miniature Snap Action Switches

Microduino | www.microduinoinc.com
E-Switch | www.e-switch.com

PUBLISHED IN CIRCUIT CELLAR MAGAZINE • MAY 2019 #346 – Get a PDF of the issue


Don't miss out on upcoming issues of Circuit Cellar. Subscribe today!

 
 
Note: We’ve made the October 2017 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.


Would you like to write for Circuit Cellar? We are always accepting articles/posts from the technical community. Get in touch with us and let's discuss your ideas.

Become a Sponsor
Website | + posts

Jeff Bachiochi (pronounced BAH-key-AH-key) has been writing for Circuit Cellar since 1988. His background includes product design and manufacturing. You can reach him at: [email protected] or at: www.imaginethatnow.com.