1 power supply for many components

Hey !
I'm currently trying to make a automatic chess game, where the pieces move "alone". It's basically a electromagnet moving under the board. To move this electromagnet, I am using shafts with carriages, and a pulley system controlled by stepper motor.
My problem is that I don't know how to power my project.
I have 2 stepper motors (links are below) that work at 2.8V and 2A. To control these stepper motors, I use 2 A4988 modules (with an integrated potentiometer to control the current). The brain of my project is an Arduino Mega (which also needs to be powered). As for the electromagnet, it works at 12V and 0.25A.
I'm following this tutorial for my stepper motors :

However, in this tutorial only one stepper motor is controlled.
My question : has anybody got an idea to power:
- 2 stepper motors,
- 1 Arduino Mega,
- 1 electromagnet,
with only one power supply ?
PS: is it a problem if the stepper motors don't get their rated power ? I guess they will be less powerful but that's not a problem for this project.
Stepper motors:

A4988 module:

Electromagnet:

Possible power supply ?:

For the moment, I haven't purchased any of these components so if you have better ideas, feel free to propose them.
I'm a noob in electronics so please be indulgent,
Thank you very much for your help !

Love the idea but how will you jump the knight over other pieces, how to castle with pieces in the way and how do you remove pieces that are taken? Few issues that need to be solved along with the control mechanisms...

wolframore:
Love the idea but how will you jump the knight over other pieces, how to castle with pieces in the way and how do you remove pieces that are taken? Few issues that need to be solved along with the control mechanisms…

Don’t worry, taken care of already.

For the power supply: use a 12V power supply that can supply plenty of current for the two steppers (5-6A would do), use a buck converter to step it down to 5V for the Arduino and other logic components. Remember to add decoupling caps to the A4988s.

wvmarle:
For the power supply: use a 12V power supply that can supply plenty of current for the two steppers (5-6A would do), use a buck converter to step it down to 5V for the Arduino and other logic components. Remember to add decoupling caps to the A4988s.

Thank you ;D .
I had a few electronic bases missing like the fact that even if my power supply can provide 5A, my Arduino will only takes what it needs.
However, I read in the Arduino Mega official doc that 12V was not dangerous for the board:
"The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may become unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts."
So is a buck converter useful ?
And just to be shure: the decoupling caps are the capacitors to be connected to the power supply, like shown on this circuit schematics ?

Again, thank you for your help !

That it can doesn't make it a good idea. It has a linear regulator on board, at 12V input this has to drop 7V, that's 700 mW dissipation at a very basic 100 mA, meaning your regulator can very easily overheat and shut the whole thing down. It's OK for quick testing but anything more permanent needs a proper power supply. A buck converter is more efficient and therefore reliable.

That decoupling cap is 100-220 uF placed near the motor power input. Don't use a breadboard for 2A currents.

wvmarle:
That it can doesn't make it a good idea. It has a linear regulator on board, at 12V input this has to drop 7V, that's 700 mW dissipation at a very basic 100 mA, meaning your regulator can very easily overheat and shut the whole thing down. It's OK for quick testing but anything more permanent needs a proper power supply. A buck converter is more efficient and therefore reliable.

Ok, if you say so , thanks.

wvmarle:
Don't use a breadboard for 2A currents.

What would you suggest I use ?

Properly soldered wires that are sufficiently thick to carry those currents with minimal losses.

wvmarle:
Properly soldered wires that are sufficiently thick to carry those currents with minimal losses.

Oooh ! Sorry, I read motherboard and thought that you weren't recommending an Arduino : ...
My bad, thank you for your help ! I consider this problem as solved ! (or almost )

Hey, one last thing:
As said before, I'd like to power my arduino with a external power supply (12V, 5A) but I also need my arduino to be connected to a computer via the serial port (for the computer to do the processing). However, I don't want my arduino to be powered by the USB port of the computer (even if I could).
I read on the Internet that to be powered by the external power supply and not the USB port, the power supply must have a voltage > 6.6v.
But you previously said that above 5v, it could be "too much" for the arduino.
How can I use the serial port of the Arduino for communication only (not for powering) ?
Do I remove the buck converter ?
Thanks !

Cut the +5 wire of the USB cable (not the ground). That’s the only way to be absolutely sure.

I routinely do basically the same thing using an external USB/TTL converter, connected to Tx, Rx and Gnd of an ESP8266 based project - using the same for programming. My latest project (ATmega1284 controller, PCB in production, hope it all goes as planned) I only added a Tx/Gnd connection, using SoftwareSerial for debugging. Both hardware serial connections are in use for peripherals, those are more important than the debug output which will be disabled, and programming is done over ISP.

Normally you’ll power the Arduino with 5V to the 5V pin. That 6.6V has to do with the Vin (and barrel jack) connections.

wvmarle:
Cut the +5 wire of the USB cable (not the ground). That's the only way to be absolutely sure.

I routinely do basically the same thing using an external USB/TTL converter, connected to Tx, Rx and Gnd of an ESP8266 based project - using the same for programming. My latest project (ATmega1284 controller, PCB in production, hope it all goes as planned) I only added a Tx/Gnd connection, using SoftwareSerial for debugging. Both hardware serial connections are in use for peripherals, those are more important than the debug output which will be disabled, and programming is done over ISP.

Normally you'll power the Arduino with 5V to the 5V pin. That 6.6V has to do with the Vin (and barrel jack) connections.

Thanks for the quick answer ! What would I do without you !
Guess I just have to do that ! I thought that the 5v pin could only give power and not be connected to a power supply ! Thanks again !
PS: Good luck with your project !

That 5V pin is not a useful power source… for anything more than a few sensors and an LED. Especially when powering through the Vin pin.