StringIT! – Automated String Art Machine
by PushapRaj in Circuits > Robots
223 Views, 3 Favorites, 0 Comments
StringIT! – Automated String Art Machine


Let's build String IT!--an automated string art machine that transforms digital images into intricate thread-based portraits on a circular wooden canvas. It’s a custom-designed 2-DOF system combining mechanical precision, algorithmic optimization, and aesthetic expression turning math into art.
At first glance, string art might seem like just decoration. But look closer, and it’s a fascinating intersection of geometry, pattern recognition, and motion control. Inspired by Barton Dring’s open-source string art plotter, and wanted to design something both technically challenging and visually rewarding. We had seen hand-crafted string art before mesmerizing but time-consuming. That sparked the question: Why not automate it?
So we did. We developed three key modules:
- A rotating base platter for precise angular positioning of the workpiece,
- An automated drilling module to create consistent anchor points,
- And a thread feeding system to lay the string with precision.
Driven by ESP32, stepper motors, and custom firmware, fully integrated control system that automates the entire process from drilling to feeding.
To generate the artwork, we implemented a custom Python-based greedy algorithm that calculates the optimal thread path from a grayscale image. The final coordinates are interpreted by the ESP32 to drive the machine in real-time.
Supplies
.jpeg)
Components used:
1. 1 x Stepper Motor (Nema 23) https://amzn.in/d/5RwgSwB
2. 2x servo motor (MG 996) https://amzn.in/d/0PTIxyD
3. Power Supply (SMPS) https://amzn.in/d/82eb76W
4. Motor Driver (DRV 8825) https://amzn.in/d/fwxbegs
5. 1 x ESP32 https://amzn.in/d/eI2UVbu
6. 1 x limit switch https://amzn.in/d/iIEv6jE
7. 1 x drilling motor (dc motor) https://amzn.in/d/3QocyhS
8. 1 x DC-to-DC buck converter https://amzn.in/d/hd7GoC3
9. Nails- as per the drill bit size
10. Thread
11. Needle
12. 3D-printed parts
13. Wooden Pieces
14. Gears
Downloads
Simulating String Art With Greedy Algorithm
_250604_163009.jpg)


Simulating string art using a greedy algorithm in Python, a step-by-step method that selects the best nail-to-nail connection at each stage to minimize the difference from the original image.
The result is a sequence of nail positions, which, once visually verified through simulation, can be directly fed into a physical system to weave the artwork.
But it all begins with a deceptively simple step, grayscale conversion, and it turns out this is far more important (and nuanced) than it looks.
I explored and implemented three methods for grayscale conversion:
--> Equal Weighted Average
--> Luma-Weighted Average
--> Principal Component Analysis (PCA)
Each method reduces the image to a single luminance-based channel, simplifying edge detection and pixel-wise comparisons, but they do so differently. PCA, for example, finds the direction of maximum variance across RGB channels and offers better contrast. We even compared all three using MSE, variance, and SSIM metrics.
A blog on the Gray scale conversion. Check it out here- Link
Additionally, Gaussian blurring was applied to help reduce noise in the image, resulting in smoother gradients and better final outcomes.
Want to try generating your own string art? Check the files attached.
Downloads
Setting Up the Rotating Base




Once the string art path was generated in code, we needed a physical system to follow that path starting with a rotating platform that could precisely position the artwork during stringing.
The Base Structure
We used a 60 cm circular wooden board as our artwork canvas and mounted it on a custom-built rotating wheel structure. This rotating base acts as the primary degree of freedom (rotation) for the string art generation.
Motorized Rotation & Gear Ratio
To rotate the base with high angular precision, we used
- A NEMA 17 stepper motor
- A custom rotating wheel mount for the wooden plate
To increase rotational resolution and improve torque, we introduced a gear ratio between the motor and the rotating plate. Specifically:
- The motor pulley had fewer teeth (e.g., 10 teeth)
- The plate pulley had more teeth (e.g., 200 teeth)
This results in a 20:1 gear ratio, meaning
- For every full revolution of the motor, the plate rotates only ¼ turn.
- This effectively multiplies our angular precision by 4 so each motor step results in a smaller angle of rotation on the plate, enabling finer positioning of each string segment.
Control System
- The stepper motor was driven using an A4988 motor driver connected to our ESP32 microcontroller.
- The ESP32 receives the nail sequence and sends commands to rotate the plate to the corresponding angles.
- The microcontroller calculates the number of steps to rotate from one nail to the next, factoring in the gear ratio to maintain accuracy.
This gear-reduced rotation setup ensures:
- High angular precision even with a low-cost stepper motor
- Stable and smooth movement, minimizing backlash and vibration
- Alignment with the simulation coordinates, so the physical thread follows the same pattern generated in Python.
The Drilling Module



Before we could begin threading, we needed evenly spaced anchor holes around the perimeter of the circular wooden base. To automate this, we built a custom drilling module that creates each hole accurately no manual measuring or hammering required!
Why Automate Drilling?
Placing nails or anchor holes by hand is not only tedious but also prone to error. We wanted:
- Perfect alignment with the digitally generated nail positions
- Repeatable precision
- Time savings during setup
The Mechanical Setup
Our drilling module features vertical (slanted Z-axis) movement, allowing the drill to move up and down to pierce the board. To achieve this using a rotating motor, we implemented a lead screw mechanism.
How It Works:
- A drill carriage (holding the drilling tool) is mounted on a nut that rides along the screw.
- As the motor rotates the lead screw, the nut moves up or down converting rotational motion into linear motion.
This setup works with
- Smooth and accurate vertical travel
- High-precision servo motor
- Load-bearing ability to support the drill's weight
Control:
- The base rotates to the desired angle using the setup from Step 2.
- The drill module lowers using the lead screw mechanism.
- The drill spins and creates a hole at that position.
- The module retracts back up and rotates to the next index.
This cycle is repeated for all anchor points, giving us perfectly placed holes for threading.
Pro Tips
- Add endstop switches or a current-based stall detection to prevent overdriving.
- Use a 1/16 drill bit depending on the thread size.
- Add a cooling fan or heatsink if your drill motor gets warm during continuous operation.
Thread Feeding System

.jpeg)

Once the anchor holes were drilled and the rotating base was ready, the final and most magical part of the build came into play: the thread feeder module.
This is the component responsible for:
- Pulling the thread from a spool
- Extending it across the rotating base to the desired anchor point
- Looping it securely over the nail or hole
- Retracting or resetting to prepare for the next path
We needed a mobile thread feeder arm that:
- Can move radially (inward and outward from the center of the circle)
- Precisely position itself over anchor points
- Drop the thread onto a nail or into a hole without tangling
- Operates in sync with the rotating base
We designed a radial arm mounted on a linear track that moves in and out from the center of the base.
Mechanical Setup:
- A servo motor drives a rack and pinion to move the feeder carriage radially.
- The feeder tip includes a small guide tube or loop that directs the thread precisely onto the anchor point.
- Once the string is placed, the feeder retracts or moves to the next point.
Each step in the stringing process involves:
- Rotating the base to bring the previous anchor into position
- Extending the feeder to reach the next anchor point
- Placing the thread accurately and cleanly
- Retracting and preparing for the next connection
All of this is orchestrated using custom code on the ESP32, which reads the nail sequence generated by the greedy algorithm.
Tips for Smooth Feeding
- Use a light but stiff guide arm to avoid flexing.
- Ensure the thread moves freely through the guide without catching.
- Maintain constant tension using a passive spring or active motor clutch.
- Test first with nylon or cotton thread they feed smoothly and don’t fray easily.
Electronics & Control System

The mechanical parts are only half the story the precision and automation of our string art machine are powered by a carefully designed electronics setup, all orchestrated by the ESP32 microcontroller.
Our system operates in two main phases, each requiring coordinated motor control and timing:
Phase 1: Drilling Automation
During this phase, the base plate and drill module work in perfect sync:
- The ESP32 commands the base plate (driven by a stepper motor) to rotate to the desired hole position.
- The servo motor lowers the drill head onto the wooden board.
- The drilling motor, powered by a 12V supply, engages and creates a clean hole.
- The servo retracts the drill head.
- The base plate rotates to the next anchor position and the cycle repeats until all holes are drilled.
Power & Control Details:
- Drill Motor: Powered using a 12V supply regulated via a buck converter from a 20V SMPS.
- Servo (Z-axis): Lowers and raises the drill, connected to the ESP32 PWM pins.
- Base Stepper Motor: Controlled via a DRV8825 motor driver, using STEP and DIR pins from the ESP32 for precise angular control.
Phase 2: Stringing the Art
Once drilling is complete, the ESP32 switches to stringing mode using the precomputed list of pin connections generated from the greedy algorithm.
- The base rotates to align the thread with the starting pin.
- The thread feeder (driven by a servo motor) extends forward to hook the thread.
- The base rotates slightly (by a few degrees) to add tension and wrap the thread securely.
- The feeder retracts.
- The ESP32 reads the next pin from the list and repeats the process.
Over time, these movements connect each pin-to-pin path seamlessly, recreating the string art image with consistency.
Below is a simplified version of the ESP32 firmware written in Arduino. It demonstrates the core logic for:
- Controlling the rotating base using a stepper motor and DRV8825
- Raising and lowering the drill head with a servo
- Operating the thread feeder with another servo
- Synchronizing movement based on a predefined nail sequence
Challenges & Further Improvements
Challenges
Building the string art machine was far more complex than it appeared on paper. To turn a digital image into physical thread art, the system had to:
- Convert the image into a sequence of lines between anchor points
- Choose an optimized path from thousands of line combinations
- Maintain precise tension tight enough to stay in place, but not so tight that it breaks
- Control multiple motors and mechanisms in sync to complete the pattern without failure
Several challenges surfaced during development:
- Wooden components expanded and contracted with temperature, affecting precision
- Components burned out, power dipped unexpectedly, and alignment was lost mid-run
- Thread drift accumulated over hundreds of cycles, leading to visible distortion in the image
- Minor mechanical inaccuracies became major issues when repeated hundreds of times
- Tension control required manual tuning and frequent resets during early trials
Despite these issues, the system reached a stable and functional state through careful debugging, iteration, and tuning.
Solutions and Further Updates:
- Replace wooden base with MDF, acrylic, or aluminum to reduce thermal distortion
- Use a dual-rail power system with proper buck converters and overcurrent protection
- Add homing and calibration routines periodically to minimize drift accumulation
- Introduce limit switches or encoders for absolute motor position referencing
- Upgrade stepper drivers (e.g., TMC2209) and use low-backlash belts or lead screws
- Add a spring-loaded or servo-controlled tensioning system for dynamic thread control
- Integrate a GUI for image upload, preview, and sequence export
- Use vision feedback (e.g., camera + OpenCV) to correct errors during threading
- Design the structure to be modular or foldable for portability and easy reassembly
Conclusion

What's Next?
Try generating your own artwork, adjust the number of nails, or even test out new materials. We encourage makers to modify the design, share their builds, and suggest improvements.
This project taught us how creative computation and engineering can come together to make machines that draw with math and weave with art.