Controlling 6 Electromagnets using ESP32 Board

Hello,

I would like to use the ESP32 Board to power 6 electromagnets (Keyestudio Electromagnet Module). I was wondering how exactly I would go about doing this. I only need to turn the electromagnets on and off.

I understand I need an external power source. Would a 9V battery be enough? Is it as simple as connecting each electromagnet to a digital pin and dividing the power among the 6 electromagnets?

PS: I'm sorry if I am missing anything major. I am very new to circuits, especially using electromagnets.

No, no, no.
You need a driver, either a relay driver or transistors to handle the electromagnets.
9 volt battery? The kind used in fire alarms? No, no, no.
The Arduino outputs have the capacity of 20 mA.
What voltage do those electromagnets need? That's good to know when buyin the drivers.

I am planning on using these electromagnets:
https://wiki.keyestudio.com/KS0320_Keyestudio_Electromagnet_Module_(Black_and_Environmental-friendly)

In their wiring example, they did not use a driver (I'm assuming their board has some sort of built-in driver?). It says the working voltage is DC 5-12V. That's why I mentioned the 9V battery.

Would I still need the drivers when working with these electromagnets?

Following that link I read"No text available".
You need to post information about that stuff.
20 mA is the max for an Arduino output, and voltage is Vcc, 3.3 or 5.0 volt depending on whuech controller. I can't tell about the ESP family.

Try clicking on this hyperlink.

Regarding the power supply, I believe that the VIN pin for the ESP32DevKit V1 board can accept anywhere from 5-12V since it has a built-in voltage regulator.

asterix80:
I believe that the VIN pin for the ESP32DevKit V1 board can accept anywhere from 5-12V since it has a built-in voltage regulator.

Highly unlikely that the regulator can withstand the heat associated with dropping 12volt to 3.3volt@100mA (with 500mA transmit peaks).
Let us know how long it did last on 9volt or 12volt, before releasing the magic smoke.

Railroader:
20 mA is the max for an Arduino output, and voltage is Vcc, 3.3 or 5.0 volt depending on whuech controller. I can't tell about the ESP family.

The ESP32 is not an Arduino. And 3.3volt processor I/O usually tops at 7-12mA.

The solenoid boards seem to have built-in drivers, so that part is ok.

I would start with a 5volt/2Amp (or higher current) supply, and power the solenoid modules from that supply.
You might also be able to power the ESP32 from that supply, on the V-in (raw, USB) pin.
Leo..

That magnet takes a maximum of 300mA so you need at least a 2A power supply.
The magnet also has a FET driver on the board. However the FET type is unknown so it is highly unlikely that you can turn it on with a 3V3 signal from the ESP32.

As others have said keep clear of the regulator on the ESP32 it simply is not up to the job.

So to summaries, you need an external power supply and a transistor to shift the output for each magnet board.

If I were to use a 5V / 2A power bank as an external power supply, would I just connect a USB cable to the power bank and split the other end into the power and ground wires that can connect straight into the circuit?

Grumpy_Mike:
So to summaries, you need an external power supply and a transistor to shift the output for each magnet board.

Also, I'm not sure what a transistor does. Where would it go? And why do I need it?

A transistor can take your 3V3 output from your ESP32 and make it into a 5V signal that is high enough to turn your magnet board on.
Search for transistor as a switch
You will need a NPN transistor and two resistors.

a USB cable to the power bank and split the other end into the power and ground wires that can connect straight into the circuit

Yes but you need also to gone cut the negitave wire to both your relay board and the ground of your ESP32.

The module might work with 3.3volt logic, but since there is no diagram or parts list, you have to find that out.
Leo..

The only FET I know that might work off 3V3 signals is https://uk.farnell.com/infineon/irlb8743pbf/mosfet-n-ch-30v-78a-to220/dp/1740785