Using Spike Prime for GBC modules

Posted by ,
View image at Flickr

Last summer I wrote an article about using LEGO Boost in Great Ball Contraption (GBC) modules and while I had some success in getting it working at home, it proved to be wholly unsatisfactory when I attempted to use it at displays, not least because it's totally reliant on a smart device and a Bluetooth connection.

Fast-forward 6 months and LEGO's new educational robotics platform, Spike Prime, has just been released, so I thought I'd buy one to see whether it would fare any better.

My initial experiments are very encouraging. In this article I will describe the two modules I've built and also take a general look at what comes in the 45678 SPIKE Prime kit and the software used to program it.


45678 SPIKE Prime Set

Before we get started, I'll mention the price. It's very expensive! The retail price in the UK is £355 but Amazon.co.uk is currently selling it for just over £300 which makes it slightly more palatable. In the US it's $330 and available directly from LEGO.

Like many Education sets it comes in a sturdy plastic box which bumps up the price a bit but of course makes it easy to store in a school environment.

The set comes with 525 pieces and a full inventory is available. In addition to the parts shown in the inventory there's also a bag of spare parts, the contents of which appears to be the same as 2000719 Replacement Parts Pack.

View image at flickr

Two plastic trays are provided in which the small parts are stored.

View image at flickr

Trays are not provided for the larger ones, or the motors and sensors: you are expected to let them rattle around at the bottom of the box.

View image at flickr

The hub, motors and sensors are not shown in the pictures above because they are currently incorporated in my models. So, here's the stock photo showing the hub, two medium motors, one large motor and three sensors: colour, distance and force.


New parts

The new parts in the set were revealed last April and since then many of them have already appeared in sets. So, I'll just take a look at those that haven't.

The new castor wheel has been designed to make it easy to create 2-wheel robots, with this trailing at the back.

View image at flickr

The smaller 7x11 frame shown here has appeared in white and black in some of last year's sets, but the 11x15 frame and 'waffle board' are making their first outing here.

View image at flickr

The new 2x4 brick with axle holes, (aka Kjeld brick) produced to make interfacing between Technic and System easier, first cropped up in 21318 Tree House.

View image at flickr


The software

The hub is programmed using the LEGO Education Spike Prime app, which is available for iOS, Android and Windows 10 devices. I've been using the latter.

The Spike platform has a number of major advantages over Boost, WeDo, Control+ and Powered Up. The most significant is that, unlike the 'dumb' hubs used in those products, this one, once programmed, can run autonomously without the need for it to be attached to a smart device. In other words, just like has always been possible with every iteration of Mindstorms.

The second major advantage is that, rather than use the bespoke and largely cryptic programming language used for Boost, for example, it's programmed using Scratch which is taught in many primary schools.

Finally, the hub incorporates a rechargeable battery which can be charged via USB while the hub is operating which means that it can be run for extended periods of time. Exactly how long, I don't know yet, though...

The software appears very polished and provides a wealth of educational resources and instructions for simple robots.

View image at flickr

View image at flickr

View image at flickr

I'm not going to look at the educational benefits of the kit -- I'll leave that to others -- so I'll skip over all that and concentrate on the more interesting aspects of the software from our point of view.

As I say, the programming canvas will be familiar to virtually every child, in the UK at least, because it's based on Scratch.

A list of all commands and operators are shown on the left. These are dragged, dropped and connected together on the right to build the program. It really is child's play and simple programs can be constructed in seconds.

However, as program complexity increases it can get a bit unwieldy so you are likely to want to look at a text programming language like Micro Python should you reach that point.

View image at flickr

To run your program on the hub you need to connect to it and download the code. Connection can be either via USB or over Bluetooth. My experience with the latter when using a Windows 10 laptop is that it's very quick and easy to establish a connection and very stable once you're connected.

View image at flickr

When connected, you can download and run the program by pressing the yellow button in the bottom right corner of the programming canvas shown above (obscured by the Brickset watermark) and also view the status of the peripherals connected to the six bi-directional ports.

Multiple programs can be stored on the hub, around 20 I believe. They are selected using the left and right buttons on top of it.

View image at flickr


GBC ball sorter

In my Using Boost for GBCs article I built a simple module that counted and detected the colour of balls and sent them one direction or the other. It sort of worked, but after a time the colour sensor would stop returning correct values which caused the machine to jam and fail, since it didn't know which way to send the balls.

So, I thought I'd rebuild the machine for Spike to see if it faired any better.

View image at flickr

View image at flickr

It uses two motors and the colour sensor. Balls are lifted one at a time out of the hopper by the wheel, which is constantly rotating, then roll down to the colour sensor. A colour reading is taken before sending them left or right depending on their colour by rotating the red 'Y' shaped piece 120 degrees.

View image at flickr

The first thing that became apparent when reading the colour of the balls is that the sensor will only recognise around 8 colours, and orange isn't one of them. Every other colour is reported as 'no colour'

So, for that reason, the parts of the module under the sensor had to be a colour it does recognise (I chose red) so that I could detect white balls as 'white' and orange ones as 'no colour'.

The sensor also returns a value for amount of light reflected as a percentage which is useful for determining the proximity of things. When no ball is under it, it returns 35% or so; when one is under it, it's around 90%. I could therefore use that to detect the presence of a ball before reading its colour.

Here's the complete program:

View image at flickr

The balls are also counted as they pass and the totals can be displayed on the hub's 5x5 LED matrix by pressing buttons on it. In addition, the light around the hub's centre button is changed to match that of the ball just detected.

Here's a (poor) video showing it in operation. It's early days, but it seems to work reliably with 100% accuracy, so much better than the Boost version, and of course it doesn't need to be tethered to a phone or tablet to be run.


GBC raising platform

The other module I've built is another relatively simple one that lifts a basket of balls from the module's input basket to the exit ramp.

View image at flickr

It uses three motors: two to operate the gates on the baskets and one to move the second basket. The colour sensor is used to detect the presence of balls in the input basket and the distance sensor detects when the moving basket is at the start position.

View image at flickr

Here's the moving basket at the end of its travel with its gate open to release the balls.

View image at flickr

The code has been split into blocks to aid readability and I suspect is fairly self-explanatory. But just in case, in pseudo code:

  • Initialise counters and motors, close gates, move container to start position
  • Forever
    • If there are balls in the input basket
      • Open first gate
      • Close first gate
      • Move container to the end (9 revolutions of the motor)
      • Open second gate
      • Close second gate
      • Move container to the start

The program also counts the number of times the basked has been moved and displays the total on the hub's 5x5 display.

View image at flickr

Here it is in operation.


Verdict

My initial experiments are very promising, so it looks as if Spike Prime is going to be suitable for controlling GBCs at displays, and be the only Powered Up-based platform so far released that is. The hub runs autonomously, it can be continuously powered, and is programmed using a standard and powerful language.

However, as I said at the start, it is very expensive, as educational products tend to be. Basically, each GBC module will cost you around £300, the price of the whole kit, because although the hub, sensors and motors can be purchased separately it is not cost effective to do so.

LEGO is not marketing Spike Prime as a Mindstorms replacement, even though it pretty much does everything that EV3 does, and then some. Given that EV3 is now 7 years old it's obvious that it will be replaced by a Powered Up-based product in the not-too-distant future. I'm not a betting man, but if I was, I'd put my money on it being very similar to this.

If you don't want to wait, you can buy 45678 SPIKE Prime Set for a 15% discount at Amazon.co.uk, for just over £300

23 comments on this article

Gravatar
By in United States,

As with all Lego robotics kits, I'm sure I would absolutely love this but I'd get totally sucked in and for now, I don't have the time... someday! Looks like a lot of fun!

Gravatar
By in Portugal,

Must try GBC one day. Even if it is something simple and basic to add to my city.

Looks very rewarding the final result!

Gravatar
By in United Kingdom,

I saw Spike Prime at the Bett Show last month. I was impressed at how quick it was to get something working. Incidentally this year marks the 40th anniversary of Lego Education.
Mindstorms still reigns supreme, though. Still hoping for v4 but not holding my breath...

Gravatar
By in Canada,

I'm not into technic or programmable bricks; however, is it just me or is there something mesmerizing about watching GBC.

Gravatar
By in United Kingdom,

No it is not just you. Everyone who watches them is mesmerised, as evidenced at every LEGO show where there's a GBC circuit :)

Gravatar
By in United Kingdom,

Yes but they were not official releases.

Gravatar
By in United States,

The interface looks very much like scratch, an anamation/programming program

Gravatar
By in United Kingdom,

That's because it is scratch...

Gravatar
By in United States,

These GBC modules are really neat. Thanks for reviewing spike just so I could watch videos of your modules. That programming interface is neat; I can see why they'd use it to teach kids about programming and logic.

Gravatar
By in Germany,

Thank you, Huw, for this wonderful review. I will buy spike when it gets much cheaper and experiment in GBC as well.
Well done.
Great inspiration.
Thank you!

Gravatar
By in United States,

A lot of us here in the US learned to use Scratch too, so that's nice to hear. I'm still not really interested in the whole Spike/BOOST thing (yes, I know they're different, but still). I miss the simplicity and modularity of Power Functions (plus my trains run on that). Great review though!

Gravatar
By in United Kingdom,

Why bother what? Reviewing it? Buying it?

It's available from Amazon.de, https://amzn.to/32eh2Am, but probably cheaper to import from Amazon.com

Gravatar
By in United States,

Powered Up wouldn't be so bad if the standalone remote wasn't gimped. The app controls allow you to "fire and forget" regardless of which type of motor you're using, but the standalone remote differentiates between train motors and non-train motors. For train motors, they work like the PF train remote, where once you start it up it'll just keep running until something shuts it off. For every other motor, it's like the smaller PF remote, where it'll only run as long as it's getting a signal to do so. _IF_ they could revise the standalone remote so it incorporated a switch that let you switch between the two formats, that would solve one major problem with the system, which is that you have to leave the app powered up, and your device within range (so no sneaking off to find a quiet place to take a phone call). Nobody needs to take the standalone remote with them when they step away from the display.

Gravatar
By in United States,

Those Technic bricks look strangely like K'nex bricks.

Gravatar
By in Germany,

Great review! Still, compared to Mindstorms (which I own), I do not (yet) see the benefit to move over to Spike (maybe if there will be a 'home edition' once). This said, I still lack the rechargeable battery for the Mindstorm robot, and that is clearly a benefit of the spike set.

One question: How does the colour detection work with 'real' GBC black+white soccer balls instead of the pure white ones??

Edit: it's great that Lego now fully moved to scratch (while possible with Mindstorms, but less evident)

Gravatar
By in Germany,

I personally would never buy this as I would have no use for it, not being into building GBCs or programming stuff with LEGO myself.

That being said I also love watching GBCs. There is indeed something extremely fascinating and intoxicating about those machines. I envy people like Huw who are so proficient at devising and building such complicated mechanisms. I can only wonder how much time goes into refining them until they run as smoothly as they appear to do during those videos I have seen. Plain awesome.

Gravatar
By in Luxembourg,

@TomKazutara said:
"It's not even for the Lego Shop, why bother?"

The set is available on all Amazon sites, and like every other Education set from some specialized retailers - e.g. Brickshop for the Benelux.
These sets are expensive (you are paying for more than just the bricks and motors/sensors), but there's sometimes discounts to be had. Personally I'm thankful to Huw for testing the set, and will now keep an eye out for any future discounts!

Gravatar
By in United Kingdom,

@raist7 , I don't have enough printed footballs to tell definitively but experiments with the few I have suggest that they majority of time they are detected as white.

Here in the UK we all use plain orange and white balls since that's all we've been able to buy via LUGBulk in recent years so it won't be an issue.

Gravatar
By in Germany,

One general thing I don't understand is why Educational sets are so much more expensive for what you get.
From my experience, educational budgets are always tight and schools etc. tend to try and save as much money as possible because they simply haven't got enough money. Perhaps privately funded schools do, but even the few of those I know are also always notoriously underfunded. And no public school/kindergarten etc. I know has a budget that allows for buying expensive LEGO Educational sets. If they get any LEGO at all it is usually via donations.

Shouldn't there rather be a special cheap series of educational sets that are available at a substantial discount and that could only be bought by schools or other educational institutions? Would make much more sense imho. I mean, who other than affluent AFOLs buys these sets?

Gravatar
By in United Kingdom,

There is a new Mindstorms set due for release in August. Dont know anything about it apart from the name and price

Gravatar
By in United Kingdom,

^^ Schools don't pay the VAT which accounts for c.20% of the price, and they come in a nice sturdy box. Plus, you are buying more than just bricks and motors. You get the lesson plans, instructions and other educational resources.

^ I would not be surprised. What do you know?

Gravatar
By in United Kingdom,

I guess if Orange is an unknown colour, then the footballs shouldn't be an issue. The football would be either white or black which would be known colours, so you can sort on known/unknown?
Flec

Edit. HUW - are you going to use one of these at any upcoming shows?

Gravatar
By in United Kingdom,

It seems to average the colour in view so white/black would probably be recognised as grey which I think seen as white. At least light grey is, which is why I couldn't use that colour for base of the containers in the second module.

Yes, their first outing will be at Ware 18/19 April. I'll have to buy another Spike first to run them both at the same time, though!

Return to home page »