So I wanted to play around with relays and clearly got it wrong even before I got started. I wanted to control a 12 Volt fan - thinking that it would have a capacity of 12 V to control.. But now I know that it takes 12 V input and can control upto 250VAC...

I have ordered some new 5 Volt relays, but want to know how I can use the 12V relay with an arduino _____________? (bear in mind that I'm a newbie)

This is the relay module I bought: enter image description here


Thank you all so much for finding your time to help me out, I really appreciate it! First now I found the time to try out your suggestion.

@jippie comment:

..(or Vin on Arduino if you are feeding it from a 12V supply)

got me think about what I really wanted. I wanted to use the 12V power supply to also feed the arduino (hehe..) - but posting the question I needed to know the anwser to whether an "under"-powered arduino could control a 12V relay.

But first validate that the relay is actually working! So found a 12 V adapter and connected it to a breadboard.

12V adapter Then connected it to the relay by NC and COM relay connections Compiled the Blink code example and hooked it up using Vin, GND and D13 Relay working with 12 V I then hooked my Arduino to a 9V battery and tried the 5V output Not working relay with 5V Unfortunately this did not work..

@Madmanguruman and @Kurt thank you both for your answers - I'm just too newbie to figure out all the things you were talking about.


Forgot one more possible combination Relay not working

This kinda brings me down to these options with my relay:

  • Control something that requires more than 12 Volts, but power the arduino with 12 Volts
  • Use it to control DC gear motors without using and H-bridge and diode (kinda expensive)
  • Use the NC (Normally Closed) and NO (Normally Open) logic to do something neat

All this got me thinking.. If I need to power my Arduino with 12 Volts to control a 12 Volts device - why don't I just connect my device directly to my Arduino ____?

As mentioned many times: I'm a newbie and just want to learn electronics mostly by Learning-by-doing - but without putting myself at risk and breaking things (like my Arduino)

But why would this not work:


simulate this circuit – Schematic created using CircuitLab


Controlling 12v DC motorfan with arduino

Firstly, even if a motor or pump or fan (anything with coils inside) is 3V or 5V, do NOT power it directly from the Arduino pins as the Arduino pins can only supply a maximum of 40mA. As per my previous article on Arduino pins, they are not designed to drive a DC motor or coils.


Using 9V and Vin also worked :) Using 9V and Vin

So guess the answer is:

  • Yes, but I have to use >= 9V (perhaps lower, but not 5V) and the Vin.
  • \$\begingroup\$ Side question: The case your arduino is in, where did you get that? \$\endgroup\$
    – Passerby
    Commented Apr 13, 2013 at 18:02
  • \$\begingroup\$ Congrats on getting it to work. You should maybe look into learning about some hardware components like transistors. That is my big complaint about arduino - it gets people to play, but they mostly just copy what other people have done, never learning anything on their own or actually understanding how anything works. \$\endgroup\$ Commented Apr 13, 2013 at 19:46
  • \$\begingroup\$ @Passerby I laser cut out myself and bend so it looked like flames. Do you want to buy one? \$\endgroup\$
    – Norfeldt
    Commented Apr 13, 2013 at 20:20
  • 2
    \$\begingroup\$ Right, that's kind of what I meant - it encourages people to "play" but most of the people who use it never go beyond blinking a few lights because they never try to learn anything else about electronics, and the ones that do are still just copying other people's work to get some larger scale project to work without knowing a thing about what is going on. I'd don't have a problem with Arduino when it comes to learning and encouraging, I just wish people would learn something for themselves to expand upon the tutorials not just copy them. Often times there are much better ways to do something. \$\endgroup\$ Commented Apr 13, 2013 at 23:06
  • 1
    \$\begingroup\$ You added a second unrelated question, you should create a new question instead. But shortly, the Arduino is a 5v system, the 12v is regulated down to 5v. The Arduino pins are all referenced to it's VCC which would be 5v by default. 12v would kill it. And a motor is most often high current draw, so it would kill the limited current pins. And finally, you have not tried using the relay's vcc from the arduino VIN pin, when powered by the 9v battery. \$\endgroup\$
    – Passerby
    Commented Apr 14, 2013 at 22:25

5 Answers 5


I'll leave the long talks to the other answerers. If the exact module you bought is the one on the picture then:


  • GND to GND on Arduino
  • Vcc to 12V (or Vin on Arduino if you are feeding it from a 12V supply)

At this moment I would verify the voltage on pin IN, this should be near 0V with respect to GND, if it is higher than 5V stop here. If it is near 0V, the last step is to connect:

  • IN to the digital output pin you conotrol on Arduino.

So my answer is: If memory serves me right, my answer is: yes you can drive this type of module from Arduino.

  • \$\begingroup\$ hmm pretty much the same answer as Madmanguruman already gave, didn't see that before. \$\endgroup\$
    – jippie
    Commented Apr 8, 2013 at 6:47

This board is designed to work with 5V logic level control, according to the link you provided. I couldn't find a spec sheet so the following is speculative: you supply +12V and ground to the VCC and GND pins, and use a logic level signal on the IN pin to switch the relay on and off via Q1 and the optoisolator.

So, if the logic level signal can control Q1, your relay may actually work as-is. Changing the relay itself may not help if Q1 can't deal with 3.3V gate drive. (Q1 is marked 'J3Y', so it may be an NPN transistor known as 'S8050'. A logic-level MOSFET like a 2N7002 may work better in this application. Again, pure speculation without a spec sheet.)

There's nothing inherently wrong with your relay as far as controlling a fan goes. Overkill, sure, but it will do the job just fine and will scale up to allow you to play with bigger stuff as your confidence grows.


First off, a common automotive relay would work plenty fine, unless you are trying to switch power for a high voltage device or you really wanted that opto-coupler in there.

In any case, take a look at this simple circuit: Relay Control

Because a logic Level MOSFET is used, the transistor only needs a small voltage at the gate to fully turn it ON. When the signal from the microcontroller is HI, it will turn the FET ON, connecting the relay to ground and powering the fan or other devices. When the MCU pin is a LO signal, Q1 will turn off. If the MCU is disconnected or the pin is in some unknown state (hi-Z, for example) the resistor R1 will pull the gate LO to turn the transistor off. either way, when Q1 turns off, the relay will also disconnect the power to the fan.

This circuit could be similarly made with BJT transistors; I just prefer FETs. The only thing to consider here is that the transistor must be able to sink at least as much current as the relay coil uses when the relay is switched on.


You tried powering the relay from a 12v power supply and it worked, but when you tried a 5v supply, it did not.

Try connecting the Relay's VCC to the Arduino's VIN, which would be the 9v. The relay requires 75% of the nominal voltage to "Pickup". 12v * 0.75 = 9v. That's the bare minimum that is needed for the relay to activate. So your 9v battery might not be enough, but a fresh one should.

Once it's activated, the relay will consume about 25~30mA, and should, according to the datasheet, stay on until the VCC goes down to about 10% of the nominal, which is 1.2V.

AND you could simply power the arduino from the 12V power supply in the first place, instead of the low capacity 9v battery.


This is because even I had the same problem. So all u need is a high voltage (12v) transistor and the other parts : arduino, 12v adapter and relay. Now connect the vcc of relay to 12v adapter. Now connect the one end of the transister (refer to data sheet) to 12 adapter connect the middle pin of transistor to one of the pwm pin of arduino . Program the arduino to be high on the pwm. Connects the last end of the transistor to the relay 12 v signal pin and you are good to go When the pwm pin is high the 12v flows through from the transistor to the last pin and here is how you control 12v relay with 5v pwm arduino

Thanks Swaton


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.