Go Down

Topic: Electric actuator + Relay Module + Arduino Mega = program stops (Read 967 times) previous topic - next topic


Hello everyone!

I have created Automatic Chicken Coop Door Opener on MEGA 2560. The idea was simple. Get electric actuator (12V - 36V, max 3 I) and power it by a simple laptop power supply (19V, 3.5 I). Then connect it to relay module and controlled it by Mega. Some switches, LCD to present some data, temp. and time module, write a program and VoilĂ !

I have connected everything property and wrote code. Everything should work just fine. But no, when the actuator is turned on, lcd first blink several times and then whole program stops. I did some research and I think that the actuator engine make a noise that affect on arduino.

What should I do to eliminate this? I have already tried several things:
1. power the relay by independent power source, and controlled it by a opto-isolator PC817. Should work, since there is galvanic isolation with arduino, but it didn't. Still blinking and suspending.
2. put some capacitor between Vcc and GND on arduino - no change. I have read about noise reduction with capacitor and try electrolytic capacitor 25V 4700 uF.

Maybe i made a mistake during 1 or 2. If you have any suggestion please help.




You'll need to show us exactly how you have connected things - photos and sketches.
Some details of exact part numbers for motor, power supply etc.  The more information the better.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


MarkT, thank for your answer  :)

At first my project looked like as in the first attachment. then I used PC817 and it looked like as in the second attachment.

Photos of other parts also attached.

actuator - Voltage(V) - 12-36VDC (typical 24V),  Continuous Current(A): 1,5A, Torque 3000N

Arduino power supply - see attachment
The relay independent power supply - another one as for arduino + voltage divider.

For any help I will be grateful.


I will change everything if necessary.. I just want to know how to make it work properly.


Have you tried leaving the actuator power supply on all the time, remove the relay you use to switch it on, this may be causing your interference.
Then see if  your problem occurs.

The other thing is, that supply is a LAPTOP supply, and  as such may not have the response to transient loads that starting your actuator will produce.

If you leave the actuator supply off and just look at the relays working, does it lock up?

Can you please post a copy of your sketch, using code tags?
They are made with the  </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Also can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Fritzy diagram is not regarded as a schematic diagram.

Tom..... :)

Everything runs on smoke, let the smoke out, it stops running....


I had a similar problem with a project. It involved using a 5VDC opto isolated relay module and a contactor (large relay). Tried many things but what eventually worked was eliminating the LCD. - Scotty


scottyjr, that didn't help.

Tom, I red your post and checked your suggestion. Something interesting was happened. I  removed relay and connected wires. When the actuator power supply was connected to the same AC power socket (230V) as arduino power supply, problem occurred and program was stopped, but when I connected it to a different socket (it has independent wire plugged to electricity meter) nothing wrong happened.
Then I connected relay and problem occurred again.

My sketch has over 2000 lines. Tomorrow I will create small sketch to control relay. Then I will post results.


Okay smolog, its looks like its switching interference, try to keep your AC wiring clear of any DC.
Can you post a picture of your project please.
Try putting a 0.1uF Capacitor across the actuator terminals.

Tom..... :)

Everything runs on smoke, let the smoke out, it stops running....


Twisted pair for all your 24V wiring would be good.  Never run power wiring parallel to
sensor cables.

Don't power the relay modules from Arduino Vcc, or if so add lots of decoupling at the
relay board(s).  Check the current consumption of your relays doesn't exceed the
5V regulator's ability.

The way you implement an H-bridge using two SPDT relays is flawed.  You should use
one DTDT relay.  With two relays you cannot guarantee you won't short-out the
DC supply as the two relays are not guaranteed to switch at the same speed in lock-step.

With your current setup the only safe way to reverse the actuator is power down at the mains,
wait a few seconds for the DC rail to drop, then switch the other relays and power back up
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


Thanks you guys for your answers:)

Tom, I will take a photo and post it after work :)

Mark, I didn't know that something like DPDT relay exist. However the fact is that I used third relay to turn on/off the actuator supply. Now, during the tests I don't use it, because it doesn't matter.

Today I will use the opto-isolator and independent power source for relays again. Maybe I did something wrong during previous test.


I am sorry for the delay in posting. I think I found the problem. I have talked to the actuator producer which said that this is because DC motor generate interference on electrical wiring. What he said is I need to use some filtering near the motor and problem should be solved. I did what you can see in attachment and interference has gone (for now  ;D ). I have used a chokes and a capacitor.
I don't know the value of the chokes. There is no information on them.  The capacitor value is 43uF

I also added photo of my project. It's a little scary, but what can I say. I did my best  ;)

If you think that there is something that should be corrected, please tell me.

Mark, I have bought DPDT relay. It works perfect :)

Go Up