Workshop – Open Sound Control

In the workshop, Rob taught us about open sound control which is a protocol for sending data from different devices over the web.


The Control Interface used to send accelerometer data to the Mac


The Pure Data Extended Interface

I used a program called Control which used this protocol to send the accelerometer data from my phone to a Mac. As my phone was on the same Wifi network on the Mac we used a program called Pure Data Extended to listen to the port my phone was sending the accelerometer data, and this data was then routed to the speakers to make a sound.

This made me think that I could use the Open Sound Control for my project to send my accelerometer data from my toy to the web using a Wifi module to connect to the internet.



ESP8266 Serial WiFi Wireless Module (Gearbest, 2015)



Controlling an Arduino through Node

var j5 = require("johnny-five");
var board = new j5.Board();

var LEDPIN = 13;
var OUTPUT = 1;

board.on("ready", function(){
	var val = 0;

	//Set pin 13 to OUTPUT mode
	this.pinMode(LEDPIN, OUTPUT);

	//Loop to blink
	this.loop( 100, function() {

		this.digitalWrite(LEDpin, (val = val ? 0  : 1));


This is the code used to make the LED blink.

At the moment I have been using the Node package johnny-five to control my Arduino, which uses a similar protocol. In my test above, I ran tests to make the LED of the Arduino blink through javascript. Later this script can be embedded into a website rather than run through the console.

My thinking is that my app will send data requests through Wifi to the arduino which will then send back the accelerometer data it has recorded. However this may have problems where the arduino needs to connect and disconnect to the Wifi. If this does not work there are some other options I can take, such as using a Bluetooth module instead where a Bluetooth enabled device can request the data and if even this fails I can use a cable connection to send the data.

Wikipedia, 2015. Open Sound Control. [online] Available from: [Accessed 30 Nov. 2015].

Gearbest, 2015. ESP8266 Serial WiFi Wireless Module. [online] Available from: [Accessed 7 Dec. 2015].

Johnny-Five, 2015. Johnny-Five is the JavaScript Robotics Programming Framework. [online] Available from: [Accessed 7 Dec. 2015].