SparkBot Mk.1 - Small Robotics Development Platform

So to help test out the Core Motion Shield I’m working on, which will provide direct control of Four Brushed DC Motors or Two Stepper Motors, Multiple Servos, process the inputs from SR04/SR05/Parallax Ping/Maxbotics Ultrasonic and Sharp IR Distance Sensors and provide a 6-Axis Accelerometer+Gyro interface, all over I2C.

Anyway, I picked up some parts from Pololu to create a little Spark-Powered Robot—affectionately named Sparkoid—to assist me in my plan to take over the world the design and testing of the Motion Shields.

Right now she features two High Power 150:1 Gear Motors, each with dual optical encoders inside the wheel hub, which monitors the actual wheel rotation, as opposed to a shaft encoder which motors the raw motor output. These are mounted to a 5" Diameter laser cut acrylic base, on top of which is a 5" Diameter protoboard. There’s an HC-SR04 Ultrasonic Rangefinder mounted to very front for primary collision avoidance, plus 4 Sharp Digital Proximity Sensors mounted two on each side (perpendicular to the wheels) and two in the rear (45 degrees from dead center); this provides non-contact object avoidance when backing up and going through narrow passages (as opposed to using microswitch based “Cat’s Whisker” sensors).

On the main board is a socket for the :spark: and a 20-Pin MSP430 (to consolidate all the sensor data), plus a DRV8833 dual channel 2A motor controller breakout and a 1.5A Buck Converter breakout. I’ve got a Gyro and Accelerometer breakout coming early next week.

The whole thing is designed to be powered by a 7.4V LiPo pack.

Ideally, once I get the Motion Shield done, I’d like to make a custom :spark: White 5" PCB as well, with a socket for the Core and all the necessary headers, plus an on-board two-cell LiPo charger and buck converter for users to easily build their own robot! (You can tell this Pololu board was designed way back, as it has a footprint for a 9-Pin Serial Connector on it.) Perhaps even a custom iOS or Android app that lets you control the bot by tilting your phone.

So this thread will serve as a build-log and to garner feedback!


Captain’s Build Log: Spark Date 02/27/14

Today the parts came in and I got the basic chassis together, all the headers soldered on and the motor controller on. The Buck/Boost board sits in a female header, making it removable. Going this route means I can use it for other projects. Aside from getting this and the DRV8833 hooked up, nothing else has been wired up yet. I’ll get the rest wired up tomorrow and take her on the first test run!


Nice! So this is what you do all the days :smiley: ? Lonely sea wolf sailing all over the world and throwing Spark shields all over the place hunting for treasures :smiley:

I moved a post to an existing topic: Timothy’s Project List

Pretty much! I’m a writer and freelance consultant. Right now I’m investing a lot of time in building up the :spark: ecosystem. :smiley:

Captain’s Build Log: Spark Date 02/28/14

I didn’t get much done last night; only getting the two sets of optical encoder signal/power wires and headers all soldered in. Tonight I should get the motors wired in and all the power plumed in. Hopefully I can also get all the IR Proximity Sensors soldered up too! After that I can use jumper wires to get all the control signals going and finally get Sparkoid programmed and moving!


Captain’s Build Log: Spark Date 03/01/14

A few days ago I got the top of the board basically finished up, getting the 3V3 rails routed and adding all the filtering capacitors (0.1uF+10uF on the Core’s 3V3 input and just a 0.1uF on the MSP430) plus a 3300uF to the 7.4V battery input rail and a 1000uF to each of the three 3.3V rails. This was certainly not required, but when dealing with motors I like to be sure the power rails are as stable as possible! (Plus I had them laying around.)

Now it’s just a matter of cutting some more female headers to make power strips for jumper wires and I should be able to get some movement!


Looking Good! Can’t wait to see it start navigating!

Captain’s Build Log: Spark Date 03/07/14

I’ve been crazy busy the last week, working on the Battery Shield, I2C Code, my book and a client project. Tonight I decided to sit down and get some good ole’ R&R time in; and what’s more relaxing than building a robot! What did I accomplish? Everything!

  • I mounted the 6-Axis IMU directly in the center of the base, for optimal positioning information.

  • I added female header to accommodate my 1.3" Digole OLED and wired it directly to the Core’s I2C ports.

  • I initially forgot about tying the MSP430’s RESET high; so tonight I hooked it to a 47K pullup and a 2.2nF pulldown, while also adding a small pushbutton (to ground) for reset duty.

  • I added female headers to free sections of the 3V3/GND rails to make wiring in sensors easy!

  • I added a 0.1uF cap on both motors and then soldered on the power wires.

  • Soldered in the 5cm Sharp Digital Distance Sensors on the left and right sides of the main board, just in front of the wheels.

  • Added a 1x4 Female Header for use with an HC-05 Bluetooth Serial Adapter; TX/RX pins are wired to the Core’s TX/RX pins (under the board). This should make real-time debugging easy-peasy.

So I basically got everything wired up that needs to be wired up for Sparkina to take her first breaths… I plugged a fresh battery in and used some jumper wires to hook the 4 PWM inputs on the motor controller to four of the Core’s analogWrite ports. I loaded up Tinker on my iPhone and…she’s alive!!! The motor controller and both motors are working perfectly, on the first try no less.

So, now it’s time to get all the sensors, optical encoders and motor driver wired up to the MSP430 and to start programming!


I hope you’re taking pictures of all of this for your next book… Lookin’ good @timb!

1 Like

I love everything about this.

1 Like

Ooooooo. I want one.

Thanks guys! <3

I’m working on the I2C library for MSP430<->Core communications. This will end up being the foundation of all the shields I’m working on as well, so I’m taking my time to implement it correctly.

I had some weird issues tonight with the Bluetooth Serial not nowrking. In fact, nothing out of Serial1 was working while the Core was plugged into the board!

Turns out it was a boneheaded mistake on my part! The wires going from the Core’s TX/RX pins to the BT header run on the underside of the board, specifically between other rows of pins that belong to the Core’s female headers. Apparently when originally soldering these UART wires into place, the wire got so hot that the outer coating got “squishy” and some of the aforementioned pins cut through. Initially the serial worked fine, but I must have touched the wires tonight (or something) and that made it short out! I was able to pry one of the wires up a bit and it began working again, but that’s not a very reliable fix, now is it?

So I removed both wires and replaced them with smaller ones that had shrink wrap tubing pre-applied, to add an extra barrier of protection. This time nothing seemed to melt through and serial is once again working reliably!

So, let this be a lesson: Soldering Irons are hot, PVC has a low melting point and pins are pointy/stabby/cutty!


Do you have anything special you plan on doing with this robot?

It could come over here and pickup after my 4 year old daughter all day long and sweep the floors.

Actually I can see one of these being about 3 ft tall with round trash can type shape with arms and LED eyes that could run around the house without bumping into the wall. Gotta be something cool it could do that would entertain the kids.


Since I’ve found XLPE wire (designing military products), I try never to use PVC. Even though XLPE is rated for 125C, it doesn’t melt when soldering like PVC does, and it has a nice matte finish jacket that “feels” good to work with. It also doesn’t sustain a flame like PVC does as well. Sure you could use teflon or silicone insulated wire as well, but it’s not necessary and not really that easy to work with. I have a simple pair of ratcheting wire strippers that work great with the XLPE. Now if I could only stock a few thousand feet of it in all colors…

Not that you can tell too much in this picture, but these wires are XLPE:


Ohh, I’ll have to get some of that!

I still use 60/40 Rosin Core solder (I’ve got a 16oz roll I’ve been using since I was like 12!) but I generally solder at around 230C when putting copper wire down, as I use a small tip and the wire sinks the heat up like a mofo. I’ll tell you what though, switching to a water based flux pen a couple of years ago was the best thing I’ve ever done. I just drench everything in it.

Where do you get your XLPE wire from?

Tonight I had some time to get a basic shell in place for the I2C system. I’m using Energia (Wiring variant for the MSP430) to quickly iterate a basic I2C control system. When I write the actual motor/sensor code I’ll use direct port registers and put everything in functions so I can easily drop the Wiring specific stuff.

If anyone is interested in what a basic I2C slave communications interface looks like for Wiring compatible systems, I’ve posted the code below!

Basically, the master sends a first byte, containing the register it wants to access, followed by up to 8 additional bytes that act as arguments for the register. These aren’t always necessary; in the code below, the master would only need to send 0x01 and the slave would return the firmware version number. If you sent 0x02 you’d need to follow that with a byte representing the speed of each motor (not implemented in the sample code).

In the firmware version request example, on the master side you simply do a Wire.write(0x01) and wait around one millisecond before performing a Wire.requestFrom(address) to read the version byte from the slave.

Anyway, here’s that code!

#include <Wire.h>

byte cmdReg = 0; //Setup Command Register
byte cmdArgs[8];
byte cmdArgsLen = 0; //Setup Command Argument Index

byte responseData[8];
byte responseDataLen = 0;

#define getVersion 0x01
#define getMotorStatus 0x02

void setup(){
  Serial.println("I2C Slave Start");

void loop(){
    case getVersion:
      responseData[0] = 0x01;
      responseDataLen = 1;
    case getMotorStatus:
      responseData[0] = 0x02;
      responseDataLen = 1;


void requestEvent(){
  Wire.write(responseData, responseDataLen);

void receiveEvent(int howMany) {
    cmdReg =;
      cmdArgs[cmdArgsLen] =;


void resetRegister() {
  //Reset Command Register
  cmdReg = 0;
  //Reset Command Arguments
  for(int i = 0; i <= 7; i++) { 
    cmdArgs[i] = 0;
  //Reset Command Argument Index
  cmdArgsLen = 0;

void debugRegister() {
  Serial.print("Register: ");
  Serial.print("Arguments: ");
  for(int i = 0; i <= 6; i++) {
    Serial.print(", ");
  Serial.print("Argument Index: ");

Same here… the roll is going bad though because the rosin pops and crackles sending shrapnel everywhere! Still fun though.

I get it from work… shhh small quantities anyway. It’s basically impossible to buy unless you special order a 100 - 1000 ft spool directly from the MFG.

These are all 22AWG


6TXL-2201-4-ST (pink)

BELDEN and ALPHA WIRE also make some.

Sometimes XLPE is also referred to as TXL and GXL. TXL being the thin jacket, and GXL being the thick jacket. It’s great stuff for anti abrasion and chemical resistance, yet still flexible enough.

I’m going to warn you though, it’s not cheap… but it’s worth it!

If you find a good source that sells low quantities, let me know!


I’ll keep my eyes peeled for XLPE wire when we’re in China :slight_smile: