Arduino 2D Printer

Arduino Python Image Processing
Arduino 2D printer build
The finished printer.

Overview

A 2D printer powered by an Arduino UNO, inspired by 2D CNC machines. Two NEMA17 stepper motors handle each axis, plus a servo motor that drops or lifts a pen to plot dots. The motors draw around 1.2A at 12V while printing. Internally, the Uno holds a 32x32 boolean array, plotted one dot at a time, and a full image takes 2 to 4 minutes worst case, after which the Python side prepares the next image.

How it works

Image processing

Uses the PIL Image module on the Python side. The source image is opened, converted to black and white, and resized to 32x32 pixels. The result is plotted with matplotlib for a preview, then sent to the Arduino over the serial port byte by byte.

Printing mechanism

A platform sits on the base. A stepper motor mounted on the platform controls y-axis movement through a coupling connector linking the motor shaft to a threaded rod, and a base mounted on that rod moves as the motor turns. A matching assembly controls x-axis movement of the servo motor, which drops the pen to draw and lifts it to move without marking the page. Stepper motors run off a 12V supply and are driven by pulses from the Arduino; the servo is Arduino-controlled as well.

The Python program converts a .bmp image into a 32x32 pixel bit array and sends it over serial. A green LED lights when the Arduino is ready to read; a red LED stays on while printing. The Arduino reads the array, rebuilds it as a 2D array, and iterates through it in a nested loop, dropping the pen on a 1 and lifting it on a 0. Once done, the stepper motors return to the origin point.

Printer schematic
Wiring schematic for the motors, drivers, and Arduino.

Algorithm

A scanning algorithm following a snake pattern plots every point, giving the best time efficiency without further optimization.

Specifications

Images of 8x8cm have been printed within 2 to 4 minutes. Pixel density is 35 steps per pixel, roughly 1mm.

Structure

Built from wood. A 22x20cm board forms the base. 20x4.5cm and 22x5cm pieces form the motor assembly bases, and 4.5x5cm and 4.5x4.5cm pieces form the walls, with holes drilled for the threaded rods. Another 4.5x5cm piece serves as the platform for the second motor, supported by wooden skewers glued to the walls.

Output

Sample printed output
A finished print.

Conclusions

A fun project that gave real insight into mechanics, mathematics, and motors, and hands-on experience with Arduino serial communication, including casting data points from bools to bytes and back for storage in the Arduino's array.

References

← Back to all projects