[PD] [OT] Using a webcam to measure a wheel's rotation speed

Roman Haefeli reduzent at gmail.com
Thu Sep 2 18:19:25 CEST 2010


On Thu, 2010-09-02 at 17:54 +0200, Matteo Sisti Sette wrote:
> Hi,
> 
> I need to measure the rotation speed of a spoked wheel.
> 
> As an alternative to a suitable sensor + arduino, I was considering 
> using a webcam placed very close to the wheel and counting the frequency 
> at which the spokes pass in front of the webcam.
> 
> Has any of you tried anything similar? Do you have any suggestions?
> 
> 
> My naïf idea is that if a (natural or artificial) source of light is 
> placed in front of the webcam, when the spoke passes in front of it, it 
> will reduce considerably the brightness of the whole frame or of a big 
> portion of it.
> 
> I'm looking for something simple: if this eventually leads to a 
> complicated artificial vision task, or if a good calibration is 
> difficult to achieve, then I would rather go for a tachometer and an 
> arduino...

I don't think that using a camera for this is the best approach. It
certainly depends on a few parameters like expected rate and such, how
suitable a certain approach is, but using a camera - even if the
expected rate is lower than the frame rate of the cam - adds a huge
computational overhead. For rates close and above the fps it is even
more difficult if not impossible. 

The arduino approach is likely easier to implement, depending on what
kind of sensors you can use. If you use a light barrier consisting of an
LED and a light dependent resistor (LDR), you just need an additional
resistor for building a voltage divider that can be directly hooked up
to an analog input of the arduino.

You could do it even without using an arduino at all: hook up the
resistor/LDR to your sound card input and use [dfreq~] from zexy to
measure the rate. I think you can't get a more precise setup than this
(by using the high sample rate of a common sound card). I once used that
to measure the speed of a turntable.

Roman

 




More information about the Pd-list mailing list