Hello all,

I would like to implement a digital low pass filter using TinyOS and I'd
to hear comments or ideas for it.

The situation is as follows:

I have telosB mote under a light bulb which is regulated by a dimmer. When
light bulb is off or giving low power, the PAR-sensor readings are clean,
but as the light bulb is given more power, the signal becomes noisy; in
full power the variability of the signal is of about +/-200 lux.

I suspect that this variability is due to the 50Hz AC Current with which
the light bulb is supplied, and I would like to filter it to get a clean
signal.

Proposed filter:

alpha = dt/(RC+dt);

y = alpha*x + (1-alpha)*y_previous

with:

dt = 200 (Sample rate, 4-5 times higher than the frequency to be filtered)
RC = 1/(2*pi*50) (time constant)
x = raw reading from the sensor
y, y_previous = filtered values

To implement this I would have a repeat timer with would fire the ADC
acquisition and in ADC.dataReady the filtering would be made.

Is such an approach right? Are there better ways to do it? Comments and
suggestions are welcome.

Thank you,

- J.

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to