A Serial Communication Extension for Scratch
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
sound effects



This is a Serial Communication extension for Scratch - it allows you to pass serial messages between the scratch interface and any serial device.

To run the extension, go to:


Download this repo, then go to File>>Load Project in Scratch and open the file called SerialDemo.sb2. Many blocks will initially load up red and undefined, that's ok.

Click "Load Experimental Extension", and paste in the following link:


Serial communication happens through a node.js server that must be running concurrently with scratch. To use the node server, first install nodejs:


this will also install the node package manager (npm), use npm into install the following dependencies from the terminal:

npm install -g serialport

npm install -g socket.io

Navigate to the parent directory of this repo in the terminal and run:

node nodeServer.js

to start the node server.

If you want to know more about how node.js, socket.io, and serialport allows your browser to communicate with serial devices, check out a simple demo of standalone node server with web client I wrote here.

I used documentation from the Lifelong Kindergarten Group to set up the Scratch interface for this extension. I'm working on a version of this extension that uses Scratch's serial browser plugin, but am still trying to get that up and running. The latest version of that code is in the branch "serialplugin".

I've included a sample Arduino sketch in this repo that listens for incoming serial messages and repeats them to test this Scratch extension.


Door sound effects from freesoundeffects.com
Bike Horn sound effect from soundbible.com
Swoosh sound effect from soundbible.com