Spikes in HC-SR04 ultrasonic sensor

Hello,

I am new to this and i have started with HC-sr04 to detect object , it does work but when i leave it for a while i can see spikes, please check the attached picture.

I also looking for a way to add temperature compensation if possible if there is an example that will be great.

Thanks
spikes_1

Start here

1 Like

Have you tried it in a sound-proof room? I'm afraid there is no way to prevent your sensor from hearing ambient noises in the 40 kHz range. Try jingling some keys and see if you can induce spikes.

You can use a formula for speed-of-sound values:

You may also want to compensate for humidity and barometric pressure.

1 Like

Thanks a lot Johnwasser, yes it might be the noise, by the way i placed the sensor inside a very closed plastic (its a valve) however i think it might be the noise so i might try to use different sensor for measuring.

An optical time-of-flight sensor would be immune to noise and I don't think the speed of light in air changes enough with temperature to worry about.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.