[PD] Pduino&Ping ultrasonic sensor&arduino

Marko Timlin susi at timlin.de
Sun Dec 23 23:39:53 CET 2007


Hi Martin, 
thanks so much for the helpful information.
I'll continue experimenting until I find the best way for my needs.
The EZ1 sensors you recommended seem very interesting indeed.
At the moment I'd like to use solar cells for light tracking and at the same time the Ping sensors for motion tracking. If that would be possible with the EZ1s as well, I'd be a happy man.
The solar cells are connected to the analog inputs of the arduino and  they work fine with Pduino.

But if someone is out there who is capable of creating a module for Pduino and the Ping sensor I'd be again a happy man.

Marko


Marko Timlin wrote:
> Moi,
> does anybody know, if it is possible to control the Ping(ultrasonic range 
finder)sensor using only Pduino (first uploading Pd-firmware to the arduino, 
and then using the "arduino" pure data patch?). It doesn't work for me at the 
moment.
>
>   
The Ping needs you to send a trigger and wait for an echo, and the delay 
needs to be precisely timed. Unfortunately pd can't communicate with the 
arduino or anything else outside the machine it's running on with enough 
timing precision to do that. (Sound travels about 1 foot per millisecond 
and the timing jitter with comport can be up to about 10ms, so your 
measurements will almost always be off by several feet.)

> If I write my own ping-sensor-patch for arduino and then use the  
PD_inputs_to_PD patch it works fine. 
>   
Because the serial communication timing is not involved.
> But I'd like to use several different sensors and it would therefore be much 
easier to just control all of them with Pduino and not writing new code for 
arduino all the time. Well, guess this was the original idea of Pduino anyways 
:-)
>
>   
The code for many sensors is almost the same as the code for one sensor, 
so it shouldn't be too hard.
If you must use Pduino, you could try one of the EZ1 sensors, it has an 
analog output that you can connect to an arduino analog in:
http://www.hvwtech.com/products_view.asp?ProductID=560
I've used it with Pduino with no problems.
I guess the other approach is to add modules to pduino that specifically 
handle specific hardware, but there is a _lot_ of hardware out 
there...the main ones that need doing are stepper motors (two or four 
pins have to change at the same time at precise times), servo motors 
(pulse width needs to be between 1 and 2 ms), and sonar sensors, as well 
as any hardware with a serial interface like servo controllers (serial 
data bits need to be accurately timed to about 2% of the data rate). 
Most everything else isn't as sensitive to timing.

Martin




More information about the Pd-list mailing list