Scratch Interface Device (SID)

Acknowledgement: Connection concept/original code supplied by Martin Bateman 🙂

Although a Raspberry Pi can be programmed to use Scratch to control the GPIO pins, because of the limited computing power of the Pi, once the Scratch scripts become  longer and more complex, it can become slow to use.

And if you want to control the pins from Scratch on a battery powered Pi, then you have to use remote viewing software (VNC) to do this.

However, there is another way of using the GPIO pins on your Pi – turn it into SID – a Scratch Interface Device – and simply use Scratch on a desktop/laptop PC and get it to remotely control the GPIO pins via a WiFi connection.

To do this, first follow the instructions to install my normal ScratchGPIO software and then install the extra software to turn your Raspberry Pi into a remote SID (Scratch Interface Device)

Installing SID

Your Raspberry Pi needs to be connected to internet to install the software.

Copy the text below ( left click just before the s of sudo and drag right until all the text in the line, up to and including, as been selected) then right-click and select copy. Open up an LX Terminal window and select Edit and the Paste that into an LX Terminal window and run it to download the installer..

sudo wget -O

then just type (or copy and paste as before)

sudo bash


Reboot your Pi

(If logged in as a different user, then type sudo bash yourusername)

PC Computer

At the moment, the software on the PC is a simple python program that allows you to enter which SID you want to use.  (As you might have a few in a classroom situation)

To do this download and run the following program on a Windows computer

Use this code for a Mac running Python 3.3

and then enter the last 4 digits of your Pi’s serial num and then press Connect. As long as you do this within 5 minutes of switching on your Pi, then it will connect.

You can find your RPi serial number digits by doing

cat /proc/cpuinfo

in an LXTerminal window on your RPi.

Put them into the above script and save it as

Getting your SID to connect to another computer

Reboot your RPi and after a couple of minutes yo should notice that the on-board green SD card activity LED is flashing the morse code for S (3 dots) This means your RPi is listening out for the next 5 mins for a connect message from your other computer.

Simply run the program on your main computer and then enter the last 4 characters of your RPi serial num that you found out earlier and press connect.

Watch the green LED on your RPi and you should notice that it changes to flashing an O in morese code (3 dashes) for 30 seconds and then goes out.

Finally, launch Scratch on your main computer and enable Remote Sensor connections (right click on bottom block in Sensing section)

You should then be able to run exactly the same Scratch scripts on your PC as you can on your Pi and get the same control of the GPIO pins.

If you have any problems – please contact me @cymplecy on twitter or mail simplecy at google

As I said @gbaman1 is developing a more featured version that I will hopefully be able to just use instead of my one-trick pony 🙂

I think the RPi should broadcast its last 4 digits or its serial number so that the program at the PC just needs to pick which one to connect to from a list.

7 thoughts on “Scratch Interface Device (SID)

  1. Hi Si,

    I’m getting:

    GnuTLS: A TLS warning alert has been received.
    Unable to establish SSL connection.

    When trying to install this. Any advice appreciated.

  2. Does the scratch editor on the PC or Mac, after Python add installs are made, then have the options to use GPIO pins in the editor if not connected to a PI?

    I’m wanting to be able edit a scratch script, on a PC, with the option to use GPIO pin command HIGH or OFF and then take it on a USB stick and load it on a PI and run the script that has the GPIO physical pins. I have got 6 laptops, but online one Raspberry PI and want groups to be able to code at the same time and then run the script on a single PI.

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 )

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