Powering on and off two PC's with one Arduino

Hello again everyone, I was recently tasked with creating an Arduino circuit that is able to power on and off two pc's with just one button press. I was given a 6 relay module to work with, but this is my first time using a relay or trying to do anything related to turning on and off a pc with a Arduino, so would anyone have any advice going about this project? Any help is greatly appreciated, thank you.

Use the relay contacts across the on/off front panel button of the PC .
Probably best to mount a small socket on the PC for this rather than trail leads .

If this is all that is needed you don’t need the Arduino
Just power the relays via your push button.

Have a google for options - wake on lan for example

2 Likes

I'm assuming that this is some kind of assignment that precludes taking the easy way out and doing as @hammy suggested - or even simpler, plugging the two PCs into the same power bar and using the power bar switch!

Perhaps begin with turning on and off two LEDs with one button press. That will get the logic straight.

Then figure out what's needed to turn on and off a single relay in your relay module. Does it need a transistor? Flyback diode? Or is it a nice simple optocoupled low power input that you can connect directly to an Arduino output. This is the part that might be easy, or might take some time, depending on your hardware.

Then advance to turning on and off two relays with one button press.

From there it ought to be smooth sailing.

2 Likes

This can cause problems with the operating system, you can trash it. Check how they would implement a UPS shutdown and use that as a guideline. You will probably have to have some software running on the PCs and tell them they are going down.

1 Like

Thank you for the reply, this is actually for a project on my own. I'm more so confused on what to plug into the normally open and the common ports of my relay, and also how I would get this to work with two pc's. Would I just cut open the power supply cable for one pc, and plug it in like this diagram shows below, then do the same for the other pc on a different relay?


Thank you for the help, and sorry if my questions come off as stupid, this is my first time using relays, and my second ever Arduino project.

You have not made a distinction between shutting down the PC by telling the operating system to save all the necessary stuff and then shut it's self down. Power is still on to the PC.
Or are you simulating an AC power failure which will require manual intervention to get the operating system back running properly.

1 Like

Given your apparent level of knowledge, I won't be offering any advice on how to play with line voltages. Lawyers, liability and lawsuits. It's just the world we live in today.

1 Like

Ok, thanks for the help anyway though!

Before you hurt yourself get somebody local that knows about mains power. An electrician would be a good choice.

I’m sorry, but I can’t provide an answer on that topic due to legal reasons and potential liability concerns. If you have any other questions or need assistance with a different matter, feel free to ask!

Line voltage is not fun to play with. Get a professional
Plus PC's do not like to be shutoff that way. You create a lot of fragmented files that will shut you down eventually. Put a defrag utility in the startup folder might help.
There are remote switches to restart PC's and related equipment APC is one company to look at.

Switching the mains on/off is not the way to go, as said earlier the OS won’t like it .
Either interface to the power button or investigate other options as I mentioned .

Understand how PC’s boot and shutdown , how relays work , look at other methods ( something on the LAN to start the pc ?
Maybe get one PC to start the other over the network ?)
THEN decide how to do the project

Or … just buy something off eBay to it ….

Example

1 Like

Thank you for the help, I will do this.

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