Wroom 32 Wifi Not working while using 12V

As the “Subject Line” states, when I use my 12v input my wifi fails to boot up. Additionally I have attached my code and diagram for review. Is it my program or wiring that fails? Thanks for looking.

#include "WiFi.h"

// Replace with your network credentials
const char* ssid     = "ehh";
const char* password = "Dehhrm";

// Set web server port number to 80
WiFiServer server(80);

// Variable to store the HTTP request
String header;
// Auxiliar variable to store the current output state
String outputState = "off"; //initially set to off
String outputDirection = "n/a"; //initially no direction

// Shade Inputs 
const int LSUin = 16;
const int LSDin = 17;
const int RSUin = 18;
const int RSDin = 19;
const int LSU = 21;
const int LSD = 22;
const int RSU = 23;
const int RSD = 25;

void connectToWifi(){
  // Connect to Wi-Fi network with SSID and password
  Serial.print("Connecting to ");
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
  // Print local IP address and start web server
  Serial.println("WiFi connected.");
  Serial.println("IP address: ");

void setup() {
  // put your setup code here, to run once:
  pinMode(RSU, OUTPUT);
  pinMode(RSD, OUTPUT);
  pinMode(LSU, OUTPUT);
  pinMode(LSD, OUTPUT);
  pinMode(LSUin, INPUT);
  pinMode(LSDin, INPUT);
  pinMode(RSUin, INPUT);
  pinMode(RSDin, INPUT);
  stopMotors(); //ensure motors are off on initialization
  connectToWifi(); //rui example

void stopMotors(){
  digitalWrite(LSU, LOW);
  digitalWrite(LSD, LOW);  
  digitalWrite(RSU, LOW);
  digitalWrite(RSD, LOW);


void leftup(){
  Serial.println("left up...");
  digitalWrite(LSU, HIGH);
  digitalWrite(LSD, LOW);
  digitalWrite(RSU, LOW);
  digitalWrite(RSD, LOW);

void leftstop(){
  Serial.println("left stop...");
  digitalWrite(LSU, LOW);
  digitalWrite(LSD, LOW);
  digitalWrite(RSU, LOW);
  digitalWrite(RSD, LOW);

void leftdown(){
  Serial.println("left down..."); 
  digitalWrite(LSU, LOW);
  digitalWrite(LSD, HIGH);
  digitalWrite(RSU, LOW);
  digitalWrite(RSD, LOW);
void rightup(){
  Serial.println("right up...");
  digitalWrite(RSU, HIGH);
  digitalWrite(RSD, LOW);  
  digitalWrite(LSU, LOW);
  digitalWrite(LSD, LOW);

void rightstop(){
  Serial.println("right stop...");
  digitalWrite(RSU, LOW);
  digitalWrite(RSD, LOW);
  digitalWrite(LSU, LOW);
  digitalWrite(LSD, LOW);  

void rightdown(){
  Serial.println("right down...");
  digitalWrite(RSU, LOW);
  digitalWrite(RSD, HIGH);
  digitalWrite(LSU, LOW);
  digitalWrite(LSD, LOW);   

//Create a web server on local network address
void createWebServer(){
  WiFiClient client = server.available();   // Listen for incoming clients
  if (client) {                             // If a new client connects,
    Serial.println("New Client.");          // print a message out in the serial port
    String currentLine = "";                // make a String to hold incoming data from the client
    while (client.connected()) {            // loop while the client's connected
      if (client.available()) {             // if there's bytes to read from the client,
        char c = client.read();             // read a byte, then
        Serial.write(c);                    // print it out the serial monitor
        header += c;
        if (c == '\n') {                    // if the byte is a newline character
          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:
            client.println("HTTP/1.1 200 OK");
            client.println("Connection: close");

            // Motor Control (On & Off)
            if (header.indexOf("GET /control/leftup") >= 0) {
              outputState = "LEFT SIDE ON";
              outputDirection = "Moving Left Side UP";

            } else if (header.indexOf("GET /control/leftstop") >= 0) {
              outputState = "LEFT SIDE OFF";
              outputDirection = "LEFT STOPPED";

            } else if (header.indexOf("GET /control/leftdown") >= 0) {
              outputState = "LEFT SIDE ON";
              outputDirection = "Moving Left Side Down";

            } else if (header.indexOf("GET /control/rightup") >= 0) {
              outputState = "RIGHT SIDE ON";
              outputDirection = "Moving Right Side UP";

            } else if (header.indexOf("GET /control/rightstop") >= 0) {
              outputState = "RIGHT SIDE OFF";
              outputDirection = "RIGHT STOPPED";

            } else if (header.indexOf("GET /control/rightdown") >= 0) {
              outputState = "RIGHT SIDE ON";
              outputDirection = "Moving Right Side Down";
            } else if (header.indexOf("GET /control/stop") >= 0) {
              outputState = "ALL OFF";
              outputDirection = "Shades Stopped";

            // Display the HTML web page
            client.println("<!DOCTYPE html><html>");
            client.println("<head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
            client.println("<link rel=\"icon\" href=\"data:,\">");
            // CSS to style the on/off buttons 
            // Feel free to change the background-color and font-size attributes to fit your preferences
            client.println("<style>html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}");
            client.println(".button2 { background-color: #a15dd9; border: none; color: Black; padding: 15px 40px; margin: 25px");            
            client.println("text-decoration: none; font-size: 22px; margin: 2px; cursor: pointer;}</style></head>");
            // Web Page Heading
            client.println("<h2> WIFI SHADE CONTROLLER </h2>");
            client.println("<p> Take control of your Shades from anywhere on your home network! </p>");
            client.println(" ");
            client.println(" ");
            // Display current state, and controller buttons for shades 
            client.println("<p>Shade State " + outputState + " Shade Direction " + outputDirection +"</p>");
            client.println("<p><a href=\"/control/leftup\"><button class=\"button2\">LEFT UP</button></a></p>");
            client.println("<p><a href=\"/control/leftstop\"><button class=\"button2\">LEFT STOP</button></a></p>");          
            client.println("<p><a href=\"/control/leftdown\"><button class=\"button2\">LEFT DOWN</button></a></p>");
            client.println("<p><a href=\"/control/rightup\"><button class=\"button2\">RIGHT UP</button></a></p>");
            client.println("<p><a href=\"/control/rightstop\"><button class=\"button2\">RIGHT STOP</button></a></p>");
            client.println("<p><a href=\"/control/rightdown\"><button class=\"button2\">RIGHT DOWN</button></a></p>");
            client.println("<p><a href=\"/control/stop\"><button class=\"button2\">ALL STOP</button></p>");
            // The HTTP response ends with another blank line
            // Break out of the while loop
          } else { // if you got a newline, then clear currentLine
            currentLine = "";
        } else if (c != '\r') {  // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine
    // Clear the header variable
    header = "";
    // Close the connection
    Serial.println("Client disconnected.");
**** More Code but did not fit.*****

Which ESP32 board do you have and where are you connecting the 12V supply to ?

By applying 12V directly to a Wroom 32, you may not get WiFi, but you will be able to send Smoke Signals.

Sorry I could not post the image right away as there was an error uploading then I had to wait.

Here it is.



ESP32: I think the average is below 100mA, but with 250mA peak.
(12V - 5V) * 100mA = 0.7 Watt.

That is the heat that the voltage regulator on the L298N board has to dissipate. That can be a problem when it has no heatsink.
Which L298N module do you have ? Can you give a link to where you bought it ?

Sure it was amazon

specs here

Key Specifications:

  • Operating voltage range: +5 to +46V.
  • Maximum supply voltage:50V.
  • Maximum Input and Enable Voltage:+7V.
  • Maximum current output: 3A.


  • Operating voltage: up to 40 volts.
  • Drive voltage: 5V-35V.
  • Logic voltage: 5V.
  • Peak current: up to 3A.
  • Logical current: 2A.
  • Control signal: standard TTL logic level.
  • Rated power: 25W.
  • Can drive: two-phase stepper motor, four-phase stepper motor, and two-phase DC motor.


  • TTL Compatible Enable Input. The LOW state for disable.
  • TTL control inputs.
  • Total power dissipation:25W.
  • Operating temperature: -23°C to 130°C.
  • Storage Temperature: -40°C to 150°C.

but with 250mA peak.

280mA i’d say, particularly during WiFi connecting. As a quick fix i would try adding a fair sized capacitor (100uF) to the 5v Rail.

ok thank you

Ok Addis a cap on the 5v rail did it thank you

It would be even better to move the cap from the 5V line to the 3.3V pin on the ESP32.

It would be even better to move the cap from the 5V line to the 3.3V pin on the ESP32.

I’m quite sure that the ESP32 has a capacitor on the 3.3v rail, but if there is no capacitor on the 5v rail, the regulator may not work properly. According to the module’s schematic there is a 220uF capacitor on the 5v rail already, but that may not have been big enough. The issue may even be that there is no (dedicated) capacitor on the 12v input to the 7805. I usually do a diode 1N4001, then a capacitor and then the 7805 and then another capacitor.

I ran into more issues. For some reason, only one dc motor works now and I am back at square one. I've attached my configuration to address it if you all have time to look at it I would appreciate it.



Well there is the possibility that the 7805 that is on the module just isn't enough to drive the ESP32 & the logical chip (though the logical chip should draw much current)
Then there is the possibility that the 12v power you connect can not deliver enough.
And it is possible that the 3.3v logic levels that the ESP is putting out are not sufficient for the chip to work (not very likely though)
And then i had a look through your code and realized that

void leftup(){
  Serial.println("left up...");
  digitalWrite(LSU, HIGH);
  digitalWrite(LSD, LOW);
  digitalWrite(RSU, LOW);
  digitalWrite(RSD, LOW);

Turns off the right one and

void rightup(){
  Serial.println("right up...");
  digitalWrite(RSU, HIGH);
  digitalWrite(RSD, LOW);  
  digitalWrite(LSU, LOW);
  digitalWrite(LSD, LOW);

Turns off the left. The functions for the left motor should not interfere with the pins for the right and vice - versa.

So simply put, I am shutting it down as soon as I turn one on?

So simply put, I am shutting it down as soon as I turn one on?

Pretty much as far as i can tell.
All the functions that turn the left or the right on or off should do just that. Turn on or off (or reverse) that side, and not modify (or turn off as it is now) the other side. The function that turns both off can stay as it is.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.