smoothing analog values

Hi,
as in "nickdatz" post a few days ago "Readings varying when using ultrasound sensor", I have some erratic readings.

I was looking for a software solution but you suggested a hardware one.

Will the same values (R=10k and C=100nF) apply with this hardware (IR sensor) ?

If the hardware solution doesn't fit, should you have a sample of an averaging of datas ?
thanks, bonne annee
eric.