Arduino Mega Restarts every few minutes when connected to 12v

Hello, I am using an Arduino Mega and have it connected to three MAX232 RS-232 TTL Converters and two 4 Channel 5V Relays. These are triggered when one of seven buttons is pushed. The buttons are standard wiring with a 10k resistor to the ground. The wiring for the buttons is from the port to the resistor then to ground but currently no button. When testing I am just triggering it with a wire to 5v. No external wiring has been done.

So here is the strange problem. When setting up the program I had no problems everything worked just as expected. When I triggered a port the relays would operate as expected. I have no more than 3 relays triggered at any one time. I was happy everything was working. I took the system to the site and plugged it into a master 12vdc power supply. The power supply was at 12.6 vdc. The arduio started going crazy. Relays were kicking on and off. I thought that maybe I had a floating ground or something like that. So I pulled the system out and connected to a stand-alone power supply. The system worked.... For a minute or two then would restart. I tried different power supplies and each time it would run for 1 to 3 minutes and then restart. I finally connected to to my USB on my computer, and it seemed to work fine. I have now brought it back to my office, have it plugged into a 5v USB power supply and it has been running for the last few hours without a problem.

Any ideas on why it would act up when connected to 12v? Nothing else is connected just 12v and it will reboot every 1-3 min.

Major design fault: "A Power Supply the Arduino is NOT!" Power your peripheral devices with a seperate power supply or a buck converter and it will work. If it is cold you can take it outside it may work. What is happening is the 5V regulator is shutting down because it is to hot. Lowering the 12V would help but best power the peripherals with a seperate power source with the all the grounds connected.

1 Like

That was my original plan, but the box I was putting git all in is a bit small.

I use DC-DC converters, set to exactly 5v, to provide power to my Arduino boards, connected via the 5v and Gnd pins. This bypasses the crappy regulators. You can use the transformer to power both the converter and the other peripherals, providing the transformer can provide enough amps.

1 Like

Just so happens I have one of those sitting on the shelf. :slight_smile:

When using a 12V supply, 12V relays would be a better choice than 5V relays. The relay coils could then be powered directly by the 12V supply and avoid overloading the 5V regulator.

Better still would be to use MOSFETs such as irlz44 or stp30nf06l instead of relays.

PS. This question should not have been posted on this forum section. Please click the flag icon and request the forum moderators to move it to a more suitable section.

@Seoulhawk, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project.

I am curious. §

I do not haunt the "Installation and Troubleshooting" forum (because I simply do not have the time), but do you - and others - hang out there to help people install and troubleshoot the IDE, or just to intercept more interesting problems and move them to the proper area?

(§ - I am sure many will agree. :rofl:)

For 5V relays, use 5V power supply. If you will use the 12V power supply, use 12V relays. Other possibility use a dedicated DC-DC converter. If all is below 1A, TSR-1-2450. Or MIC29300-5.0.

Standard wiring for buttons is pullup with 10k (or intern pullup) to 5V and switch to GND to activate.

No, I often check the "NEW" filter/view for subjects that look interesting or, like this one, I suspect I know the answer. Then, if I notice they are in the wrong section, I might flag then to moderators or suggest to the OP that they should do so.

I'm surprised I haven't managed to trigger whatever criteria it is that grants me permission to move posts between forum sections. I know other members have that.

Everyone, Thank you. I am still new to this. Seems like my first ideas when designing this system were correct. I WAS going to use 12v and power a 12v relay board but felt like I did not have the space. I will try to fix that. I was thinking of trying to make a custom PCB and I could do it then.

Thank you all again.

I would be virtually certain that you already have that ability as would I. You just do not know how to do it. :grin: I don't either. :frowning_face:

Not sure what space has to do with it. :roll_eyes: The relays are generally the same size.

I would advise avoiding the on-board regulator on the Mega/ UNO/ Nano/ Leonardo etc., as it is simply not suitable for use in a "real world" project.

The Arduino runs on 5 V and you need a proper 5 V power supply to feed it via the "5V" pin. So if you have a proper - switchmode - "buck" converter to safely deliver 5 V from your 12 V supply, use that and then power 5 V relays and all the other 5 V subsystems from that so you have no such mysterious power problems.

The more recent Arduino designs include switchmode regulators which can - where so specified - safely operate from nominal 12 V supplies such as a car battery, not not the old "traditional" Arduinos.

No, I think it's to do with "Trust Level". You need "Regular" as opposed to "Member".

If you control the relais via mosfets or use relay modules with opto couplers, the arduino regulator will be perfectly fine. It is not that crappy.... But you cannot switch a relay from the regulated power.

I agree about MOSFETs. I agree about using the onboard regulator, provided it is used with care and awareness of its limitations (which the vast majority of beginners don't have).

But opto-couplers don't do anything to avoid overloading the Arduino's regulator. What's important is how the relay coils are powered. A relay with a 5V coil, if powered by the Arduino's regulator, even if it has an opto-coupler, is still at risk of overloading the regulator.

My suggestion was that the arduino drives the led in the opto coupler. And that another source drives the relais. So I thing we agree.:+1:

Ok

I just wanted to make sure @Seoulhawk understands that powering 5V relays from the Arduino regulator is a problem, even if the relay has opto-couplers.

I know that now. :slight_smile: I have a dc buck converter that I should be able to set to 5v. I will make some changes to use an external power supply for the serial boards and relays.

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