Using relay and separate 12V power supply

Hi, I’m very new to arduino(refered by a friend and coming from raspberry pi) and am using one to program my high school thesis project.
I need to power a 12V DC solenoid valve to release compressed air and 4 12V computer fans. I was going to use a relay to control these, but the arduino only provides an output of 5V. Is there any way I connect a separate 12V power supply to the relay for power, but use the arduino to control the relay. Sorry if this is a very simple question, I couldn’t find much on using the relay with the separate power supply.


A low-cost relay board would be a good solution. They are available with 2,4 or 8 relays that can be controlled by Arduino.
See this page:

You can use a 12V power supply that is adequate for the solenoid and fans to also power the Arduino.

Do you need to control the fans separately?

What is the voltage and current requirements of the solenoid? The fans?

As alternative to relays, look into using a MOSFET to switch these devices. Often the better solution for switching low voltage DC.

Thank you, I’ve got it figured out, or at least I think I do. The fans and solenoid will be running at the same time so they don’t need to be separate. Both run on 12V, I don’t know about the fans but the solenoid draws a current of 540mA.