Linear actuator locking up Arduinio

Let me start by thanking everyone who contributes to this forum. The wealth of knowledge here is overwhelming!

My project is a boat autopilot using compass navigation. This is my first attempt at circuitry, and writing code.

Overview. Compass (LSM303D) gets read by the Arduino. Depending on the parameters that the user has inputted, a linear actuator moves to a determined point via a 12v relay (LC-200). I’m using a good car battery to power the Arduino, relay and actuator. Because I want to place the compass away from metal and the boat motor, I’m using cat5 cabling to help reduce any EMI. I’m also using cat5 cabling to keep the relay board and the actuator away from the Arduino. The relay, and the actuator are powered by a separate 5v connections. (see attached simple illustration of my circuit)

Problem: The program gets launched, user data gets gathered, and the actuator moves to the determined position. As I rotate the compass clockwise and counter clockwise to simulate boat movement (about 10 deg one way, then 10 deg the other at about 1 sec intervals) the relay clicks, the appropriate LED’s on the relay board light up, and the actuator moves correctly. . . . . but it will freeze up the Arduino after a few seconds or up to 1 min. It’s completely intermittent. When this happens, sometimes my LCD display will freeze and change color, sometimes only partial display is shown, or sometime just blanks out. Either way, everything appears the be locked up. A quick reset, re enter the info and way we go again. . . . .but ony for a few seconds.

Here’s the kicker, if I remove the actuator from the relay board, everything appears to work as it should. As I move the compass, the relay clicks, the relay LED’s light up as though they’re moving the actuator as it should. I’ve ran it this way without any problems for up to 20 min. As soon as I re-connect the actuator and move the compass, it lasts only a few seconds before it freezes up again.

Please post a proper, hand drawn circuit diagram. Pictures of components are for young children. Also post your code properly, following the instructions in the "How to use this forum" post.

Since your problem very likely has to do with failure to properly decouple the power supply or use kickback diodes and noise reduction capacitors on the relays and actuator, be sure to include in your schematic any diodes and capacitors that are present.

Example of motor spike and noise reduction connections:

jremington:
Please post a proper, hand drawn circuit diagram. Pictures of components are for kindergarten children.

Since your problem very likely has to do with failure to properly decouple the power supply or use kickback diodes and noise reduction capacitors on the relays and actuator, be sure to include in your schematic any diodes and capacitors that are present.

Example of proper I/O connections:

I'm sorry, I don't know how to do that. I'm only 14. I did my best to accurately place the connections at the appropriate locations on the pictures of the components I'm using. There are no additional capacitors or diodes, or any other components I'm using other than what's shown in the image. I'm sorry that I don''t have enough knowledge to properly ask the question.

Ok, it’s a good time to start learning!
A schematic is an important part of your skill set - just like soldering will be.
Avoid lines that cross at angles, and try to have the flow of process from left to right.

As jremington said, it sounds like your problem is power supply - BUT, it could still be something in your code.

Good idea to read the posting guidelines, and get your code up here within </> code tags.

This is my first attempt at circuitry, and writing code.

This is an extremely advanced project and certainly not recommended for a beginner.

However, any project should be taken in small steps.

In this case, an important step is to learn how to properly wire, power and control an actuator. These are power hungry components that will cause power problems for the rest of the circuit. Make sure that the actuator works perfectly, in the actual control application, before attempting to add anything else.

By the way, relays are not a good choice for controlling an actuator. Use a motor driver capable of handling the actuator stall current. Pololu has a good selection.