I need to connect a linear actuator with external powersource, so i can control it using the arduino UNO board.
I've attached a photo of the hardware i'm using.
The red wire gives a poweroutput of approx 12 V. When connected to the orange wire, the actuator extends, when connected to the green wire it retracts.
How do i set up this wiring, i've been trying a few different things, but it seems that because of the 3 wires i can't figure out how to do it right.
I got a couple of relays, transistors, resistances and diodes for this project so any wiring using this would be much appreciated.
power supply Gnd connects to Emitter and connects to Arduino Gnd.
red wire goes to relay Common. Common will connect to Normally Closed, and when the relay is energized, Common will connect to Normally open.
Resistor goes to transistor base. Without a part number, can't say where that is. Other side goes to an Arduino pin, say pin 3.
I can control it using
int pin = 3;
void setup() {
pinMode(pin, OUTPUT);
}
void loop() {
digitalWrite(pin, HIGH);
delay(2000 );
digitalWrite(pin, LOW);
delay(500);
}
Trouble is when i connect the green wire to normally closed the aktuator doesn't move in either direction. If i disconnect the green wire it will do as the code requests.
Is it possible to control which directions it goes with this setup, and how?
What you pictured is not the same as what I diagrammed for you, and does not make the connections you initially described:
The red wire gives a poweroutput of approx 12 V. When connected to the orange wire, the actuator extends, when connected to the green wire it retracts.
Red should not connect to the motor at all - only to the relay common.
The relay takes care of connecting Red to Orange, or Red to Green.
Note that you need two separate and independent relays, not just one. CrossRoads' diagram uses the left relay as an "enable" control and the right relay as a "direction" control.
Issues with your wiring are:
transistor emitter is not connected to ground
base resistor is not connected to arduino at all
relay coil high side needs to go to VCC/5V not D13
your red wire is not connected
the relay Common pin is not connected
only half the circuit is present
As a temporary measure with 1 relay, you could connect the red wire to the relay common. That way the actuator will ALWAYS be moving and this relay will control its direction. I don't know what will happen if you try to drive the actuator through its end-stops.
I have a handful of this exact model of relay. The way it's in the breadboard makes me think you've folded the common pin under and maybe you don't have the other wires plugged into the right columns.
Red wire goes to C on Left relay. Connect NO on left relay to C on right relay.
Pin 3 high then enables actuator to move.
Pin 5 determines the direction.