Make: micro:bit BFG Dream Jar

For World Book Day my son dressed up as the BFG. So, of course, I had to make him a micro:bit dream jar!


I used the following equipment

  • 1 x pink jar bought from St John’s Hospice charity shop
  • Some bubble wrap
  • 1 x micro:bit
  • 1 x CodeBug GlowBug neopixel
  • 3 x white crocodile clips

I connected the glowbug to the micro:bit using the crocodile clips.

micro:bit GlowBug
0 Data In
3V 5V

I used white crocodile clips so they would be camaflouged in the bubble wrap.


  1. Create a new variable and call it myLights (Variables > Make a Variable)
  2. Set myLights to RGB Neopixels at P0 using the block below:


To save battery, the lights only come on when the micro:bit is shaken.

It randomly either shows a dream or a nightmare.

A dream:

The light flash from red, orange, yellow, green, blue 4 times with a pause of 200 milliseconds between them. They then clear.


A nightmare flashes quickly and randomly between red and white. The brightness is also random:


I should make my program more efficient by putting clear and show out of the if statement!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s