17. Machine design¶
Assignments for the week¶
Group assignments¶
- Actuate and automate your machine.
- Document the group project.
Individual assignment¶
- Document your individual contribution.
Requirements¶
- Shown how your team planned and executed the project.
- Described problems and how the team solved them.
- Listed future development opportunities for this project.
- Included your design files.
- Optionally included an aprox. 1 min video (1920x1080 HTML5 MP4) + slide (1920x1080 PNG).
- Explained your individual contribution to this project on your own website.
Group assignments¶
The mechanical part¶
See Week 15 for the mechanical part making progess
Electronics¶
| Parts | Spec. | Quantity |
|---|---|---|
| A4988 stepper Driver | - | 4 |
| Arduino Nano | - | 1 |
| Power adaptor | 12v | 1 |
| Connect Wire | male-male | 46 |
It is control by 4 A4988 module and a Arduino Nano.
Eagle library for A4988 and Arduino Nano v3
Datasheet of 28BYJ-48 – 5V Stepper Motor
Wiring¶
Install motors.

Wiring A4988 and 28byj-48 pins by following table:
Please check this with your datasheet before Connecting.
| A4988 | 28byj-48 | OTHER |
|---|---|---|
| VMOT | – | 12V of adaptor |
| GNDMOT | – | GND of adaptor |
| 2B | Pink | – |
| 2A | Orange | – |
| 1A | Yellow | – |
| 1B | blue | – |
| RST | – | SLP of A4988 it self |
| SLP | – | RST of A4988 it self |
| VDD | – | 5V of Arduino |
| GND | – | GND of Arduino |
Wiring Arduino Nano and A4988s pins by following table:
| Arduino Nano | A4988 | Channel |
|---|---|---|
| 3 | Dir | A |
| 4 | Step | A |
| 5 | Dir | B |
| 6 | Step | B |
| 7 | Dir | C |
| 8 | Step | C |
| 9 | Dir | D |
| 10 | Step | D |

Check setting and calculate¶
High voltage of Dir pins means the stepper runs clockwise and make syringes pump backward.
1 resolution = 2048 step = 0.8 mm of M5 screw.
1mpr= 1/rpm = (60*1000)/2048 = 29.3 ms/step
1 steps/ms = 29 rpm
Build a testing LED to watch status of pin step of A4988.
The minimum delay tested is 1150 microseconds.
Althought A4988 motor driver can handle much faster frequency,
but 28byj-48 just stop and make a sound.

Check the current of stepper.

Code¶
A simple code for Arduino to run motors.
/* Test code for 4-channel syringe pump made for Fab Academy 2019.
*
* by Wei-Sung
*
*/
const int dirPin_a = 3; // Set pin numbers.
const int stepPin_a = 4;
const int dirPin_b = 5;
const int stepPin_b = 6;
const int dirPin_c = 7;
const int stepPin_c = 8;
const int dirPin_d = 9;
const int stepPin_d = 10;
void setup() {
pinMode(dirPin_a,OUTPUT); // set up pins output.
pinMode(stepPin_a,OUTPUT);
pinMode(dirPin_b,OUTPUT);
pinMode(stepPin_b,OUTPUT);
pinMode(dirPin_c,OUTPUT);
pinMode(stepPin_c,OUTPUT);
pinMode(dirPin_d,OUTPUT);
pinMode(stepPin_d,OUTPUT);
}
void loop() {
digitalWrite(dirPin_a,LOW); // Turn the motor to move forward A
for(int x = 0; x < 20480; x++) { // for 10 resolutions
digitalWrite(stepPin_a,HIGH); //at 19.53 rpm
delay(1);
digitalWrite(stepPin_a,LOW);
delay(1);
}
digitalWrite(dirPin_a,HIGH); // Then backward.
for(int x = 0; x < 20480; x++) { // 10 resolutions.
digitalWrite(stepPin_a,HIGH); //at 19.53 rpm
delay(1);
digitalWrite(stepPin_a,LOW);
delay(1);
}
digitalWrite(dirPin_b,LOW); // Turn the motor to move forward B
for(int x = 0; x < 20480; x++) { // for 10 resolutions
digitalWrite(stepPin_b,HIGH); //at 19.53 rpm
delay(1);
digitalWrite(stepPin_b,LOW);
delay(1);
}
digitalWrite(dirPin_b,HIGH); // Then backward.
for(int x = 0; x < 20480; x++) { // 10 resolutions.
digitalWrite(stepPin_b,HIGH); //at 19.53 rpm
delay(1);
digitalWrite(stepPin_b,LOW);
delay(1);
}
digitalWrite(dirPin_c,LOW); // Turn the motor to move forward C
for(int x = 0; x < 20480; x++) { // for 10 resolutions
digitalWrite(stepPin_c,HIGH); //at 19.53 rpm
delay(1);
digitalWrite(stepPin_c,LOW);
delay(1);
}
digitalWrite(dirPin_c,HIGH); // Then backward.
for(int x = 0; x < 20480; x++) { // 10 resolutions.
digitalWrite(stepPin_c,HIGH); //at 19.53 rpm
delay(1);
digitalWrite(stepPin_c,LOW);
delay(1);
}
digitalWrite(dirPin_d,LOW); // Turn the motor to move forward D
for(int x = 0; x < 20480; x++) { // for 10 resolutions
digitalWrite(stepPin_d,HIGH); //at 19.53 rpm
delay(1);
digitalWrite(stepPin_d,LOW);
delay(1);
}
digitalWrite(dirPin_d,HIGH); // Then backward.
for(int x = 0; x < 20480; x++) { // 10 resolutions.
digitalWrite(stepPin_d,HIGH); //at 19.53 rpm
delay(1);
digitalWrite(stepPin_d,LOW);
delay(1);
}
}