HC-SR04 sensor disturbance

Good morning everyone, I have installed on one of my projects an HC-SR04 ultrasonic sensor which measures the distance of obstacles in front of the "car" and makes a horn sound with the integrated PWM to simulate a parking sensor, however, when it gets dark, I created a light sensor with a Wheatstone bridge that detects light and below a certain level starts to adjust the power of the 12v headlights via an IRF3205, like the horn. However, when the lights come on, I believe that the high frequency signal that powers them creates a disturbance for my sensor, which goes crazy and makes the horn sound at random even if there is nothing in front... I tried to insert a low pass with 220ohm R and C of 10uF but in this way it no longer detects obstacles... can you recommend anything else? Thank you

You should post in a English in the English language forum sections.

I apologize for the mistake, I have modified

As far as I know, HC-SR04's output is not distorted by light.

Sounds like a power (not stable or strong enough) or ground (devices not using to the same ground) issue.

no, I'm using the same gnd for everyone, having connected it to the machine casing

It's not the light's fault, but I think it's the 12V signal that passes through the nearby cables, which is controlled with the PWM and which I think causes a disturbance

?

What else are you failing to mention in the drawing or pictures you have not shown?

Millions of "robots" are being successfully built every day using PWM physically near sonar.



these are the diagrams I created of the connections I made, the light bulbs are adjusted on the second page, while on the first there is the sonar diagram, in reality these two circuits are very close

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