Learn, Play & Create

Why Moonhack is not another meaningless attempt to break a World Record

Last year, the Australian Code Club had 10,207 Australian kids participating in their free coding event, Moonhack. This year they are not holding back and they are turning the 15th of August into a worldwide event so kids (and not-so-kids) from all around the globe can take part and collaborate.

The event’s aim is to have as many young people from 8 to 18 years old coding as possible and set a World Record. However, the project goes way further than that: by bringing together people and getting them to code for a specific purpose they want to spread a love for coding and trigger a passion for it in future generations. This aligns directly with pi-top’s mission and beliefs. Learning to code can help young people strengthen their problem solving skills and logical thinking as well as their resilience when dealing with things going wrong. In this digital age that we live we think that it’s important to provide kids with the necessary skills and knowledge to thrive in a world of accelerating advancements, for both their personal and professional lives. Moonhack is a great place to start as it provides a fun environment that can either be structured or treated as an open, creative sandbox, depending on your preference.

blog post


Moonhack is an inclusive event, so is coding. Everyone is welcome to participate, regardless of their skill level, age, gender or country of residency. Even if you don’t fall inside the age range, you can participate and submit your project, but it will not be counted for the World Record.

At pi-top, we think taking part in the Moonhack is a great idea, especially if you’re looking for something fun to do over the summer holidays so why not sign up on Moonhack’s website and get involved. Once you’re sign up,  you will have access to tips, ideas and project guides. On the 15th of August you will be able to upload your moon-themed project made in Scratch, Scratch JR or Python to make sure it’s included in the official record-breaking project count. For those that prefer to follow a project, do not panic, there are also open source Moonhack projects that you or your kids can complete, with easy to follow instructions for any level of learner.

So go on, sign up. Learn. Play. Create… And break things digitally!

Spooky pi-topHALLOWEEN Tutorial

Give your pi-top or pi-topCEED a haunted feel this Halloween with this spooky jack-o’- lantern tutorial!

Before we get started, this is the boo-tiful equipment required to achieve the ghastliest effects:

  • 5x yellow witches boil LEDs
  • 1x blood red LED
  • 6x 100 Ω reVolting resistors
  • 1x pi-topPROTO (or breadboard)
  • A few standard wires
  • 1x acrylic slice (included with your pi-top or pi-topCEED)
  • Access to a laser etcher (optional)
  • 1x pi-top or pi-topCEED

So, let’s get started by transforming our pi-topPROTO board into a magic dancing candle.

Step 1: Wire LEDs to your pi-topPROTO board

Screen Shot 2016-10-28 at 17.53.37.png
  • The red LED should be wired to pin 22(GPIO 25) on your pi-topPROTO board
  • The yellow LEDs should be wired to pins 11(GPIO 17), 13(GPIO 27), 16(GPIO 23). 29(GPIO 5), 32(GPIO 12)

The red and yellow lights will create a spook-tacular orange hue for your laser etched jack-o’- lantern acrylic slice!

Step 2: Wire LEDs to ground

Screen Shot 2016-10-28 at 17.55.35.png
  • Wire the cathode (negative pin) to the ground rail on your pi-topPROTO board, to keep things neat we have done this on the back of our pi-topPROTO board as seen in the image above!

Step 3: Use resistors to connect your LEDs to GPIO pins

Screen Shot 2016-10-28 at 17.57.45.png
  • Next, we need to wire the yellow LEDs to RPI pins 11, 13, 16, 29 and 32
  • The red LED should be wired to pin RPI pin 22
  • This will complete the full circuit

Now, we are almost there! Put the following Python code into the pi-topCODER editor and click run to test it:

import random
from time import sleep
from gpiozero import PWMLED



while True:
    RED_LED.value = random.uniform(0, 0.5)

    for led in YELLOW_LEDS:      
        led.value = random.uniform(0, 0.5)
    sleep(random.uniform(0, 0.5))

The code uses randomised pulse width modulation (PWM) in order create a candle flicker effect!

Finally, we need to etch our spooky acrylic slice – the design can be downloaded in docx format (see below). We recommend you convert it to a dxf file that can be used with a laser etcher 🙂

Download the docx file here: halloween

Here is our ghastly haunted pi-top acrylic slice:


Eerie green halloween……. 😉

So, for the final effect. Let’s run our code again!

Here is your spooky phantom pumpkin finished project!


How to install pi-topOS to a microSD card

A simple guide for anyone who wants to install pi-topOS to a microSD card.


You will need:

  • MicroSD card
  • A computer with microSD card slot, or an adapter to connect microSD to your computer (e.g. SD or USB adapter)

Next steps are to:

Step 1Download pi-topOS from our website.

Note: Please make sure that you are always using the latest release (you can check this by comparing the date in the filename to the date in the release on our OS download page).

Step 2 – Insert the microSD card that you want to write to into your laptop or PC.

Hint: all of our microSD cards ship with an SD card adapter, and you will likely need to use this (or a microSD-to-USB adapter) to connect to your computer.

Let’s get started!

There’s a great tool called Etcher, created by an Internet of Things company called Resin.io. This software has been specifically designed to write operating systems to SD cards and USB drives.

It works the same on Windows, Linux and OS X (trust us – we’ve tried!) and is incredibly easy – with only 3 steps!

1) Select the zip file that you just downloaded. You could extract the image onto your hard drive first, but Etcher is clever and extracts the file whilst it writes, so why bother? 🙂
2) Select the SD card from the list. If there are multiple drives that are available, make sure that the drive you select is the correct size, to prevent writing to the wrong drive. If you are not sure which drive to write to, then remove all other drives until only the SD card is in the list.
3) Click ‘Flash’!
That’s it! Etcher will install pi-topOS for you (AND it also verifies that it was 100% correctly written). Then all you need to do is plug the microSD card into your Raspberry Pi, and switch on the device.
If, for some reason, this is not working for you, then check out this blog post for another way to get it working or reach out to us via support@pi-top.com

All the best,


Keep to the beat! – Heart Rate Monitor Tutorial

Last tutorial in our LED trilogy! If you haven’t – then check out our Light It Up!-LED Tutorial and CEED Universe Compass Tutorial.

Components needed: 

  1. ADS1115 x 1
  2. LDR x  1
  3. LED x 1
  4. 510 kΩ Resistor x 1
  5. 5 Ω  Resistor  x 1
  6. Wires x 11
  7. pi-topPROTO board x 1

Background: This project was created with hearts in mind. It demonstrates and reveals a technique to measure the heart rate by sensing the change in blood volume in a finger artery while your heart is pumping! Compared to our last two tutorials, it is a bit more complex; however, it is perfect for an inter-curricular class or a fun family project for the weekend.  

Step 1: In this tutorial you will learn to make a heart-rate-monitor with an LED circuit on the pi-topPROTO board.

Step 2: The diagram below illustrates how the components should be soldered onto the pi-topPROTO board:





Step 3: To build this circuit on the pi-topPROTO board, solder the LED to the board.


Step 4: Next solder in the resistor and complete the circuit using a wire.


Step 5: Now solder in the LDR (Light Dependent Resistor), its accompanying resistor and complete the circuit using another wire.


Step 6: The next step is to solder in the analogue to digital signal converter (ads1115) into the pi-topPROTO board.



Step 7: Connect the ads1115 to the 5V power supply.




Step 8: Connect I2C connections (SCL and SDA) on the ads1115 to pin 5 and pin 3 on the board respectively.



Step 9: Connect the ADDR pin to the GND pin on the ads1115 so as to define the I2C address on the ads1115 as 0x48.



Step 10: The next step is to move onto the python code! This can be done on your pi-topCEED. After you have booted your pi-topCEED up: click on the Main Menu, accessories and then open up a terminal window as seen in the screenshot below.



Step 11: Type in “sudo idle &” into the terminal to open up idle 2 which will allow you to create a run python scripts on the Raspberry Pi!



Step 12: Once the python shell environment has opened up, click File and then New to open up a new text editor. This text editor is where you will type your code, save and run the project! Once you run the project on the text editor the results will be displayed on the python shell environment that was previously mentioned.



Step 13: The next step is to now copy the code below in the python text editor:

import matplotlib.pyplot as plt

import matplotlib.animation as animation

import time

import Adafruit_ADS1x15

import pylab

import numpy as np

from scipy.interpolate import interp1d

from scipy.signal import butter, lfilter, filtfilt

# from scipy.interpolate import spline

#get plot and draw axes

fig = plt.figure()

ax1 = fig.add_subplot(1,1,1)

moving_y = []

xaxisthings = []

startTime = time.time()

secondsShown = 5

secondsCalc = 5

plotHz = 20                        

totalWidth = plotHz*secondsShown

Oversample = 5

allY = [0]*plotHz*secondsShown

allX = [0]*plotHz*secondsShown


#function to set the next y value

def new_y_value():

   time.sleep(1/(plotHz * Oversample))

   return Adafruit_ADS1x15.ADS1115().read_adc(0, gain=16)


def animate(i):

   #add a new y value, and remove the first

   totaly = 0

   totalx = 0

   count = 0

   for j in range(secondsCalc * plotHz * Oversample)

       totaly +=new_y_value()

       totalx +=time.time()-startTime


       if count == Oversample:



           count = 0

           totalx = 0

           totaly = 0

   while len(allY) > (secondsShown*plotHz):






ani = animation.FuncAnimation(fig, animate, interval=1)




Step 14: After creating your code, click on “File” and then “Save as” to save the code that you have written so that you can come back to it and run the code whenever you want!

Step 15: After saving your code, put you finger in between the LED and the LDR and press F5 to run your code and see your heartbeat displayed across the screen as seen in the image below!

Heart Rate Monitor.png

CEED Universe Compass Tutorial

This is the second tutorial in our trilogy. If you missed the first – please check out our Light It Up! – LED Tutorial for pi-topCEED.

Components needed: 

  1. LED x 4
  2. Resistor(100Ω) x 1
  3. Wires x 8
  4. pi-topPROTO board x 1


Background: Now that you know how to build one LED, we can step it up to the next level and build an LED compass. This can be useful when you are travelling or lost your way through the vast CEED Universe. Check your direction by using your own LED compass to guide you

Step 1: In this tutorial you will learn to make a compass on an LED circuit on the pi-topPROTO board.

Step 2: Below is a image of how the circuit should be connected with the LED soldered in place first (please follow the link here to take you to our video showing you how to solder onto a pi-topPROTO board).

led_compass_schem 1.png

Step 3: The next step is to solder the resistor in place.


Step 4: The next step is to solder the wires that connect the LEDs to the GPIO (General Purpose Input Output) port pins that will detect the signals being sent from the code when the CEEDUniverse game is being played so that you can see if you are getting closer or further away from your target destination. To learn more about GPIO pins please follow the link here.


Step 5: Once the circuit has been soldered in place (please follow the link here to take you to our video showing you how to solder onto a pi-topPROTO board,) all you have to do is slide the pi-topPROTO board into the HUB and run the CEEDUniverse game to use the compass! You can watch a short video showing you the final product below. 




Light It Up! – LED Tutorial

Today we are ecstatic to announce that we have started shipping out our pi-topCEED. To get you started we’ve prepared a trilogy of projects. Let’s start the plug & play!

Components needed: 

  1. LED x 1
  2. 100Ω Resistor x 1
  3. Wire x 1
  4. pi-topPROTO board x 1

Background: LEDs are a particular type of diode that convert electrical energy into light. In fact, LED stands for “Light Emitting Diode”. They are all around us in daily life: in our phones, our cars and even our homes. It is highly likely that when something electrical lights up – there’s an LED behind it. For more on LEDs check out this link here.
Step 1: In this tutorial you will learn to make your first LED circuit on the pi-topPROTO board, that can be found by following the link here.
Step 2: This image below shows you diagram of the LED circuit and an empty pi-topPROTO board onto which the projects can be built!


led circuit_schem  1


Step 3:

  • Below is an image of how the circuit should be connected, with an LED, 100Ω resistor and a wire to complete the circuit.
  • The resistor is connected to ground and the negative terminal of the LED; a wire is connected to the 3V3 power source and the positive terminal of the LED. The longer of the two LED terminals is the positive terminal.


Step 4: Once the circuit has been soldered in place (please follow the link here  or watch it belwo, to take you to our video showing you how to solder onto a pi-topPROTO board,) all you have to do is slide the pi-topPROTO board into the HUB!

We would warn you to be very careful with soldering and take the necessary precautions! 🙂
If you are interested in learning more about LEDS please follow the link here. Or, continue with the next Tutorial: CEEDUniverse Compass Tutorial.