[Sharing is fun] SARCuino

Mar 16, 2010 at 9:49pm

[Sharing is fun] SARCuino

SARCduino is a sensor acquisition protocol developed for the Arduino and Max/MSP environments by PhD and Staff of SARC. It samples the 6 analog and 12 digital pins of the microcontroller, and sends them to Max/MSP via the serial port.

What it is:
A simple way to poll data from the Arduino into max at a fixed sampling rate.
Also, there is a visualisation module that allows to check if your sensors are doing what they are supposed to do. Note that this module uses [multislider] for showing graphs and thus is not very efficient. The graphs should only be used for quick visualisation of sensor activity and not be left running constantly on the background.

What it is not:
A system to control the Arduino from max.

The patch has an OSC out section which can be used to send sensor data to other programs. MIDI out is being implemented but it will take some time before it is released.

Comments, suggestions and improvements are welcomed but do not expect full customer support. This firmware/patch has been used for the last 3 years in the interaction design modules at SARC and seems very solid.

you can download it here:

http://www.sarc.qub.ac.uk/~MuSE/?p=138

hope you find it useful

– Miguel

[attachment=127396,232]

Attachments:
  1. SARCduino.png
#49191
Mar 18, 2010 at 4:25pm

Very cool.
Thanks a lot for sharing.
Do you know if a sample rate of 1000Hz is ok (if I change the argument of your metro object ) ? I think it’s the maximum in Max scheduler, right ? But do you know if the Arduino can do the trick each ms ?
Thanks again
C_°

#176714
Mar 22, 2010 at 8:40pm

Hi C_° ,

It could kind of work but I would not recommend it.

At the moment there is no query of data from max to the Arduino, the latter is throwing data at a fixed sample rate that gets buffered in the serial port. From there, max gets the messages that have been passed by the arduino. To change the sampling rate you would need to change the metro in max and the sampling freq on the arduino sketch. However, the bottleneck would be serial-through-usb communication. We did try to see how fast it would go and had less than spectacular results with higher sampling rates. On the sourcecode of the Arduino sketch there are some links to the discussions on this.
We are sending 10bit values (0-1023) for six analog inputs and 12 digital. If you edit the firmware and the patch you could get up to 1k but not for all channels.

I am looking at a fully OSC version on my spare time but is nowhere near ready and it would require an ethernet shield on the arduino to bypass the usb/serial issue.

best

– Miguel

#176715

You must be logged in to reply to this topic.