RESTduino - Arduino hacking for the REST of us

I know a lot of web developers who want to get into Arduino hacking but feel like the learning curve is too steep or that they don’t have the time to get their heads around it.

I don’t necessarily agree with these reservations (these are smart folks after all) but regardless I created RESTduino to remove some of these obstacles.

RESTduino is a simple sketch (an Arduino program) that lets you talk to the Arduino using easy REST-like http requests.  For example, if you connect an LED between pin #9 and ground on the Arduino, you can turn it on using this request:

http://192.168.1.177/9/HIGH

...and off again like so:

http://192.168.1.177/9/LOW

If you want to set the LED to somewhere in the middle...

http://192.168.1.177/9/100

This request uses Pulse-Width Modulation (PWM) to provide an analog-ish output on any of the Arduino’s digital pins.

You can also use the pins for input like so:

http://192.168.1.177/9

...which returns a tiny bit of JSON data containing the pin number and it’s current value:

{“9”:”LOW”}

This can be used to read the position of a switch, for example.  If you want to read the range of something like a thermosister (temperature sensor) you can connect it to one of the Arduino’s analog pins and use a request like this:

http://192.168.1.177/a0

...and again a bit of JSON is returned:

{“a0”:”128”}

This REST approach makes interfacing the Arduino to web applications elementary (a jQuery example is included) and most platforms provide basic HTTP out-of-the-box so integrating with desktop and mobile applications is very straightforward.

Since network access is necessary you’ll need both an Arduino and an Ethernet shield to use RESTduino, both of which can be had from several places on the internet including Adafruit and Sparkfun.

RESTduino is designed to provide an easy way to get access to basic Arduino functionality.  I’m planning to add more (servo control is next).  More information and examples can be found on the github project page.

If you build something cool with RESTduino, please post a link in the comments (I'd love to check it out)!

 

 

About

The canonical source of Jason Gullicksonism.

Twitter