12. Mechanical Design, Machine Design
Automated Yarn Winder
Disclaimer: The video edition is done using CapCut and free sounds added from it.
Group Assignment:
- Design a machine that includes mechanism + actuation + automation + application.
- Build the mechanical parts and operate it manually.
- Actuate and automate your machine.
- Document the group project.
Inspiration
After going to lot of discussion,We chose to build an automatic yarn winder to address the challenges faced by Bhutanese weavers. Currently, they make yarn balls entirely by hand—a slow, painful process that often causes blisters. The traditional method involves manually rolling raw, dyed yarn into balls, then twisting multiple balls together to create thicker yarn.
Our automated yarn winder will significantly reduce manual labor while maintaining the quality of the yarn. Additionally, we want to integrated a sensor that triggers an alarm (beep sound) if the yarn gets stuck or breaks during winding.
The image below shows the traditional manual process, highlighting the need for our automated solution
Image source
BOM
Here is our BOM
Sl.No | Materials | Quantity | Specifications |
---|---|---|---|
1 | Spurs gears | 4 | 3D ptinted |
2 | Yarn Guide Rails | 2 | Adjusted length: 150mm → 200mm |
3 | Microcontroller | 2 | Arduino UNO |
4 | stepper motor | 1 | 42-32 stepper motor |
5 | motor drivers | 1 | High-temperature resistant (Silicon-based) |
6 | lead screws rod | 1 | M8X x 2 X 365mm |
7 | Screws | 25mm | |
8 | Nut and Bolt | 1 | |
9 | yarn | 1 | |
10 | Jumpers wires | 1 | |
11 | Aluminium rigi coupling | 1 | Provides torque and alignment |
12 | Tnut Pitch | 1 | M8 X 2mm |
13 | Limit switch | M8 X 2mm | |
14 | potentiometer | 1 | |
15 | DC motors | 2 | 12V DC |
Team Distribution and Team Work
Our team of four members has divided the responsibilities based on each person's strengths and expertise
- Team Lead
- Machine Design
- Mechanical Movement
- Fabrication and Assembling
- Poster
- Documentation
- Electronics
- Video
- Fabrication and Assembling
- Machine Design
- Mechanical Movement
- Fabrication and Assembling
- Programming
- Research
- Electronics
- Fabrication and Assembling
Mechine Design
We took the inspiration design from this youtube tutorial and made the sketch on how we are going to do the desigining.
Crank and Slotted Lever Quick return mechanism for our Yarn spinner.
we have initially planned to design and test to have displacement to yarn using the Quick return mechanism.Quick return mechanism will help to do displacement forward and reverse depending on the machine element we use.We decided to use spur gears.We also looked for some of the spur gear nomenclature like number of teeth, module, pitch diameter, pressure angle, fillet radius and outer diameter.But we have used fusion 360 to design our spur gear where the gear parameters were given as per our requirement.So we have designed spur gears below where our gear ratio was 2:1.
Spur gear ratio : number of teeth on Driven gear/number of teeth on Driving gear.
Therefore gear ration : 36/18 = 2:1

However, our quick return mechanism was not effective as the quick return affects the flow quickly without good pattern formation of the yarn on spinner stick.So we further decided to use Stepper motor with lead screw rod to do displacement for our yarn spin stick.
initial system diagram for our yarn spinner
Also based on the bhutanese weaver that required the yarn not in ball but in yarn that goes front and back. We design the all the required components like gears, Yarn holder, Nut and bolt from the scratch.
Fabrication and Assembly
Initial Design Fabrication
After designing our machine, we went on by converting all the design files in STL and used the Prusa and The Bambu A1 for the prinitng the the components for our machine also we gather all necessary components like bearing, rod,mason thread and screws.
After attending the Asia review, we received feedback and decided to modify our design. In our initial design, we noticed that the gears in the second row were rotating too quickly, which affected the yarn's movement forward and backward. Considering these factors, we proceeded with the second round of design modifications.
Second
This is our second modifications of our design
We 3D printed all our necessary parts
Used shopbot to cut our casing
We started assembling our prototype, We went by assembling the enclosure so we can keep all other parts.
Working Principle of our Yarn Spinner.
The yarn thread from wool pool is connected to the removable yarn spin stick via the yarn guide of the lead screw rod and make one or two turns of on it.The DC power supply equipment channels 1 and 2 are connected to the stepper motors of lead screw rod and mini DC motor of yarn spin rod respectively.When the power is 'ON' from both the channels simultaneously, the stepper motor gets started and converts the electrical energy into the rotational motion, making the lead screw rod to reciprocate to and fro, ensuring the thread guide to make displacement of about 180mm between the two limit sensors mounted each on their stands.The rod mounted vertically below it provide support and regulate smooth movement of thread guide.
Mean while, the removable yarn spin stick rotates as its motor starts, making the yarn to make its pattern of 180mm on the stick.The user can stop this when it reach to the required size of the yarn spin and stop the DC power supply channel switches.Remove the yarn spinned stick and place new one to continue the work.
Final Design and fabrication of Yarn Spinner parts.
- Stand for Stepper motor.
The steps below shows how it is designed which was to be mounted on the base.
We have choosed top plane and sketched with those dimensions and extruded.
Our stepper motor stand looked as below and was done Slicing and 3D printed.
- Stand for Yarn Spin. Again choosed top plane to draw that.
Copied the sketch and made slight change to the above stand where the spinned yarn stand can be removed through it.
- Stand for lead screw rod.
We have edited to the yarn stand by making at slot where the limit sensor can be clamped with it.
The thickness was also increased.
Then, 3D printed the stand.
- Spur gear Using the Fusion 360 under Utility, we have set specification of spur gear required and 3D printed.
- Motor holder. To make mini DC motor stable for yarn spin, we have designed it and 3D printed.
- Wool frame base.
- Joint for Wool frame shaft.
- Yarn Guide.
The first 2 trial designs for yarn guide were changed as we wanted to make it more effective by mounting the T nut inside it.This was our initial designs.
So the final design for yarn guide is below.
- Yarn Wool frame
The wool frame was designed and copied to four numbers and was cut using laser machine.We used 5mm transparent acrylic sheet.
- Encloser.
We have used ShopBot machine to cut the encloser using the 12mm rubber wood.
Mechanical Movement.
We run the short test to see how our machine is going to work, We gave the power supply of 9VDC and connected the yarn and test.
Our first working video
Here ran the test on our second design
Electronics and Programming
We decided to use two Arduino Board for simplicity. One board to control stepper Motor which is responsible to guide the thread by moving to and fro and another to control the speed of DC motor responsible to roll the thread.
Here is the program to drive the stepper motor:
// Pin definitions
const int dirPin = 4; // Direction control pin
const int stepPin = 5; // Step control pin
const int limitSw_1 = 8; // Limit switch 1 (normally HIGH, LOW when pressed)
const int limitSw_2 = 9; // Limit switch 2 (normally HIGH, LOW when pressed)
// Motor parameters
const int STEP_DELAY = 500; // microseconds between steps (controls speed)
const int STEPS_PER_CYCLE = 200; // Number of steps per movement cycle
void setup() {
// Initialize pins
pinMode(limitSw_1, INPUT);
pinMode(limitSw_2, INPUT);
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
// Start with motor direction set to LOW
digitalWrite(dirPin, LOW);
}
void loop() {
// Read limit switches (externally pulled up, so LOW means pressed)
bool limit1Pressed = (digitalRead(limitSw_1) == LOW);
bool limit2Pressed = (digitalRead(limitSw_2) == LOW);
// Determine current direction
bool currentDir = digitalRead(dirPin);
// Movement state machine
if (currentDir == LOW) {
// Moving towards limit switch 1 (direction LOW)
if (!limit1Pressed) {
// Not at limit, keep moving
motorStep(STEPS_PER_CYCLE);
} else {
// Hit limit, reverse direction after brief pause
delay(100); // Small delay at limit
digitalWrite(dirPin, HIGH);
}
} else {
// Moving towards limit switch 2 (direction HIGH)
if (!limit2Pressed) {
// Not at limit, keep moving
motorStep(STEPS_PER_CYCLE);
} else {
// Hit limit, reverse direction after brief pause
delay(100); // Small delay at limit
digitalWrite(dirPin, LOW);
}
}
}
void motorStep(int steps) {
for (int i = 0; i < steps; i++) {
// Check limits during movement for emergency stop
if (digitalRead(limitSw_1) == LOW && digitalRead(dirPin) == LOW) {
return; // Stop if hitting limit while moving toward it
}
if (digitalRead(limitSw_2) == LOW && digitalRead(dirPin) == HIGH) {
return; // Stop if hitting limit while moving toward it
}
digitalWrite(stepPin, HIGH);
delayMicroseconds(STEP_DELAY);
digitalWrite(stepPin, LOW);
delayMicroseconds(STEP_DELAY);
}
}
This program controls a stepper motor that moves back and forth between two limit switches.
i. Initialization: - Sets up pins for the stepper motor (direction and step control) and two limit switches. - The limit switches are normally HIGH (using external pull-up resistors) and go LOW when pressed.
ii. Main Loop Logic: - The motor continuously moves in one direction (LOW) until limit switch 1 is pressed. - When limit switch 1 is hit, it pauses briefly (100ms), then reverses direction (HIGH). - The motor then moves in the opposite direction until limit switch 2 is pressed, then reverses again.
iii. Stepping Function:
- The motorStep()
function sends pulses to move the motor a specified number of steps.
- It constantly checks the limit switches during movement for emergency stopping.
- Each step consists of a HIGH/LOW pulse with a delay (STEP_DELAY) controlling the speed.
iv. Behavior: - The motor will continuously oscillate between the two limit switches. - The movement speed is determined by STEP_DELAY (smaller = faster). - STEPS_PER_CYCLE determines how many steps are taken between limit checks.
This creates an automatic back-and-forth motion that reverses whenever either limit is reached.
Here is the program to drive the DC motor:
// Define motor control pins
const int ENA_PIN = 9; // PWM speed control (ENA on HW-310)
const int IN1_PIN = 6; // Direction pin 1
const int IN2_PIN = 5; // Direction pin 2
// Define potentiometer pin
const int POT_PIN = A0; // Potentiometer connected to A0
void setup() {
// Set motor control pins as outputs
pinMode(ENA_PIN, OUTPUT);
pinMode(IN1_PIN, OUTPUT);
pinMode(IN2_PIN, OUTPUT);
// Set motor direction (clockwise)
digitalWrite(IN1_PIN, HIGH); // IN1 = HIGH → CW
digitalWrite(IN2_PIN, LOW); // IN2 = LOW → CW
// Initialize Serial Monitor (for debugging)
Serial.begin(9600);
}
void loop() {
// Read potentiometer value (0-1023)
int potValue = analogRead(POT_PIN);
// Map potentiometer value to PWM range (0-255)
int motorSpeed = map(potValue, 0, 1023, 0, 255);
// Apply PWM to control motor speed
analogWrite(ENA_PIN, motorSpeed);
// Print speed to Serial Monitor (optional)
Serial.print("Potentiometer: ");
Serial.print(potValue);
Serial.print(" → Motor Speed: ");
Serial.println(motorSpeed);
// Small delay for stability
delay(100);
}
This program controls a DC motor's speed and direction using a potentiometer.
i. Pins Setup:
- ENA_PIN
(PWM) controls motor speed (0-255)
- IN1_PIN
and IN2_PIN
control direction (HIGH/LOW combinations)
- POT_PIN
(A0) reads the potentiometer value (0-1023)
ii. Initialization:
- Sets motor direction to clockwise (CW) by default (IN1=HIGH
, IN2=LOW
)
- Starts serial communication for debugging (optional)
iii. Main Loop:
- Reads the potentiometer value (0-1023
)
- Maps it to a PWM speed (0-255
) for motor control
- Adjusts motor speed via analogWrite(ENA_PIN, motorSpeed)
- Prints readings to the Serial Monitor (optional)
- Small delay (100ms
) for stability
- Turning the potentiometer increases/decreases motor speed smoothly. The motor always spins in the same direction (clockwise) unless
IN1/IN2
are changed. Speed ranges from 0 (stopped) to 255 (max speed) based on the potentiometer position. This is a basic speed control program for a DC motor using PWM and a potentiometer.
Future Development and Improvements
🔄 Smart Yarn Monitoring System
- Integrated tension sensors to detect yarn jams/breaks
- Visual (LED) + audible (buzzer) alerts for immediate troubleshooting
- Integrating one more stepper motor to control the number of yarn counts
⚙️ Optimized Electronics
- Combined dual Arduino boards into a single unified control system
- Streamlined programming for smoother operation
📦 Compact Enclosure
- Redesigned casing using Fusion 360 for space efficiency
- Ergonomic layout for better user accessibility
Design files
Design and Programming files is here