Aphra:
I am afraid I am new to controlling motors with an arduino and so need help with pretty much everything, as there does not seem to be a tutorial which I can find online for wiring up an arduino uno with a linear actuator.
Most linear actuators are simply DC motors connected mechanically (via a gear train) to move a shaft in some linear manner. In your case, it is fairly apparent how this is being accomplished, via probably a simple spur-gear drive to a rack gear that is the linear motion part you see sticking out of the case of the actuator. Fairly straightforward. I won't go any further on this or other linear actuators or how they work; plenty can be found online.
This particular actuator you have, though, was likely meant for an automotive application - so keep that in mind. Generally, this may mean that the current the motor draws could be quite substantial at startup and during running. So, in order to move forward properly, you -must- know what that current need is (especially if you plan to drive 8 of them later - so you can size your power supply).
The best way to do that on this actuator to avoid damaging it would be to open the actuator up, locate the motor, and attempt to disconnect the motor from the geartrain (additionally, this will also allow you to assess the geartrain and its construction, and also whether the grease and such in it needs to be cleaned and replaced - remember, these are likely used and/or surplus devices, and as such may need a bit of TLC to get them into best running). Basically - you just want the motor to be free spinning, so you can move the rotor by hand.
Once you can do that, hook a multi-meter set to measure resistance to the yellow and orange wires (according to the ebay writeup, these are supposed to be the wires that control the motor - in fact, they should almost directly lead to the motor's terminals). Slowly rotate the shaft of the motor, noting the resistance on the meter. Mark down every value you can read; make sure you rotate the shaft a least one full turn - you may want to rotate it a few turns, noting the common values. Once you know these values, take an average of them - that will give you the overall rotor coil resistance. You know the voltage of the motor (12 volts), so, apply Ohm's law to get the current. This will be the stall current of the motor, the maximum it can pull.
After you have done this, re-assemble the gearbox with the motor, etc (do any cleaning and re-lubing of the mechanism if you think it needs it - be sure that if you do this, that you use an appropriate grease for the job - automotive wheel bearing grease will probably work fine).
Aphra:
- How do I wire up my linear actuator to my arduino uno? (Do I need any extra components for the circuit? resistors etc...)
Ok - once you know the stall current (and you already know the voltage) of the actuator, you can then move forward. What you need to purchase or construct, in order to control the motor of the actuator, is called an h-bridge driver circuit. These can be constructed in a variety of ways, from simple relays to transistors to integrated circuits. Which you use will be up to what your skill levels are, as well as what you measured. There do exist for the Arduino various shields and modules (so-called DC motor control shields/modules) that incorporate parts to create an h-bridge and make it easy to control the motor.
You will find that most of these use one of two kinds of IC devices, either an L293 (or a variant, the SN754410) or the L298. The L293 is good up to 1 amp of current draw per channel (with a heatsink), the L298 is good for up to 2 amps of current draw per channel (with heatsink). Both of these ICs have 2 channels (to allow control of two motors - which makes them nice for differential drive robot usage, but I digress). In the case of the L298, you can also bridge the two channels together to provide up to 4 amps of current.
You may find people claiming to have done the same with the L293; another popular thing to do with the L293 is to "stack" chips together to gain more current output. I must caution against doing either of these things, as there is nothing in the datasheet of the L293 or SN754410 that mentions being able to do this as a means of supplying more current to a device under control. Nor does the datasheet of the L298 mention anything about bridging multiple units of that part to do the same (it only mentions the bridging of the internal bridges - something the datasheet for the L293 does -not- mention). Do your research, and read/follow the datasheet recommendations.
Also, regarding the L298 - if you decide to go with this IC, realize that it -does not- have a standard DIP pin layout, and cannot be plugged into a standard breadboard or piece of veroboard/stripboard - one row of pins is offset by .05 in. to the other row, thus both rows will not plug into a standard 0.1 in hole spacing board without either an adaptor, or bending of pins. I don't recommend the latter approach, but people have done it. There is a guy online (http://www.jrhackett.net/) that supplies a PCB adaptor for the L298; he also supplies a "bare" PCB for an entire L298 motor control board, if you want to populate it with your own parts. I am a satisfied customer of his, just to note (see my writeup here on the adapter - http://www.phoenixgarage.org/show_article/123).
Lastly, I want to mention that for proper use of the L293 or L298 - especially when anywhere near the current limits of the devices - you will need a properly sized heatsink! Neither of these devices are very efficient - they use bipolar transistor outputs, and were designed and used in the 1970s and 1980s - they are a very venerable device, and both were mainly designed for automotive applications. As such, there are tons of them out there, and they are very well documented, plus they have a TTL interface for the logic - all of which is why you see them often used in Arduino applications. That said, there are other and better (more efficient, smaller, etc) h-bridge designs out there today that use mosfets and the like if you need something with better specs (check out Pololu's offerings, for instance - http://www.pololu.com/).
Aphra:
2. How do I control my actuator, what code do I use? I need to be able to turn off for a certain amount of time then turn on for a certain amount of time, extending and retracting fully each time.
Well - to control your actuator - you need to control your h-bridge, and you also need to control one other part on that actuator - the electro-mechanical clutch on it. The inclusion of this clutch likely means that the actuator is "back-drivable" - meaning that, with enough force applied to the linear output "shaft", the internal parts (including the motor) can be rotated, changing the overall position of the actuator. The clutch is there to prevent that.
So - your control system would need to be able to activate that clutch (via the blue and green wires, according to the ebay listing), then activate the h-bridge to cause the motor to rotate and move the linear output shaft in or out.
Control of the clutch should be done with a circuit similar to that used to control a relay or solenoid (look this up - it's a common circuit described in the Arduino playground examples); when activated, you can command the motor to move and move the shaft in or out of the actuator. When de-activated, the clutch will hold the shaft in position. If you don't need this kind of control (that is, whatever you are using the actuator to move doesn't have the mass or power to back-drive the actuator and change it's position) it might be possible to remove the clutch from the gearbox (only you can determine this, though - take a look when you do the current measurement procedure I outlined at the beginning). Removing it can simplify the control and code somewhat, but you will lose some functionality that, depending on your needs, may be needed.
--- Part 2 to follow ---