Hi all. I'm very TIRED of this problem. I'm struttglind with it from weeks now. Here it's the problem:
I have: 1) Arduino 2) sr04 ultrasonic sensor 3) esp8266 wifi board and other parts that are not relevant to the problem.
I'm testing distance with sr04 every half seconds (now I'm using pulsein, but i tried newping library and interrupts with the same results). Sometimes (maybe 5 minutes, maybe 15 minutes) i get totally wrong distance (example: 100cm instead of 250)
I'm pretty sure it's something related to power supply, because the esp8266 drains a lot of currents. After a lot of trying I ended up doing something like:
Both Arduino and sr04 has a 100uF and a schottky diode so their capacitors aren't discharged by other components in the circuit. The main voltage regulator is set to 5.4v, to compensate the voltage drop through the diodes.
But the problem is still there. PLEASE help me