Arduino Mega cannot keep 4 channel 5V Relay Powered

As a project I'm turning on several electronics (fans, leds and a motor) running at 12V DC through this 4-channel relay ( http://wiki.sunfounder.cc/index.php?title=4_Channel_5V_Relay_Module ).

When running the system, after a few seconds (10-30sec) the entire relay module turns off and the arduino resets itself. I also ran the program without any load on the relays, and this phenomenon still occurs. From my understanding after a little time the arduino is not able to provide the relay with the current required to maintain it operational.

I have tried placing a 470uF capacitor across the GRD and VCC of the relay to mitigate potential hicups on power delivery from the arduino, but this just caused the relays to begin quickly shutting on and off after those 10-30sec of operation.

I'm considering adopting a different power supply to feed the triggers on the relays, considered there is a JDVCC pin (powers relay triggers) but the only voltage I have available is 12VDC aside from the arduino 5V VCC ports.

Has anyone experienced such an issue and has found a solution for it?
let me know if something is unclear or needs more explanation :smiley:

What else do you have connected to the arduino? How warm is the voltage regulator on-board the Arduino getting?

What is the rating of the relay coil. I bet it is greater than what the Arduino pins can output reliably - the data sheet specs at 70 - 80mA for the 5V version which is 4 times more than the Mega is spec'd for.

I have some more things connected:

OLED 91" screen with I2C communication

Thermocouple amplifier circuit with I2C as well

RGB LED button

Encoder dial

the voltage regultor is running a bit warm, not excessively, but i assumed it had more to do with the 12v input to Vin.

Looks like the spec presented in relay board is a bit misleading. They only show the need for 15-20mA to drive the relay. I agree if you look at the datasheet for the relay in the picture, 70mA minimum is needed.

There is a maximum wattage the regulator can deal with, which is roughly calculated as (Vin - 5V) * current load (in amps). The higher the input voltage the less current you can draw. Most current available from the regulator is when powered by 7V.

You have several other loads on the regulator besides just the relay board. Does anything else shutdown or just the relays?

@MarkerDerbyshire good point, I didn't realize it pulled so much current :confused: .
I got it off amazon and didn't go too much into depth to check the current rating, I assumed it was the good to run off an arduino. Do you have any suggestions on how to go about this? would maybe connnecting the system to 2 vcc ports help?

@adwsystems the arduino just resets completely, so yeah verything turns off, except I've noticed the arduino ON led stays on the entire time. I initially though it was a hickup from the power input, so I have a cap across the arduino input power as well to keep it on.

sorry if I'm cramming replies together, its my first time posting in the forums and I can only post once every 5 minutes :smiley:

Are you also using the 12V to power the Mega?

All of the Vcc ports on the Arduino come from the same regulator. So connecting a second Arduino Vcc pin to the relay board will not help.

If everything is shutting down then I would have to think the regulator is shutting down. Will it run longer if the relay board is not connected?

I would begin to look at obtaining an external 5V power supply to connect to the JD-VCC (with the jumper removed). Don't forget to connect the ground of the second power supply to the Arduino ground.

Run a 2nd regulator to power the relay module and the other accessories and use the Arduino output pin to switch an N type transistor or a logic N type MOSFET to control the relay

MarkDerbyshire:
... and use the Arduino output pin to switch an N type transistor or a logic N type MOSFET to control the relay

The relays already have an optoisolator installed, limited to 5mA, but it is bypassed byt he Vcc-JDVCC jumper. If the jumper is removed then there is a separate driver availble, but the relays will need power, that cannot be drawn from the arduino.

OP. For a short term test, pull the Vcc-JDVcc jumper and connect JDVcc directly to the Arduino +5V. This will at least remove the excessive load from the output pin.

@tinman13kup yes I am

@adwsystems the system runs perfectly fine without the relay plugged in. I'm going to try powering the relay JD-VCC from a separate 5V supply as soon as I get hold of one in an hour. although I want to try and do it from the 12V supply I have right now. The syste is supposed to be self contained and I want to avoid having more power sources if possible.

@MarkDerbyshire I have a MC7805CT at hand, would that work as a 2nd regulator from 12V to power the JD-VCC for the relays? why do i need a n-type transistor/MOSFET to be able to control the relay then?

thanks everyone, this is being very helpful! :smiley:

Those are 5V relays. Have a fire extinguisher handy. You will smoke them with 12V.

Try removing the jumper and powering JC-Vcc with the arduino +5V.

With the jumper installed you are powering both the relay and the optoisolator (which isn't isolating with jumper installed) directly from the microcontroller pin. When you remove the jumper the optoisolator is powered by the output pin and the relay from the regulator.

If it works, good. If it still shuts down, then we know the regulator is overloaded.

Yes the 7805 will work, just use it to connect to the 12V supply you already have.

The suggestion for the transistor/MOSFET was to make a relay driver. But your board already has one, but with the jumper installed it is bypassed.

@adwsystems hehehe oh nono, I have a positive voltage regulator (MC7805CT) I'm gonna try and use, should bring the voltage to a safe 5V I hope, I can't afford to smoke anything!
I'll try powering the optoisolator like you said and give some feedback

so, my understanding right now is that by powering JD-Vcc independently, I am bypassing the optoisolators/drivers. I'm not quite familiar with the optoisolator, is this the driver that is being bypassed? what kind of circuit do i need to build with the transistors to create the drivers? do i need one for each relay?

Forget the relay drivers that MarkDerbyshire mentioned. You already have them. You have a two for one, in the optoisolators. You get opto isolation between the relay board and the Arduino output as well as the relay driver (current multiplier).

You posted a link to the board that includes the schematic. Take some time to review the schematic. Now that you are making me explain it, I realized I was mistaken. The Arduino pin does not directly drive the relay and the optoisolator. The JD-Vcc jumper just separates power for the optoisolator from the power for the relays. You can try it, but I'm not hopeful it will change anything. Recall when you wanted to add a second Vcc line to the relay board. I told you to do the same thing, but from the perspective of the relay board. (you said push, I said pull).

The 7805 is a much better option. Don't forget to connect the ground of the 7805 to both the arduino, the 12V power supply and the relay board.

Update, problem solved! I believe...

Setting a jumper for JD-VCC independently to the arduino 5V rail resulted in a shut down as before, a quick touch of the regulator showed it was indeed fairly warm.

By placing a 5V external power supply across the common GND and JD-VCC seems to allow the system to operate as intended, I'll be implementing the voltage regulator now to run the relay JD-VCC off the main 12V.

I'm still unsure with regards to the driver system being bypassed, I haven't implemented it yet and the system seems to be running just fine. Is it worth pursuing?

The driver system isn't bypassed. By removing the jumper, you separated(isolated) the logic side of the module from the power side of the module. That is the way it 'should' be done. The logic side doesn't use much current at all, and can be sourced from the digital I/O pins without issue. The current to energize the relay is now isolated from the arduino and is getting it's power from the 7805, which has it's limits too. It will get hot as well if you pull to much power through it

tdam2112:
I'm still unsure with regards to the driver system being bypassed, I haven't implemented it yet and the system seems to be running just fine. Is it worth pursuing?

I was mistaken. Ignore any references I made to that, as well as any references to you needing to add a relay driver, and any references to output pin damage. The premise for all of those statements was the same and incorrect.

Likely you were pushing the arduino regulator into a thermal or overcurrent shutdown.

Keep the jumper removed. Get a 5V power supply for the relay board. Won't need to be big. The relays draw less than 100mA and there are 4 of them, so 1/2A or 500mA 5V supply should do nicely.

Hi,
Lots of confusion here....

Maybe start with this page:
http://arduino-info.wikispaces.com/ArduinoPower

Here is the actual schematic of these type of opto-isolated relays:

Here's a look at your type relay board connections:

IMPORTANT NOTE: There is a issue with start-up of Arduino programs that control these relays. All of these 2,4, or 8 relay boards input controls are Active LOW, meaning that setting a pin LOW turns them ON. To assure that no relays activate at Reset or Power-On until you want them to, the initialization sequence in SETUP should be:

digitalWrite(Relay, HIGH);
pinMode(Relay, OUTPUT

);

This design is intentional, so that it is possible to guarantee that at power-on of a system, or system reset, that no relays activate except when expected under program control. There may be pumps, lights etc attached and chaos could ensue if this was not controlled definitively for each output port being used.

NEXT: Resetting of the Arduino is often because of Electromagnetic Interference caused by the external devices connected. Here is a page with suggestions on approaching that:

http://arduino-info.wikispaces.com/RelayIsolation

When starting a new project it's a good idea to thing things through before making a lot of wires all over the workbench. Some suggestions here:

http://arduino-info.wikispaces.com/Arduino-Project-Planning-Electrical

Let us know how this all works out....

terryking228, you did notice the schematic is on the page the OP linked for that specific board, right? The majority of the confusion was caused by me. My apologies. I believe the OP is on the right track and understands where they are and where they need to go.

Hi,

terryking228, you did notice the schematic is on the page the OP linked for that specific board, right?

Ah... No, I just confirmed it was the module I expected...

...As The Saying Goes ...