As an Amazon Associate we earn from qualifying purchases.
Etching your own printed circuit boards is one of the most useful skills in DIY electronics. It is also tedious. You have to keep the board moving in the etchant for many minutes, and a tray that is left still etches slowly and unevenly. An automatic PCB etcher takes over that job by gently rocking the tray for you.
This project uses a small PIC microcontroller to switch a motor back and forth so the etching tray keeps moving without your hands. The video below shows the project, and the full program is further down the page.
Why agitation matters when etching a PCB
Etching works by dissolving the unwanted copper from a board while the copper you want is protected by toner, ink or photoresist. As the etchant reacts with copper, the liquid next to the board becomes saturated with dissolved metal and works more slowly. Moving the board or the tray brings fresh solution to the surface.
Constant, gentle movement usually gives you:
- faster and more even etching across the whole board
- less undercutting of fine traces caused by over-etching one corner while waiting for another
- no need to stand over the tray and rock it by hand
How an automatic PCB etcher works
The idea is simple. A motor, driven first in one direction and then the other, tilts or rocks a tray that holds the board and the etching solution. A microcontroller decides when each direction is switched on, and a motor driver supplies the current the motor needs, because a microcontroller pin cannot power a motor directly.
The main parts are:
- A PIC12F508 microcontroller that generates the timing.
- A motor driver such as an L293D, which lets the motor run in both directions. A step-by-step build using the PIC12F508 and L293D version is covered in a separate article.
- A small DC motor with a rocking mechanism that moves the tray.
- A power supply suited to the motor and the driver.
- A plastic tray to hold the board and the etchant.
The program
The code below configures the PIC12F508, sets all the GPIO pins as outputs and then alternates between two pins. Pin GP5 is switched on for 600 ms, then switched off, then GP4 is switched on for 600 ms and switched off, and the cycle repeats forever. When those two pins are connected to the direction inputs of a motor driver, the motor turns one way, then the other, which produces the rocking motion.
#include<pic.h>
OSSCAL=0X80;
__CONFIG(0X0FEA);
#define _XTAL_FREQ 4000000
void del(void);
unsigned short int a=0;
void main(void)
{
TRISGPIO=0x0;GPIO=0;
OPTION= 0XC0;
while(1)
{
GP5=1;del();GP5=0;
GP4=1;del();GP4=0;
}
}
void del(void)
{
__delay_ms(600);
}
Understanding the code
- _XTAL_FREQ is set to 4 MHz, which the delay function uses to calculate timing. The PIC12F508 runs from its internal 4 MHz oscillator here.
- TRISGPIO = 0 makes the pins outputs, and GPIO = 0 starts them all low so the motor is off at power-up.
- del() is a single 600 ms delay. Changing that number changes how long the tray moves in each direction.
- The while(1) loop repeats the two-step sequence for as long as the circuit has power.
Adjusting the rocking motion
The timing depends on your mechanism. A longer delay tilts the tray further in each direction, while a shorter one makes it rock faster. Try different values with plain water in the tray before adding etchant. If the motor reverses abruptly and the mechanism jerks, you can add a short pause with both pins low between the two directions.
Before you etch: preparing the board
A good etcher cannot rescue a poor layout, so the board needs to be right before it goes in the tray. Start by designing the PCB carefully, with sensible trace widths and clearances for the etching method you use. If your circuit carries significant current, it is worth being able to check trace resistance before you commit to a layout.
For the toner transfer method, the artwork must be printed at original size so that component footprints line up with the real parts. Whatever method you use, clean the copper well before applying the resist, as grease and oxidation cause patchy results. If you are new to the layout stage, the article on PCB designing is a good starting point.
Safety when etching
Etching chemicals can stain, burn skin and damage eyes, so treat them with care.
- Wear gloves and eye protection, and protect your clothes.
- Work in a ventilated area.
- Use plastic or glass containers only. Never use metal trays or tools in the etchant.
- Keep the electronics of the etcher, including the driver board and its supply, away from any splashes.
- Do not pour used etchant down the drain. It contains dissolved copper, so follow your local rules for chemical waste.
Rocking motion can also make liquid slosh, so choose a tray with enough depth and do not overfill it.
Tips for better results
- Keep the board fully covered by the solution so that the whole surface etches at the same rate.
- Check the board regularly instead of relying on a fixed time, since etching time depends on the etchant, its age, its temperature and the copper thickness.
- Stop as soon as all the unwanted copper has gone. Leaving a board in longer thins the traces.
- Rinse the board thoroughly with water afterwards, then remove the resist and clean the copper before drilling and soldering.
Frequently asked questions
Why use a microcontroller instead of a simple timer or a constant motor?
A constant motor turns in only one direction, so it needs extra mechanics to produce a rocking motion. A microcontroller makes it easy to reverse the motor on a schedule, and you can change the timing just by editing a number in the code.
Can I power the motor directly from the PIC pins?
No. The pins can only supply a small current. Use a motor driver such as the L293D between the microcontroller and the motor, with a power supply that suits the motor.
Do I need an automatic etcher to make good PCBs?
No. You can etch by rocking the tray by hand, and many people do. An automatic etcher just keeps the movement steady and frees you to do something else while you watch the board.
What does the 600 ms delay control?
It sets how long the motor runs in each direction before the other direction is switched on. Increase it for longer swings and decrease it for faster, shorter ones.