Design a machine that includes mechanism+actuation+automation+application.
Build the mechanical parts and operate it manually.
Document the group project and your individual contribution
The Sand Drawing Machine is a creative automation project that combines mechanical engineering, electronics, and software automation to draw patterns and shapes on sand using servo motors and a magnet-based actuation system. The machine simulates a zen garden-style drawing system where a ball or stylus is moved across a flat sand surface to trace intricate designs.
Our project fulfills the criteria of mechanism, actuation, automation, and application
This hardware setup enables smooth and accurate movement in both X and Y directions, forming the base for our automated drawing mechanism.
Hardware ScreenshotsI was responsible for the electronics, software, and automation aspects of the project.
The Sand Drawing Machine is a polar-coordinate CNC robot that creates intricate geometric patterns in sand
using a combination of:
-> Linear motion (radial arm movement)
-> Rotational motion (circular sweep)
-> Pen lift mechanism (servo-controlled)
Reference Link
ESP32-Powered Tabletop Kinetic Sand Drawing Robot Tabletop Sand RobotComponent | Specifications | Purpose |
---|---|---|
ESP32 | Dual-core, Wi-Fi | Main controller |
NEMA 17 Stepper (x2) | 1.8°/step, 12V | Linear & rotational motion |
Servo Motor | 180° rotation and Linear rotation | Pen up/down mechanism |
Hall Effect sensor | SS49E | Detect a reference (home) position |
Polar Motion System
Rotational Axis: Stepper rotates the entire arm.
Linear Axis: Stepper moves the pen radially.
Pen Mechanism:
Servo lifts/lowers the drawing tool.Conceptual Diagram: Polar Coordinate Robot Arm
-> Wi-Fi Access Point (AP) Mode: Hosts a web server for remote control.
-> G-code Interpreter: Parses commands (G0, G1, M3, M5, G28).
-> Stepper Motor Control: Uses AccelStepper for smooth motion.
-> Homing Routine: Uses endstops to find zero position.
1. Initialization:
-> Start Wi-Fi AP (ssid: iTN-FORGE/s, password: ForgeXForged).
-> Configure steppers (STEPS_PER_MM = 80, STEPS_PER_DEG = 200/360).
-> Attach servo (PEN_UP_ANGLE = 90, PEN_DOWN_ANGLE = 0).
2. G-code Processing:
-> G0/G1 (Linear Move):
Converts X (angle) and Y (radius) to stepper steps.-> M3/M5 (Pen Control):
Moves motors asynchronously (stepper.run() in loop()).
M3 -> Pen down (servo.write(0)). M5 -> Pen up (servo.write(90)).-> G28 (Homing):
Moves motors backward until endstops trigger (digitalRead(HOME_PIN)).
Web Server Endpoints:
Endpoint | Description |
---|---|
/upload | Receives G-code |
/status | Returns machine state (ready/busy/homing) |
/home | Triggers homing |
/stop | Emergency stop |
/clear | Clears G-code buffer |
-> Pattern Generation: Circle, Spiral, Flower.
-> Image-to-G-code Conversion: Processes uploaded images.
-> Real-time Status: Checks ESP32 connection.
-> G-code Preview & Download.
-> Converts image pixels to polar coordinates.
-> Dark pixels - Pen down movements.
-> Sorts points by angle for continuous drawing.
Fetch API for sending G-code
Status Polling (every 3 sec)
Controls
1. User uploads image/selects pattern.
2. Web UI converts it to G-code.
3. G-code sent to ESP32 via /upload.
4. ESP32 parses and executes movements.
5. Real-time status updates in UI.
Issue | Solution |
---|---|
ESP32 not reachable | Check Wi-Fi AP, CORS headers |
Motors not moving | Verify stepper wiring & power |
G-code upload fails | Increase fetch timeout, check server logs |
Pen not lifting | Calibrate servo angles |
This system allows automated sand art creation with
-> ESP32 for motor control.
-> Web UI for easy pattern design.
-> Polar coordinate G-code for smooth drawing.
Click on the links below to download the Program: