"I just connected an Arduino Nano ESP32 to an external motor using an L293D motor driver. I also connected the same GND and 3.3V pins to an INMP441 microphone. As soon as I powered the L293D, the ESP32 became very hot and it burned itself to permanent death - the Arduino IDE doesn't find it anymore. I also want to mention that I didn't have connected the external battery to the L293D for this test. I tested both the motor driver and the INMP441 before I wired them up together. They both worked as intended. The L293D also didn't had a problem with not being connected to an external battery. My question is: Do the two components interfere? And when this is the case, how can I prevent this?" Maby add a resistor?
In this cases, in with the esp32 got killt, the Motor was only powered by the esp32 itself via the USB Connection.
But, a I sed, this was also the case, when I tested the Motor + L293D without the INMP441 - there it was no problem that the L293D only gets the power from the Arduinos USB connection and NOT from em external battery.
Very bad idea, as you have learned. Motors are high current devices that also generate device-destroying high voltage spikes and electrical noise. If the computer USB port survived, consider yourself lucky.
Use a separate motor power supply, and don't forget to connect the grounds.
Thanks for your diagnosis!
Would it be possible to answer two more questions?
Why worked it when no INMP441 was connected? Is is possible that the additional current draw from the Mikrophon added that little bit current that killed the esp32?
And why can the L293D force the esp32 to overload itself? When I connect the Motor to a normal Power supply, it only draws as much current as it gets from the supply.
The microphone is not the problem, although bad wiring to the microphone, like connecting the microphone power supply to ground, could have destroyed the on board voltage regulator, and hence, the ESP32.
Electrical spikes and current draw by the motor can also destroy the on board voltage regulator and hence, the ESP32.
Either could lead to destruction of the USB port. MCU modules are not motor power supplies, although with care, they can be used to power a couple of low current sensors or LED indicators.
What do you mean with this? Isn't it essential to connect the microphone to ground? Do you mean with "microphone power supply" the Arduino's MCU? The Microphone doesn't have a own power supply. What would be a better way of wiering?
I do not agree. You have gotten several great suggestions, they will get you going. Here are some simple rules:
Gil's Crispy Critter Rules, they apply to processor hardware:
Rule #1. A Power Supply the Arduino is NOT!
Rule #2. Never Connect Anything Inductive to an Arduino!
Rule #3 Don't connecting or disconnecting wires with power on.
Rule #4 Do not apply power to any pin unless you know what you are doing.
LaryD's Corollary's
Coro #1 when first starting out, add a 220R resistor in series with both Input and Output pins.
Coro #2 buy a DMM (Digital Multi-meter) to measure voltages, currents and resistance. Violating these rules tends to make crispy critters out of Arduinos.
Hint: It is best to keep the wires under 25cm/10" for good performance.
The L293 driver is not the best thing around, it will lose about 3V (burnt as heat) when driving both legs of the motor. I suggest you get one that has MOSFET outputs. This heat loss is battery power you will never be able to use. You will get that back with a MOSFET output device.