This is an old revision of the document!
This project is an interactive, standalone CNC-style drawing machine powered by the ATmega328P microcontroller. It translates user inputs from a resistive touch panel or pre-loaded data into precise mechanical motion using NEMA 17 stepper motors. The system features a built-in UI displayed on an ILI9486 LCD, allowing the user to select between distinct operating modes via a potentiometer.
Mini-Plotter is an automated drawing system based on the ATmega328P-XMINI. The system operates as a closed-loop interface where user input is captured via a resistive touch screen or an SD card and translated into physical motion through two NEMA 17 stepper motors. The project logic is divided into three functional layers:
| Component | Specification | Role/Connection |
|---|---|---|
| ATmega328P-XMINI | 8-bit Microcontroller | Central processing and logic control |
| NEMA 17 Stepper | 1.8° Step Angle, High Torque | Dual-axis (X-Y) mechanical movement |
| DRV8825 Driver | Up to 1/32 microstepping | Current control for stepper motors |
| ILI9486 LCD Module | 3.5” TFT with Integrated SD Slot | UI display and data storage (SPI Interface) |
| Resistive Touch | 4-Wire Overlay | Coordinate input for manual drawing |
| Potentiometer | 10k Ohm Rotary | Menu navigation and mode selection |
| Power Supply | 12V DC / 2A | Powering motors and logic (via step-down) |
The hardware architecture of the mini-plotter has been fully designed, verified, and mapped. The implementation is executed in two concurrent phases:
Due to the high number of peripherals required by this project (2 stepper drivers, an 8-bit parallel display, an SPI SD card reader, a touch panel, and a navigation potentiometer), the ATmega328P's pin map is utilized at 100% capacity.
To achieve this without using external multiplexers or IO expanders, several hardware-level optimizations were implemented:
| Component | Pin Name | MCU Pin | Type | Technical Justification |
|---|---|---|---|---|
| X-Axis Driver (A1) | STEP | PD2 | Digital Out | Dedicated hardware pin for step pulses. |
| DIR | PD3 | Digital Out | Direction control logic signal. | |
| Y-Axis Driver (A2) | STEP | PD4 | Digital Out | Dedicated hardware pin for step pulses. |
| DIR | PD5 | Digital Out | Direction control logic signal. | |
| SD Card Module | SD_SS | PB2 | Digital Out | Dedicated Slave Select line for SPI. |
| SD_DI (MOSI) | PB3 | Hardware SPI | Master Out Slave In - standard high-speed data line. | |
| SD_DO (MISO) | PB4 | Hardware SPI | Master In Slave Out - standard high-speed data line. | |
| SD_SCK | PB5 | Hardware SPI | Serial Clock line to synchronize data transfers. | |
| ILI9486 LCD (Control) | LCD_RST | PC4 | Digital Out | System reset line for the display controller. |
| LCD_CS | PC3 | Digital Out | Chip Select line for the parallel display bus. | |
| LCD_RS | PC2 | Digital Out | Register Select (Commands vs. Pixel Data). | |
| LCD_WR | PC1 | Digital Out | Write strobe signal clocking the 8-bit bus. | |
| LCD_RD | +5V | Hardwired | Optimization: Permanently tied to High. The MCU only writes data; reading from the display is disabled to save 1 digital GPIO pin. | |
| ILI9486 LCD (Data) | LCD_D0 - D1 | PD0 - PD1 | Parallel Bus | Lower 2 bits of the 8-bit data bus. |
| LCD_D2 - D3 | PD6 - PD7 | Parallel Bus | Middle bits of the 8-bit data bus. | |
| LCD_D4 - D5 | PB0 - PB1 | Parallel Bus | Higher bits of the 8-bit data bus. | |
| LCD_D6 - D7 | PC0 - PC5 | Parallel Bus | Remaining bits routing the full parallel byte. | |
| Peripherals | Potentiometer | ADC6 | Analog In | Optimization: Connected to a dedicated analog-only pin, saving general-purpose digital IO pins. |
| Touch Panel | ADC7 | Analog In | Connected to the second analog-only input channel. |
The circuit diagram is structurally grouped into three distinct functional blocks to isolate high-power inductive loads from sensitive logic electronics:
The main system power is provided by an external 12V DC / 2A adapter connected through a DC Barrel Jack (J1).
Two Pololu DRV8825 breakout boards control the NEMA 17 stepper motors.
The display block handles the routing for the 3.5” TFT LCD Shield. It separates the high-volume display pixel transfers onto an 8-bit parallel topology while routing the SD Card operations through the standardized hardware SPI pins (`MOSI`, `MISO`, `SCK`).