
New to HA and the ESP32 integration with Energy for water metering. Now the sensor have been in test detecting metal most of the time for about 24 hours without any false readings.īTW, I’m using a different sensor for easy placement: To get rid of those phantom readings I did some filtering in the code: sensor:

This got rid of most of the problem but still there was a few pulses every minute.

My solution was to connect a 200nF condensator (I did no calculations) between signal from the sensor and GND and instead of supplying power to the ESP32 via the USB-port, I connect the 5v from the USB directly to VIN on the board and supplied the sensor from the same source. When looking at the closed (detected) state in an oscilloscope there was a lot of noise in the signal, on top of that the voltage from the ESP32 was only 4,4v. I found the ptoblem in two places: Electrical noise from the sensor and low voltage to the sensor.

When metal was detected the sensor counted on its own.
