Arduino communicating with Pure Data……

I downloaded various software from the Arduino website for communication between Arduino and Pure Data.  These are Arduino2PD, Pduino-0.3.1 and SimpleMessageSystem (all of which can be found at http://www.arduino.cc/playground/Interfacing/PD)

First I uploaded the code to the Arduino board that I downloaded from the Arduino website (http://www.arduino.cc/en/Tutorial/UltrasoundSensor) I had zero success locating the sensors output within Pure Data with Pduino-0.3.1 and Arduino2PD, yet the SimpleMessageSystem seemed to locate this information instantaneously and outputted the numbers (that represented the distance the sensor was reading) as a list within Pure Data. 

Here is the updated patch includiInsert/edit link (Ctrl+a)ng the SimpleMessageSystem.

 Click Here 

I have also modified this set up with 3 array tables that can play back 3 separate audio files.  This is with the intention of experimenting with having different audio that triggers at different distances. 

The [route list float symbol] connects via the list to a number message, this message receives the data from the ultrasonic sensor, the data is then passed onto the various [threshold] objects that trigger either the audio or video at set distances.

Here is a video of the sensor triggering a change in video.


This is all fine and dandy as a prototype, but there is a problem…

The sensor has a measuring distance of 3 metres, which is a good length but the problem in that the width of the sensors range, it is quite narrow.  I have tried placing the sensor a various heights and had minimal improvement, but it does seem that the best position is for the sensor to hit you right on the nose (a premise that is advocated by various forums I had read about ultrasonic placement) But it is still not good enough as the results are often erratic and temperamental.

The solution is to have multiple sensors so that the sense of field is widened.  I have downloaded a multiple sensor code for the Ping.  Tim had a look at the code the other day and we managed to get it working with Pure Data with the signals being received one after the other for the ‘multiple’ sensors (albeit we were only had one sensor but the principle was there)

This opens up another problem though…..

The [threshold] object waits until it receives a distance from the sensor that is lower then the value set and then it alters the visuals or audio.  When the distance rises above this number it switches back.  The problem is that if there is only one [threshold] object is receiving information from, say, three sensors, it will get confused as which number to read.  As if one sensor drops below the threshold rate and the other two sensors stay above this number it would flip the video or audio uncontrollably back and forth and behave erratically….not what I had in mind.

The way to solve this would be to employ some sort of gate to the threshold.  The idea being that if the [threshold] object received a distance from one sensor that was below the threshold rate then the gate would block all information from the other sensors and the threshold would only read the sensor that is currently below the threshold rate. 

When said sensors distance rises above the threshold rate then the gate would open allowing the other sensors to be read again and control the imagery.

This is possible I know. I think I may need the help of a Mr Ed Kelly….. 



0 Responses to “Arduino communicating with Pure Data……”

  1. Leave a Comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

February 2008
« Jan   Mar »

%d bloggers like this: