Using Boost for GBCs

Posted by ,
View image at flickr

LEGO has recently started selling the Boost Powered Up! components separately at LEGO.com, and earlier in the year I was sent a set of them to review.

I wasn't sure how to do so at first, given that on their own they are not terribly exciting, until I had the idea of creating a Great Ball Contraption (GBC) module that used them in some way.

I'm not the first to use the Boost hub for GBC but I've not seen much evidence of widespread use, probably for two reasons: you need a phone or tablet to be constantly connected to it, and because it's battery powered it's not really suitable for use at public displays over several days where machines are expected to run faultlessly non-stop in a circuit of continually flowing balls.

So, if I was to make use of it and create something that could be used at displays I'd have to solve the power problem first. Luckily, I'm adept at wielding a soldering iron so it turned out to be relatively easy.

Advisory: This article contains explicit images depicting mutilation and modification of LEGO pieces. If you are of a nervous disposition, do not read any further.

Modifying the Boost hub

If the GBC module was to run for more than an hour or so it would need to be powered from a mains-connected 9v transformer. Originally I intended to drill a hole in the side of the hub and mount a small power socket in it, but the smallest one available is still quite big, and the internals of the hub meant that this was impractical.

So, instead, I cut a 9v power cable in half, mounted it on the bottom, drilled a small hole in the base of the battery compartment and wired it to the battery connectors inside.

View image at flickr

I drilled a few more holes through the sections of the battery box so the wires could be routed to the top.

View image at flickr

There, I soldered them to the battery connectors, and also put a dab of Gorilla glue under the 9v connector on the bottom to prevent it being pulled off and potentially stretching or breaking the wires.

View image at flickr

The form factor of the battery box remains the same so it can be neatly inserted back into the hub, leaving just the bottom connector as evidence of the modification.

With a standard 9v connector on the bottom my power options are now manifold...


Creating a power adapter

The hub could now be connected to a 9v train controller, like all other GBC modules, but that would not be particularly practical given the voltage can be adjusted and reversed, so instead I took the small power socket I mentioned earlier and made an adapter block using the other half of the 9v cable.

View image at flickr

Two 2x2x2 thin wall panels are used to both mount the socket and conceal the wiring inside.

View image at flickr

The hub can now be mains powered via the generic 9v transformer with interchangeable plugs that I bought on eBay.

View image at flickr

The hub will expect the power to be presented at the right polarity, of course, and finding out what that is is a matter of trial and error. Luckily it is not damaged if it's reversed.


The GBC module

The boost hub has two internal motors and two input/output ports to which a colour/light/distance sensor and external motor can be connected.

I therefore elected to create a small module that uses the colour sensor to detect the colour of the balls and send them down one of two paths.

Here's the end result:

The red wheel is an established and reliable method of moving single balls out of an input hopper. It's powered by one of the hub's internal motors.

View image at flickr

Th be brutally honest, the Boost hub is an ugly great thing and looks particularly unsightly tacked onto the side of the module. I could have attempted to mount it at ground level and use a series of gears to drive the red wheel but that would have introduced unnecessary complexity during this testing phase.

View image at flickr

View image at flickr

The external motor is mounted at the bottom and drives the mechanism that will send balls down one path or the other. The light sensor is directly above it.

View image at flickr

The 'Y' shaped piece is connected to the motor underneath.

View image at flickr

The light sensor is mounted above it. I added a brick or two around it to minimise the effect of ambient light which could affect the colour measurements.

View image at flickr


The Boost program

This is what needs to happen:

  • Start the red wheel moving to feed the balls to the sensor.
  • When the sensor detects a orange ball, turn the external motor one way to send the ball down the right hand path
  • When the sensor detects any other colour ball, turn it the other way to send it left.

I thought I'd also add functionality to count balls and calculate the flow rate, for which some variables are needed.

Here's the finished program. The main logic is in the middle thread:

View image at flickr

In pseudo-code:

  • Set variable a to 1 (the colour reading provided by the sensor when there's no ball)
  • Set variable b to 0 (count of orange balls)
  • Set variable c to 0 (count of other colour balls)
  • Set the internal motor running, power level 20, anticlockwise
  • Read the colour sensor
  • If the sensor reads red (close enough for orange balls)
    • Turn the light on top of the sensor orange
    • Rotate the external motor 120 degrees clockwise
    • Increment b
  • If the sensor reads a colour other than grey (a) (i.e. a white ball)
    • Turn the light on top of the sensor white
    • Rotate the external motor 120 degrees anticlockwise
    • Increment c
  • If the sensor reads grey, turn the light off

The thread at the bottom uses a variable d to count the number of seconds the program has been running, which will be used to calculate flow rate.

The thread at the top handles the display of the variables. Unfortunately only one value can be displayed at once, at the bottom of the screen, so it cycles through them:

  • Number of orange balls that have passed (b)
  • Number of white (or other) balls that have passed (c)
  • Total number of balls that have passed (b+c)
  • Length of time the program has been running, in minutes (d/60)
  • Flow rate, in balls per second ((b+c) / d)


Operation

Does it work? See for yourself. Note that in the video the Boost hub is powered from a Power Functions rechargeable battery to save running cables to power sockets.


Verdict

This has been a fun exercise, particularly given that I seem to spend every waking hour (when not running Brickset, of course) messing about with GBCs.

I wanted to see if it was practical to use Boost in a GBC module that's suitable for public display and I think I have done so. The prerequisite for this, powering it from the mains, is possible with a little modification.

Of course, I haven't solved the not insignificant issue of having to have an expensive piece of kit constantly tied up running the program: we will have to wait until the programmable hub in Spike Prime arrives to do that with the Powered Up! platform, but that will hardly be an inexpensive solution.

So far, the module has proved to be reliable in my test circuit but the real proof will be whether it is at my next public display, the Great Western Brick Show in Swindon, UK, 5/6 October. It's not the most exciting module by any means but it should entertain the public, who will no doubt ask how it works.

It does not quite meet the GBC standard of being able to handle 1 ball a second, although I could try speeding it up a bit in order to do so. However, in my experience that speed is rarely achieved for any length of time on a GBC circuit -- such a flow rate causes all sorts of problems -- so it's not really an issue.

I might also see if I can get the hub out of sight as base level given how ghastly it is!

For more information on GBCs see greatballcontraption.com and Planet-GBC.

The Powered Up components can be purchased at LEGO.com: USA | Canada | UK | Germany | France

If you'd like to see more articles like this, please like it and comment.


Thanks to LEGO for providing me with the Powered Up! components for this review, which is an expression of my own opinions.

22 comments on this article

Gravatar
By in United Kingdom,

I managed to successfully control a Boost Hub with a raspberry pi and the pyb00st libraries. You loose the visual programming language in exchange for python (but for many AFOLs that is probably an improvement) but you gain an inexpensive, stable, DC-powered device that can be easily integrated in a build with a commonly found studded case.

Gravatar
By in United States,

This is very cool! I would love to see more LEGO-modding stuff like this.

Gravatar
By in United States,

@brickwolf Now that's awesome. I've got a couple of pis laying around that I wasn't sure what to do with, which you've just solved! Do you know if you can control more than one hub per pi, or are you limited to one?

Gravatar
By in United States,

Maybe I just miised it, but if LEGO does not do a power supply for the line, it surprises me that LEGO does not have a transformer for use with these products in order to maximum their functionality. I get that it is for kids, and typically will it will mobile, but it is not like LEGO has not used power transformers before.
Sure the majority may want it battery powered, but one would think LEGO could do a power supply adapter and maybe make it only available via shop.LEGO.com or something for those looking to do big setups but need consistent uninterrupted power (and it would stop people from having to mod their sets to do such things as well)

Gravatar
By in United Kingdom,

I think it's all down to safety and the additional checks that mains powered toys have to go through. Presumably it's not worth their while any more.

I don't think we'll ever see mains powered Powered Up hubs. Rechargeable battery packs, and mains-powered chargers perhaps, particularly for educational products, like Spike Prime.

Gravatar
By in Netherlands,

That 9v adapter looks sexy. Is that weird?

Gravatar
By in United States,

Can we get an NSFW on this disturbingly violent mutilation of innocent plastic bits?

Gravatar
By in Australia,

Thanks for the reference Doctor!

Gravatar
By in United States,

Thanks fot the article.

Gravatar
By in United States,

The mutilation of bricks is disturbing

Gravatar
By in United States,

I would totally read more articles about this.

I am probably in the minority here, but I had now idea that GBCs are a big hobby of yours Huw.

I would love to do things like that, I just don't really have the money for stuff like that.

Gravatar
By in United States,

This was an interesting read. One thing I would do differently is instead of soldering directly onto the battery contacts, I would create fake batteries with wires (and probably some very thin wire connectors) coming out of them to the 2x2 wired brick/9 Volt adapter, that way you could easily switch between batteries and 9-volts in case you wanted to use the Boost hub for a different model.

Gravatar
By in United Kingdom,

I would totally read more articles about mocs and GBCs.
I would love to do things like that to

Gravatar
By in United Kingdom,

You could use this to sort skittles.

Gravatar
By in United Kingdom,

Oooo much as I normally hate the mutilation of LEGO elements, this was definitely an interesting read. Personally I'm not really one for messing around with electricity but Im quite happy to read about others doing it (provided they are not trying to earn a Darwin Award).

Gravatar
By in Singapore,

This hasn't completely made me want to build a GBC but it's definitely mildly inspired me! I do agree that there is a lot of unfortunately untapped potential for LEGO BOOST.

Gravatar
By in United Kingdom,

Unfortunately, having tested it again today I am concluding that using Boost is more trouble that it's worth:

- It can be difficult to connect the hub to the tablet. It can take multiple attempts, involving restarting both hub, tablet and/or Boost program before they connect. Not sure why because WeDo and Control+ are faultless in this regard.

- Every so often the light sensor stops returning valid values which causes either an orange ball to be mistaken for white or, worse, for both colour balls to fail to be recognised which then prevents any balls from passing through the machine which jams it up. Restarting the hub resolves this but it shouldn't be necessary.

The likelihood of it faultlessly running all day, thus providing accurate ball counts and so on, is negligible.

Gravatar
By in United States,

Huw, you are truly a monster. NO CUTTING PIECES!*

*Actually, I am willing to cut one part that technically isn't an element. You know the little bars that come in train sets to hold the tracks together? Apparently those are the width of a standard 318-style bar (more or less). So if I need a really short bar, I go find one of those. However, these are the only parts I am willing to modify permanently, because again they are not official parts.

Gravatar
By in United States,

I suspect that Boost in general is more trouble than it's worth. There is a hub gathering dust in our house.

This said, I very much enjoyed the article. More GBC please!

Gravatar
By in United Kingdom,

Is this the same module that you evicted from the circuit before the start of the show at Reading in March? ISTR you had the same problems then.

Gravatar
By in United Kingdom,

Yes! It's more reliable now but still not 100%. As @swogat says above, it's more trouble that it's worth...

Gravatar
By in Serbia,

This is so cool, thank you for the artice!

Return to home page ยป