Project tutorial
HD4-Motor

HD4-Motor © GPL3+

Make a "4-cilinder" motor of demolished drives

  • 499 views
  • 0 comments
  • 1 respect

Components and supplies

A000057 featured
Arduino Leonardo
Any Arduino model will do !
×1
Actuator, Magnetic inside a Hard drive
See picture below
×4
Fairchild semiconductor pn2222abu. image
General Purpose Transistor NPN
Rating 30 V DC 2 Amp
×4
Optical switch, slotted type
For position detection
×4
09939 01
Rotary potentiometer (generic)
For speed adjustment
×1
Omron b3f 1000 image 75px
SparkFun Pushbutton switch 12mm
Selection rotation direction + Stop
×3

About this project

Did you replaced your hard drive by an SSD drive ?

Don’t throw away your old hard drive.

Take your old drives apart and discover a very useful part inside ….. the actuator which moves the read/write arm with the magnetic heads at the top.

This actuator in principle is a coil, moving in a strong magnetic field.

If you have found the 2 end wires of this coil and give a supply voltage (e.g. 1.5 volt from a battery) on the coil the arm will push or pull depending on which end wire is + and – of the battery.

Doing this you will discover that you now have a reasonable strong “power producer”.

Next step I made was to make a rotating motor using this “power producer” if you make a crack arm construction with a flywheel.

Following step was to install 4 of them as in a “star engine”.

Following simple control system resulted in a “4-cilinder motor :

  • 4 optical switches to detect motor position
  • 1 Arduino ….. any type will do (e.g. Mini or ProMicro are oke)
  • 4 NPN-Power transistors or one 4-channel chip as output amplifier up to max. 2 amp
  • Pushbuttons for running clock/counterclockwise
  • 1 Potentiometer for speed control

Some technical notes :

  • Most actuators in hard drives have an internal resistance of 8 to 25 Ohms.
  • Select your power supply to get max. currents of about 0.5 Amp.


Why should you make this motor ?

- For energy efficiency ...... no ..... it is about 0.001 percent !!

- Why ???? Just the fun ...... to make and program something !!

Code

HD4-Motor-LeonardoH.inoArduino
Arduino-listing for HD4-Motor
// Arduino Type Leanardo
// Arduino Revision 1.8.7
// Action of HD-Motors : Pulling only

// PinNumbers Leonardo :
int OptSWD=1;           // Optical Switch
int OptSWC=2;           // Optical Switch
int HD4=3;              // HardDiscmotor PWM Output
int OptSWB=4;           // Optical Switch
int OptSWA=5;           // Optical Switch
int HD3=6;              // HardDiscmotor PWM Output
int SW3=9;              // PushbuttonSwitch (RunCounterClockWise)
int HD2=10;             // HardDiscmotor PWM Output
int HD1=11;             // HardDiscmotor PWM Output
int SW4=12;             // PushbuttonSwitch (future)
int SW5=13;             // PushbuttonSwitch (RunClockWise)
int PotSpeed=A0;        // PotentioMeter for SpeedAdjustment

// Variables :
int TimeOn;             // Duration of time Outputs ON
int Number;
int StateSW3;
int StateSW4;
int StateSW5;
int StateOptSWA;
int StateOptSWB;
int StateOptSWC;
int StateOptSWD;
int StatePotSpeed;
int Speed;           
boolean StartedCW;
boolean StartedCCW;

void setup() 
{   Serial.begin(9600);   
    pinMode (HD1, OUTPUT);
    pinMode (HD2, OUTPUT);
    pinMode (HD3, OUTPUT);
    pinMode (HD4, OUTPUT);  
    pinMode (SW3, INPUT);  digitalWrite(SW3, HIGH);       // Internal Pull up
    pinMode (SW4, INPUT);  digitalWrite(SW4, HIGH);       // Internal Pull up  
    pinMode (SW5, INPUT);  digitalWrite(SW5, HIGH);       // Internal Pull up
    pinMode (PotSpeed, INPUT);                            //  PotSpeed           
    pinMode (OptSWA, INPUT); digitalWrite(OptSWA, LOW);   // Internal Pull down 
    pinMode (OptSWB, INPUT); digitalWrite(OptSWB, LOW);   // Internal Pull down 
    pinMode (OptSWC, INPUT); digitalWrite(OptSWC, LOW);   // Internal Pull down  
    pinMode (OptSWD, INPUT); digitalWrite(OptSWD, LOW);   // Internal Pull down         
    TimeOn=0; StartedCW=0; StartedCCW=0;}
    
  

void loop() 
{   StateSW3=digitalRead(SW3); if(StateSW3==0) {RunCounterClockWise();} else {StopMotors(); StartedCCW=0;}  // 
    StateSW5=digitalRead(SW5); if(StateSW5==0) {RunClockWise();} else {StopMotors(); StartedCW=0;}          //     
//    DisplayMonitor();      // For Testing only
}


void RunClockWise()   // Oke Met PWM en Regelbare Speed         // Test
{   if (StartedCW==0){StartClockWise();}
    ReadOpticalSwitch(); 
    TimeOn=40;   // was 40    //250 Schokt // 100 Lopen Redelijk // 50-80 Loopt Redelijk  // 10 LooptSlecht // Beste is 50
    if (StateOptSWA==1) {analogWrite(HD1,0); analogWrite(HD2,0); analogWrite(HD3, Speed); analogWrite(HD4, Speed); delay(TimeOn);} //
    if (StateOptSWD==1) {analogWrite(HD1,0); analogWrite(HD2, Speed); analogWrite(HD3, Speed); analogWrite(HD4,0); delay(TimeOn);} //  
    if (StateOptSWC==1) {analogWrite(HD1, Speed); analogWrite(HD2, Speed); analogWrite(HD3,0); analogWrite(HD4,0); delay(TimeOn);}   
    if (StateOptSWB==1) {analogWrite(HD1, Speed); analogWrite(HD2,0); analogWrite(HD3,0); analogWrite(HD4, Speed); delay(TimeOn);} 
}


void RunCounterClockWise()   // Met PWM en Regelbare Speed         // 
{   if (StartedCCW==0){StartCounterClockWise();}
   ReadOpticalSwitch(); 
   TimeOn=40;   // was 40
   if (StateOptSWA==1) {analogWrite(HD1,0); analogWrite(HD2,Speed); analogWrite(HD3, Speed); analogWrite(HD4, 0); delay(TimeOn);} //
   if (StateOptSWB==1) {analogWrite(HD1,0); analogWrite(HD2, 0); analogWrite(HD3, Speed); analogWrite(HD4,Speed); delay(TimeOn);} 
   if (StateOptSWC==1) {analogWrite(HD1, Speed); analogWrite(HD2, 0); analogWrite(HD3,0); analogWrite(HD4,Speed); delay(TimeOn);}       
   if (StateOptSWD==1) {analogWrite(HD1, Speed); analogWrite(HD2,Speed); analogWrite(HD3,0); analogWrite(HD4, 0); delay(TimeOn);} //  
}

void StartClockWise()   // 
{   TimeOn=100;         // was 100
    analogWrite(HD4, 255);  delay(1000); analogWrite(HD4, 0);     // To StartPosition !!    
    for (Number=0; Number<4; Number++)  
         {analogWrite(HD3, 255);  delay(TimeOn); analogWrite(HD3, 0);   //
          analogWrite(HD2, 255);  delay(TimeOn); analogWrite(HD2, 0);   //  
          analogWrite(HD1, 255);  delay(TimeOn); analogWrite(HD1, 0);   
          analogWrite(HD4, 255);  delay(TimeOn); analogWrite(HD4, 0);}
    TimeOn=TimeOn-50; StartedCW=1;}

void StartCounterClockWise()   // 
{   TimeOn=100;      // was 100
    analogWrite(HD4, 255);  delay(1000); analogWrite(HD4, 0);     //  To StartPosition !!      
    for (Number=0; Number<4; Number++)
         {analogWrite(HD1, 255);  delay(TimeOn); analogWrite(HD1, 0);   //
          analogWrite(HD2, 255);  delay(TimeOn); analogWrite(HD2, 0);   //  
          analogWrite(HD3, 255);  delay(TimeOn); analogWrite(HD3, 0);   
          analogWrite(HD4, 255);  delay(TimeOn); analogWrite(HD4, 0);}
    TimeOn=TimeOn-50; StartedCCW=1;}

void DisplayMonitor()
{   StateSW3=digitalRead(SW3); Serial.print("SW3 = " );   Serial.print(StateSW3); 
    StateSW4=digitalRead(SW4); Serial.print("   SW4 = " );   Serial.print(StateSW4); 
    StateSW5=digitalRead(SW5); Serial.print("   SW5 = " );   Serial.print(StateSW5); 
    StateOptSWA=digitalRead (OptSWA); Serial.print("       OptSWA = " );   Serial.print(StateOptSWA);      
    StateOptSWB=digitalRead (OptSWB); Serial.print("\t OptSWB = "); Serial.print(StateOptSWB); 
    StateOptSWC=digitalRead (OptSWC); Serial.print("\t OptSWC = "); Serial.print(StateOptSWC); 
    StateOptSWD=digitalRead (OptSWD); Serial.print("\t OptSWD = "); Serial.print(StateOptSWD); 
    Speed=analogRead(PotSpeed)/4; Serial.print("\t Speed = "); Serial.print(Speed);        
    Serial.println();}

void ReadOpticalSwitch()    // 
{   StateOptSWA=digitalRead (OptSWA);
    StateOptSWB=digitalRead (OptSWB);
    StateOptSWC=digitalRead (OptSWC);
    StateOptSWD=digitalRead (OptSWD);
    Speed=analogRead(PotSpeed)/4;} 

void StopMotors()
{ analogWrite(HD1, 0); analogWrite(HD2, 0);
  analogWrite(HD3, 0); analogWrite(HD4, 0);}

Schematics

HD4-Motor.mp4
Video HD4-Motor in operation showing some Figures
hd4-motor_YXE2kjUFzb.mp4
Wiring Diagram HD4-Motor
Electrical wiring of the compete HD4-Motor
Wiringdiagram hd4 motor 1rul711yui
HD-Actuator
How to get a HD-Motor from a hard drive
Hd actuator onpekhogye
IMG_5488
Optical switshes on HD4-Motor
Img 5488 t2r0791rnn
DSCF2574.jpg
A HD1-Motor ...... small brother !
Dscf2574 ugbb9kwkjd

Comments

Similar projects you might like

Local and Remote Programmable Robotic Arm

Project tutorial by MJRoBot

  • 23,669 views
  • 7 comments
  • 63 respects

Simple Programmable Robotic Arm

Project showcase by Ryan Chan

  • 99,946 views
  • 94 comments
  • 257 respects

Dual Axis Solar Tracker Panel with Auto and Manual Mode

Project tutorial by Giannis Arvanitakis

  • 24,589 views
  • 12 comments
  • 72 respects

Integrated Solar ChargeController, Inverter, PowerBank, Lamp

Project tutorial by Shahariar

  • 13,277 views
  • 26 comments
  • 45 respects

Arduino-Powered Water Bottle

Project tutorial by Md. Khairul Alam

  • 9,671 views
  • 5 comments
  • 35 respects

Sigfox kWh Meter

Project tutorial by jassak

  • 8,080 views
  • 8 comments
  • 15 respects
Add projectSign up / Login