Hi guys!
I have a huge problem with my circuit. I did not see any mistakes, could you please help me find any?
I created this circuit:
To make a shelf with locks controlled by ESP 8266 NodeMCU v1 and mobile app.
I used MOSFET IRLZ44N, IN5819 diodes, LM2596 Buck 12V -> 5V, PSU 12V/12.5A and 330ohm, 10kOhm resistors. I know it's a liitle messy but I did my best.
Here is a litlle code I made for control only one lock for now:
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
const char* ssid = "";
const char* password = "";
IPAddress local_IP(192, 168, 1, 192);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress dns(192, 168, 1, 1);
const int lockPin = D6; // GPIO12
ESP8266WebServer server(80);
void handleUnlock() {
Serial.println("Otwarto!");
digitalWrite(lockPin, HIGH); // otwarcie zamka
delay(300); // 200 ms
digitalWrite(lockPin, LOW); // zamyka
server.send(200, "text/plain", "Unlocked");
}
void setup() {
pinMode(lockPin, OUTPUT);
digitalWrite(lockPin, LOW);
Serial.begin(115200);
delay(100);
// Ustawianie statycznego IP
if (!WiFi.config(local_IP, gateway, subnet, dns)) {
Serial.println("Błąd ustawiania statycznego IP");
}
WiFi.begin(ssid, password);
Serial.print("Łączenie z WiFi");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();
Serial.print("Połączono! IP: ");
Serial.println(WiFi.localIP());
server.on("/unlock", handleUnlock);
server.begin();
Serial.println("Serwer HTTP działa.");
}
void loop() {
server.handleClient();
}
When I firstly attached one MOSFET with one lock everything worked and lock opened. When I added 4 more the ESP Overheated and stopped working, I can't even upload any sketch for that.
I have no idea what did go wrong, do you have any ideas?
PS. I'm sorry if I forgot about something, it's my second post.
Thank!