noboyu
Published © MIT

DIY Small Linear Stage

This is a cute linear stage that's about the size of a business card.

BeginnerShowcase (no instructions)7,052
DIY Small Linear Stage

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
200 rpm 6V DC motor
×1
TA7267BP (Full-Bridge Driver (H-Swithch) for DC Motor)
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Tamiya 70157 Universal Plate Set
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Small-stage-test

Press the button(PBS1) connected to Arduino pin8 to run a stage foward.
Press the button(PBS2) connected to Arduino pin9 to run a stage reverse.

Code

DIY small stage test

Arduino
/*
DIY small stage test
 
   * Press the button(PBS1) connected to Arduino pin8 to run a stage foward.
   * Press the button(PBS2) connected to Arduino pin9 to run a stage reverse.
   
*/

#define PBS1 8
#define PBS2 9
#define MOTOR1 2
#define MOTOR2 3
int s1=0,s2=0;

void setup() {
  pinMode(PBS1, INPUT);
  pinMode(PBS2, INPUT);
  pinMode(MOTOR1 , OUTPUT);
  pinMode(MOTOR2, OUTPUT);
}

void loop() {
   s1=digitalRead(PBS1);
   if(s1==0) {						// While button is pressed...
    digitalWrite(MOTOR1, LOW);		//Motor direction:CW
    digitalWrite(MOTOR2, HIGH);		//Motor direction:CW
    delay(50);                     	//Debounce
   }
   else {						
    digitalWrite(MOTOR1, LOW);		//stop
    digitalWrite(MOTOR2, LOW);		//stop
    delay(50);                     	//Debounce
   } 
   s2=digitalRead(PBS2);
   if(s2==0)	{					// While button is pressed...
    digitalWrite(MOTOR1, HIGH);		//Motor direction:CCW
    digitalWrite(MOTOR2, LOW);		//Motor direction:CCW
    delay(50);                     	//Debounce
   }
   else	 {
    digitalWrite(MOTOR1, LOW);		//stop
    digitalWrite(MOTOR2, LOW);		//stop
    delay(50);                     	//Debounce
   }
   }

Credits

noboyu
0 projects • 4 followers
I like mechanical engineering. I love DIY.
Contact

Comments

Please log in or sign up to comment.