Go Down

Topic: Kinetic art installation - actuators (Read 638 times) previous topic - next topic

habin_isa



Hello there,

I am building a moving installation which uses two linear actuators. I want these actuators to extend and move downwards simultaneously, then after a short delay (60000), switch the currents so that they start moving upwards again.

I plan to use an arduino with a relay, 2 actuators with + and - from each being linked into a channel each on the relay. Then relay channels being linked to digital channels on the arduino.

I want the actuators to be on HIGH, so that they extend for 84000, and then stop (LOW). Then after a delay of 60000, I want the currents to swap direction so that the actuators retract and travel upwards for 84000, then for them to stop (LOW). Then I want a delay of 600000 before the whole programme is looped again.

Is this the write code? (Sorry I am a total newbie but enthusiastic so I am keen to get this solved!)


/*
Connect 5v on Arduino to VCC on Relay Module
Connect GND on Arduino to GND on Relay Module
Connect GND on Arduino to the Common terminal (middle terminal)

#define CH1 8 // Connect Digital Pin 8 on Arduino to CH1 on Relay Module
#define CH2 7 // Connect Digital Pin 7 on Arduino to CH3 on Relay Module

void setup ( ){ {
//Setup all the Arduino Pins
pinMode( CH1, OUTPUT ) ; //Positive, actuators moving down
pinMode( CH3, OUTPUT ) ; //Negative, actuators moving up

//Provide power to both relay channels (in sync)
digitalWrite( CH1, HIGH ) ;
digitalWrite( CH3, HIGH ) ;

//Turn off power to both relay channels
digitalWrite( CH1, Low ) ;
digitalWrite( CH3, Low ) ;

void loop ( ) {
digitalWrite( CH1, HIGH ) ; //Postive, actuators moving down
delay( 84000 ) ;
digitalWrite( CH1, LOW ) ; //Actuators turn off
delay( 60000 ) ;
digitalWrite( CH3, HIGH ) ; //Relay 3 switches to NO, Negative, actuators moving up
delay( 84000 ) ;
digitalWrite( CH3, LOW ) ; //Relay 3 switches to NC, Actuators turn off
delay( 600000 ) ;


Any help would be greatly appreciated, I am unsure whether this automatically loops?

Also how do i power the relay?

THANK YOU ARDUINO TIME LORDS :) :)

slipstick

#1
May 15, 2017, 12:46 pm Last Edit: May 15, 2017, 12:46 pm by slipstick
Sounds interesting. If you say what type of Arduino and provide links to the exact relay and actuators you are using it would help.

That code will not compile, {} brackets are all over the place and the whole program is commented out (you start a comment with /* and you never finish it), so that will need some fixing. It's worth at least checking that you can "Verify" a program successfully before asking people to look at it for you.

Steve

Go Up