That mech video looks literally perfect for what I want with the exception I want it vertical behind the cabinet to raise / lower slowly repeatedly.
The mech will work vertically, too.
The prices for those motors and that tiny board is insanely cheap, but If I can use the 5v or the 12v off the switching power supply home run.
Everything electrical (motor, driver, and Arduino) will run off 5v and ground from the switching power supply.
- Wire everything as indicated in the video and notes below.
I'm not familiar with printing any 3D parts, but yeah Ideally it would be a smaller low profile design (attahcing to back of cabinet hiding most of the mechanics with exception of item I'm raising / lowering) but essentially the same overall mechanics in that video.
You can fab the mech yourself (lots of scotch yoke physical builds on YouTube to copy)
or I can help with 3d design
if you provide certain critical, specific details/measurements.
I don't know anything about Arduino ? I was thinking just wire this up and have it run ?!
It's a stepper motor, so you will need the Arduino to run through the steps. (4 phase wires ==> 4 steps/phases)
This tutorial has the basic intro info you need:
5:30 - Electromagnetic coils in the motor
8:27 - Driver board
10:39 - Wire power to external source
11:36 - Full Stepping wave forms (best speed and torque)
14:31 - Full Stepping animation
The Arduino specific info is at
https://channel9.msdn.com/Shows/themakershow/8.
- Video shows how to wire everything to an Arduino Uno.
-- See notes below for how to connect to a less expensive Pro Micro board.
- Change speed by changing the delay value. (13:30 - 14:50)
Here's an adaptation of his "S01_BruteForceWaveDrive" sketch changed to Full Stepping.
- This code does continuous, Full Step, CW rotation.
- The delay variable "delay(2);" (line 64) takes about 4 seconds per rotation.
NOTE: This is the max speed for a full up/down cycle with this motor and the scotch yoke mech.
-- If you change it to "delay(3);", it will take about 6 seconds per rotation.
int bluePin = 2; //IN1 on the ULN2003 Board, BLUE end of the Blue/Yellow motor coil
int pinkPin = 3; //IN2 on the ULN2003 Board, PINK end of the Pink/Orange motor coil
int yellowPin = 4; //IN3 on the ULN2003 Board, YELLOW end of the Blue/Yellow motor coil
int orangePin = 5; //IN4 on the ULN2003 Board, ORANGE end of the Pink/Orange motor coil
//Keeps track of the current step.
//We'll use a zero based index.
int currentStep = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(bluePin, OUTPUT);
pinMode(pinkPin, OUTPUT);
pinMode(yellowPin, OUTPUT);
pinMode(orangePin, OUTPUT);
digitalWrite(bluePin, LOW);
digitalWrite(pinkPin, LOW);
digitalWrite(yellowPin, LOW);
digitalWrite(orangePin, LOW);
}
void loop() {
//Comment out the Serial prints to speed things up
//Serial.print("Step: ");
//Serial.println(currentStep);
switch(currentStep){
case 0:
digitalWrite(bluePin, HIGH);
digitalWrite(pinkPin, HIGH);
digitalWrite(yellowPin, LOW);
digitalWrite(orangePin, LOW);
break;
case 1:
digitalWrite(bluePin, LOW);
digitalWrite(pinkPin, HIGH);
digitalWrite(yellowPin, HIGH);
digitalWrite(orangePin, LOW);
break;
case 2:
digitalWrite(bluePin, LOW);
digitalWrite(pinkPin, LOW);
digitalWrite(yellowPin, HIGH);
digitalWrite(orangePin, HIGH);
break;
case 3:
digitalWrite(bluePin, HIGH);
digitalWrite(pinkPin, LOW);
digitalWrite(yellowPin, LOW);
digitalWrite(orangePin, HIGH);
break;
}
currentStep = (++currentStep < 4) ? currentStep : 0;
//2000 microseconds, or 2 milliseconds seems to be
//about the shortest delay that is usable. Anything
//lower and the motor starts to freeze.
//delayMicroseconds(2250);
delay(2);
}
- You might also like the reversing motion of his
S05_FullSteppingWithArrays sketch.
-- Alternates CW and CCW rotation through a set number of steps as demonstrated in the Arduino specific video above.
What wires go where on the Pro Micro:
Two grounds (upper left) - Connect one to the switching power supply and the other to the driver board.
2 - IN1 on driver board.
3 - IN2 on driver board.
4 - IN3 on driver board.
5 - IN4 on driver board.
VCC (or RAW) (upper right) - 5v (or 12v) from switching power supply to power the Arduino.
- Arduino may need 12v on regulated RAW pin if 5v on unregulated VCC pin doesn't work.
- See details under "How to Power the Pro Micro"
here.
- No USB connection is needed after the board is programmed.
Scott