# Can't turn on 12v relay with output pins

**URL:** <https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255>\
**Category:** General Electronics\
**Created:** [December 6, 2022, 5:39pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255 "2022-12-06T17:39:09Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [December 6, 2022, 9:35pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/21 "2022-12-06T21:35:11Z")

</div>

> [@cjacobs61](#):
>
> I just added the code to the post,

Where ?

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [December 6, 2022, 9:46pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/22 "2022-12-06T21:46:05Z")

</div>

Just way too much current drawn seems to be the challenge,

---

<div class="post-metadata">

**Author:** ![cjacobs61](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cjacobs61/32/699028_2.png) [@cjacobs61](https://forum.arduino.cc/u/cjacobs61)\
**Post date:** [December 6, 2022, 9:51pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/23 "2022-12-06T21:51:30Z")

</div>

![20211130_141644](https://europe1.discourse-cdn.com/arduino/original/4X/8/1/8/8180328c0bda21a453573ad292ba574a476c307b.jpeg)

I have gotten it to work before with 15 pins driving relays on the board, not sure why ot suddenly won't cooperate.

---

<div class="post-metadata">

**Author:** ![cjacobs61](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cjacobs61/32/699028_2.png) [@cjacobs61](https://forum.arduino.cc/u/cjacobs61)\
**Post date:** [December 6, 2022, 9:53pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/24 "2022-12-06T21:53:42Z")

</div>

But why is it not too much current for the 5 and 3.3v pins?

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [December 6, 2022, 9:59pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/25 "2022-12-06T21:59:49Z")

</div>

- Try the test in post #18.

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [December 6, 2022, 11:24pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/26 "2022-12-06T23:24:49Z")

</div>

Because the current from those pins come from the power supply. The 3.3V regulated output is able to supply 150 mA max (limit of the 3.3V regulator) and the 5v pin way more than this depends on how you are powering the board but multiple hundreds of mA (up to 800 if my memory serves me well)

Contrast that with digital pins which can provide only a peak current of 40mA and should be kept at 20mA to play safe

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [December 7, 2022, 9:36am UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/27 "2022-12-07T09:36:29Z")

</div>

Hi,  
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?  
Hand drawn and photographed is perfectly acceptable.  
Please include ALL hardware, component names and pin labels.

We need to see a proper diagram as you have your circuit connected, reverse engineering can help find any errors.

Thanks.. Tom... 😃 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![cjacobs61](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cjacobs61/32/699028_2.png) [@cjacobs61](https://forum.arduino.cc/u/cjacobs61)\
**Post date:** [December 7, 2022, 3:50pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/28 "2022-12-07T15:50:02Z")

</div>

![20221207_104907](https://europe1.discourse-cdn.com/arduino/original/4X/1/1/0/110bde92586f58c8a0114a846dc84bbc1836b385.jpeg)

Here it is drawn out, power supply is 12v.

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [December 7, 2022, 4:07pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/29 "2022-12-07T16:07:04Z")

</div>

if you look at this [very similar board with only 2 relays](https://www.amazon.com/dp/B00LW15F42/ref=pd_rhf_d_dp_s_pd_crcd_sccl_2_2/146-5606078-9252208) they do state in the description

> Hinweis:  
> Dieses Relais wird durch DC 12 V ausgelöst, **kann nicht** mit dem Arduino-Signal bei 5 V auslösen.

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [December 7, 2022, 4:15pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/30 "2022-12-07T16:15:03Z")

</div>

**One last time.**

**Try the test in post #18.**

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [December 7, 2022, 5:05pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/31 "2022-12-07T17:05:09Z")

</div>

According to the Amazon link, This is the schematic of this board

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/7/3/9/739679fa7612e96e3b1aa6029c988766cb6bb5c0.jpeg)

So if you want to drive with 5v Vcc probably needs to be 5V and JD-Vcc will be 12V.

But for that you need this P9 connector, I don’t see it in the picture

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [December 7, 2022, 5:08pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/32 "2022-12-07T17:08:01Z")

</div>

The schematic they offer does not appear to match the PCB layout.

🤔

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/c/0/e/c0eb89d32651495b38de3198e3424c4b6a3083c7.jpeg)

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [December 7, 2022, 5:10pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/33 "2022-12-07T17:10:26Z")

</div>

Not a big surprise 😉

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [December 8, 2022, 5:13am UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/34 "2022-12-08T05:13:36Z")

</div>

Hi, @cjacobs61  
Please run this simple code and **observe the relay and the LED on the relay PCB**.  
Open the IDE monitor and set the baud speed to 115200.

The onboard LED on the MEGA should also flash ON for HIGH output and OFF for LOW output.

```cpp
byte relayOutputPin = 10;
byte onboardLED = 13;

void setup()
{
  Serial.begin(115200);
  Serial.println("==== Relay Test Code===");
  pinMode(relayOutputPin, OUTPUT);
  pinMode(onboardLED,OUTPUT);
}

void loop()
{
  digitalWrite(relayOutputPin, HIGH);
  digitalWrite(onboardLED, HIGH);
  Serial.println(" Output pin == HIGH");
  delay(1000);
  digitalWrite(relayOutputPin, LOW);
  digitalWrite(onboardLED, LOW);
  Serial.println(" Output pin == LOW");
  delay(1000);
}

```

Tom.. 😃 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![mikedb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/mikedb/32/1098613_2.png) [@mikedb](https://forum.arduino.cc/u/mikedb)\
**Post date:** [December 8, 2022, 6:31am UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/35 "2022-12-08T06:31:18Z")

</div>

> [@TomGeorge](#):
>
> Please run this simple code and **observe the relay and the LED on the relay PCB**.  
> Open the IDE monitor and set the baud speed to 115200.

Just a Note.  
The onboard LED Pin13 on the Nano will switch on when the Pin13 is Low , the Led is connected to the Positive supply so it will not follow the same ON/OFF pattern of what is measured on Pin13.

Not sure about the Mega on board LED but might be the same.

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [December 8, 2022, 6:37am UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/36 "2022-12-08T06:37:22Z")

</div>

Hi,

> [@mikedb](#):
>
> The onboard LED Pin13 on the Nano will switch on when the Pin13 is Low , the Led is connected to the Positive supply so it will not follow the same ON/OFF pattern of what is measured on Pin13.
> 
> Not sure about the Mega on board LED but might be the same.

All my Nanos have LED cathode to gnd, and flash ON when D13 HIGH, Mega is the same.  
[Arduino\_Nano-Rev3.2-SCH.pdf](https://forum.arduino.cc/uploads/short-url/dvrKOf2z7zzMPJpvAzcaY2PHMJS.pdf) (80.5 KB)

Tom.. 😃 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![mikedb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/mikedb/32/1098613_2.png) [@mikedb](https://forum.arduino.cc/u/mikedb)\
**Post date:** [December 8, 2022, 7:22am UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/37 "2022-12-08T07:22:37Z")

</div>

> [@TomGeorge](#):
>
> All my Nanos have LED cathode to gnd, and flash ON when D13 HIGH, Mega is the same.

Interesting.  
I did a long while back put a LED on pin 13 and the LEDS(with Blink) did not Blink together.  
I will for sure do the test again.  
Apology in advance for my mistake.

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [December 8, 2022, 7:55am UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/38 "2022-12-08T07:55:03Z")

</div>

> [@TomGeorge](#):
>
> All my Nanos have LED cathode to gnd, and flash ON when D13 HIGH, Mega is the same.

same here, also for UNO

---

<div class="post-metadata">

**Author:** ![cjacobs61](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cjacobs61/32/699028_2.png) [@cjacobs61](https://forum.arduino.cc/u/cjacobs61)\
**Post date:** [December 8, 2022, 4:03pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/39 "2022-12-08T16:03:56Z")

</div>

That code fixed it! I'm not sure what the difference is between how I was setting the pins to high vs this code, though.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [June 6, 2023, 4:04pm UTC](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255/40 "2023-06-06T16:04:41Z")

</div>

Closed on June 6, 2023, 4:04pm UTC

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

[Previous page](https://forum.arduino.cc/t/cant-turn-on-12v-relay-with-output-pins/1062255.md?page=1)
