Go Down

Topic: SimpleSerialization - serial communication library (Read 3358 times) previous topic - next topic


Jun 13, 2009, 10:25 am Last Edit: Jun 13, 2009, 11:44 am by jaron Reason: 1
I was searching for a way to exchange data (strings, integers, floats) between an Arduino and a Java application. There are already several solutions to do this but none of them really met my requirements of simplicity and reliability. So I decided to write a library that implements a mechanism called serialization/deserialization. The now called SimpleSerialization library allows you to define a data structure (or object) that will be converted into a stream which then can be sent via a serial connection.

Project page: code.google.com/p/simpleserialization
Download: SimpleSerialization-1.0.zip

What you can do with it
- debug an Arduino application in a very convenient way
- remote control an Arduino
- setup a hardware-in-the-loop simulation
- and more

An example SimpleSerialization application could be to feed an Arduino with GPS data at 5Hz and attitude data at 30Hz. In return the Arduino would send the calculated actuator commands back at a rate of 10Hz. All this data would be exchanged via a single serial connection.

- an Arduino
- a serial connection from a PC to the Arduino
- the Arduino IDE
- a Java IDE (e.g. Processing or Eclipse)

A screenshot of a basic SimpleSerialization application in the Arduino IDE

The counterpart of the above application in the Processing IDE


This is interesting.  If you can serialize objects then next step might be to figure out how to do remote procedure calls.  Serializing  function arguments and return values  + identification of the function name = something like RPC or CORBA.  

So you can do something like this in Processing:

tilt = Remote:getAttitude():

Are you thinking along these line for your UAV environment ?  Or maybe communicating between multiple Ardunios ?

Thanks for a  useful addition to the Arduino world.

Bruce  :)


Jun 13, 2009, 08:56 pm Last Edit: Jun 13, 2009, 08:57 pm by jaron Reason: 1
I've tried to keep the library light and simple, that's why I didn't implement any of the existing protocols.

The SimpleSerialization library is part of my UAV Playground project and as such I use it for the implementation of an autopilot, for debugging and for a hardware-in-the-loop simulation.
The autopilot could run as a multi-processor application on different Arduinos and they could communicate via my library. I don't know yet how the final implementation is going to look like.

Go Up