Hello so I have fried I guess 2 ESPs during a project. I have a ESP8622 but the pins are not sufficient (even though I added 74hc595). I'm thinking of buying another ESP32, but I want to make sure to not fry this one, here's my project in a nutshell:
PS: I want to specify that there were a lot of changes during the making of this project, for example, at first I was only using a HW-131 and a 18V adapter, then I changed the adapter to 12V 2A one, then I powered the HW-131 through this adapter (which fried it), then I removed the HW and I'm currently only working with the 12V adapter
Existing system: A client of the company I'm an intern in has an irrigation system, and he wants to automate it and enables controlling the system from France. The system is a 380V moto pump that is bidirectional and can only be at one state at a time. The system has 3 exclusive states:
- P (puits which means well) means that the pump pulls water from the well and stocks it in a storage tank.
- R (repos which is like stop) means the whole system is at a stop.
- I (irrigation) means that the motor pumps water from the tank to the fields of olives or almonds (they can't be both on at the same time). The choice of fields is also chosen manually. (O and A).
Objectif: Make a prototype using ESP presenting the solution. I chose it to be controlled through Blynk and I decided to add a "planning" mode, and a safe planning if Wifi or Blynk fails to connect.
Components: 12V 2A adapter, L298N (for the pump), 3 relays (for the micro electro valves), 1 LED and a buzzer (to blink if I is chosen and no field is chosen), 5 buttons, a water level sensor, and an RTC module (I'm still not sure whether to use this or not).
PS: I'm using the LN298 as a 5V provider because I dropped the HW-131, for the electro valves, I'm using 3.7V batteries.
Blynk: Here's what I did until now (cause it's not finished), I'll add the water level of the tank later:
The problems I have: obviously me frying everything and me not knowing how to treat the 12V and its high current. I suspect this is what fried the HW-131 because at one point it was powered by it, and one ESP32 uploads the code without any problems (with everything off), the moment I plug the adapter, it gives me weird resetting error (invalid header: 0*0ffffff if I rememebr or something like this).
I know this isn't the best way to present a project, I have an unfinished report if anyone wants to take a look at my vision of the project and the system's constraints. Also, I know someone at least is going to ask for a diagram, I'll attach it as soon as I make it in fritzing. Thanks in advance for anyone who can help me.
Note: I found a 9V 1A adapter, should I use it instead of the 12V 2A?? Will it be able to give current to relays through the L298N's 5V output?
Here's the diagram!






