Before submitting this request I searched over ESPHome website and the forum but I have not find any solution, but if I missed anything, please let me know.
I’m trying to create an automatic water system. I had one before with no issue until one day it stop working, so I decided to update the system and create a new one.
My system is composed by an ESP32 + HC-SR04 + Relay + Water Pump. Before starting with the welding of the cables, I tried all the system in a test board and all was working correctly, but once I weld it it’s not working properly. The issue is that the Relay continues to open / close (you can here the tic tic tic noise) and the water pump continues to go.
To weld it, I used this schematic that I created, and after checking the code, I think that the problem could be possible from here, so I’m hoping that you can help me:
The code in this moment calculates with the ultrasonic sensor the capacity of the tank, to avoid activating the water pump if there is no water, but for the switch / Relay I have this code.
Does sound like a floating pin possibly. Also how long is the cables from ESP to relay. Long wire to signal pin might be picking up stray signals and firing off.
It seems to me that the relay isn’t getting enough power and is never fully switching. It was probably sheer luck that conditions were exactly right for it to activate on the breadboard. Try moving the relay board’s power supply to 5V.
I would also be careful running the pump off the board’s 3.3V regulator, they aren’t designed to provide very much current, and you are adding a source of electrical noise right onto the microcontrollers nice clean 3.3V rail
@cbib05 I don’t understand what you mean by Output inverted, but I tried changing it to 5V as suggested, but the issue persist or you mean switching both power supplies to 5V?
@Mahko_Mahko The pullup option, as for what I searched, it’s only for binary sensors or I misunderstood something? Wiring I tripled checked and it’s all as indicated in the picture. For another Pin i can try, any suggestions?
Try to run it with the sensor not attached. If it doesn’t click on/off without sensor then it was sensor triggering it. That may narrow down problem. Do the logs in Esphome show the sensor triggering it?
I have a screen shot of Andreas Spiess’ “priority 1” pin list in my ESPHome working directory and have had waaaayyy fewer dramas since I started using them first.