Go Down

Topic: Hacking Ac motor with Arduino and Solid State Relays (Read 1 time) previous topic - next topic

molmol

Jan 12, 2013, 12:24 am Last Edit: Jan 12, 2013, 12:54 am by molmol Reason: 1
Mighty Forum:

Im wondering if anyone had experience hacking a 120V AC motor with arduino and solide state relays to control the direction?    We dont need to control the speed.

------------------------------------------------->
We were able to control the SSRs with arduino and the code below,  but we were not able to change the direction of the motor.  
You can see from the video
https://vimeo.com/57183524
------------------------------------------------->
We are using this motor:

http://www.harborfreight.com/880-lb-electric-hoist-44006.html
which has a 25% duty cycle.

I think it also has a built-in motor controller, and the motor comes with a pendent switch to control the direction.

------------------------------------------------->

Amico 250V 25A SSR-25DA Temperature Control Solid State Relay
to hack the motor pendent switch

------------------------------------------------->
Here's the code that we're using

// this code only run both direction once when it starts, then the ac motor stops working completely with arduino after that.. we can still operate the motor with its pendent switch


const int motorPin1 =  5;    // One motor wire connected to digital pin 5
const int motorPin2 =  6;    // One motor wire connected to digital pin 6


void setup()   {                

 pinMode(motorPin1, OUTPUT);
 pinMode(motorPin2, OUTPUT);  
 
}


void loop()                    
{
 
 rotateLeft(255, 10000);
 rotateRight(255, 10000);
  rotateLeft(255, 10000);
 rotateRight(255, 10000);
 
}


void rotateLeft(int speedOfRotate, int length){
 analogWrite(motorPin1, speedOfRotate); //rotates motor
 digitalWrite(motorPin2, LOW);    // set the Pin motorPin2 LOW
 delay(length); //waits
 digitalWrite(motorPin1, LOW);    // set the Pin motorPin1 LOW
}

void rotateRight(int speedOfRotate, int length){
 analogWrite(motorPin2, speedOfRotate); //rotates motor
 digitalWrite(motorPin1, LOW);    // set the Pin motorPin1 LOW
 delay(length); //waits
 digitalWrite(motorPin2, LOW);    // set the Pin motorPin2 LOW
}

molmol

#1
Jan 17, 2013, 08:12 pm Last Edit: Jan 17, 2013, 08:48 pm by molmol Reason: 1
We solve the problem by putting 200K resistor to discharge the capacitor. And we 're able to control the direction of the AC motor now via an Arduino.   


The arduino code can be downloaded at my github:
https://github.com/openMolmol/hack-acmotor-with-relay-and-arduino

Will post more instruction soon

arduinohabib

Nice! I took apart a washing machine and got a huge ac motor with a nice ac capacitor as well. I'll post photos latter.
What is man's best friend? The breadboard!

Go Up