Bare Metal STM32 Development on Windows

It’s been a year and a half since I last posted on this and some new tools are available; they work great with STM32L1xx, STM32F1xx, STM32L4xx, etc.

  1. For an integrated IDE, I still like EmBitz
  2. When working from the command line, I still like vim for Windows
  3. For hardware-level debugging (JTAG/SWD), OpenOCD has dramatically improved their support for STM32 and is now better than the Texane STLink IMHO.  You can download windows binaries and the pdf manual or browse the online documentation.  OpenOCD is a GDB server that listens on:
    • port 3333 for a GDB debugger connection for source-level debugging
    • port 4444 for a telnet connection and sophisticated command line interface that lets you use commands like these:

      > stm32l4x unlock 0 (unlock flash bank 0)
      > stm32l4x mass_erase 0 (erase all flash)
      > flash probe 0
      > flash list
      > flash erase_address 0x08000000 0x3000
      > flash write_image myProgram.bin 0x08000000
      > reset halt
      > mdb 0x08000000 32 (dump 32-bytes at start of flash)

    OpenOCD supports many target processors and many hardware interfaces; when you launch OpenOCD, you must pass it two parameters that tell it which hardware interface to use and what target it will be controlling. For example:

    openocd -f interface\stlink-v2.cfg -f target\stm32l4x.cfg

    There are many pre-built configuration files in the interface and target sub-directories wherever you installed openocd. If your interface or target aren’t supported, the configuration files are text and can be easily edited to support your needs.

  4. GNU ARM Embedded Toolchain continues to be the best pre-compiled toolchain and is kept up-to-date.  It includes gdb which can attach easily to an OpenOCD server and let you do source-level debugging from its command-line interface and is well documented and there are many tutorials and cheatsheets.  An example of the CLI use is:
    arm-none-eabi-gdb <myApplication.elf>
    (gdb) target extended-remote localhost:3333
    (gdb) load myApplication.elf (loads image into flash)
    OR
    (gdb) file myApplication.elf (to debug an image already in flash)
    (gdb) set remote hardware-watchpoint-limit 6
    (gdb) b main
    (gdb) monitor reset run
    (gdb) c
    (gdb) step (s) or next (n)
    (gdb) i b (info breakpoints)
    (gdb) list [fnName]
    (gdb) interrupt (halt execution)
    (gdb) print <symbolName>
  5. Note: the ‘monitor’ command lets you issue any of the OpenOCD CLI commands from within GDB. For example:
    (gdb) monitor reset halt(reset target and halt target)

  6. Eclipse CDT (especially the standalone version) integrates nicely with gdb and OpenOCD and provides a friendly, smart, graphical source-level debugger.
    • On launch, select the appropriate .elf file for debugging at first dialog
    • Under Window->Preferences->C/C++->Debug->GDB set GDB debugger to arm-none-eabi-gdb (in the appropriate directory – you only need to do this once)
    • In a separate Command window, start OpenOCD with the appropriate interface and target (see above)
    • Under File->Debug Remote Executable: set Binary to the .elf file, Hostname to localhost, Port to 3333, check Attach (you should see gdb connect in the OpenOCD window)
    • In the bottom panel of Eclipse CDT, select the Debugger Console tab (accesses the gdb console)
      • file myProgram.elf (if the firmware is already running on the target)
        OR
      • load myProgram.elf (to program the .elf file into the target flash)
      • b main
      • monitor reset run OR
      • monitor reset halt
      • jump Reset_Handler
      • next
      • print myVariable
      • continue
    • From there you can step into/over lines of source code, browse variables and C and assembler source code, view/set/clear breakpoints graphically, and do everything you would expect from a modern debugger.
    • You can read more about it here.

Hybrid Smartwatch

For a long time, I resisted the urge to buy a smartwatch.  Most of them look like you’ve strapped a cellphone to your wrist,  they need to be recharged nightly, they require a button press or a wrist flick just to see the time, many aren’t waterproof, and most of the features aren’t appealing to me due to the small screen.  I tried wearing a fitness band and a regular watch, but wearing two things bugged me.

To the rescue comes the Withings Steel HR, a hybrid of an analog watch, a smart watch, and a fitness band in a nice looking package that is slightly smaller than my old watch.  I’ve been wearing it for several weeks now and I really like it.

The winning features include:

  • Small and light, no bigger than a normal watch
  • Professional appearance
  • Analog hands show time at a glance
  • Fitness dial shows steps at a glance
  • Heartrate monitoring
  • Waterproof
  • Bluetooth link to decent smartphone app
  • 3 week battery life for smart features, longer for watch and steps.
  • Full charge takes about an hour
  • OLED display covers the rest with a single button: date, steps, miles, calories, etc.
  • OLED and gentle vibration also alert you to incoming calls (displays caller) and text messages (displays from whom) and calendar events (displays event title), allowing you to decide whether you need to fish your phone out of your pocket.
  • Note: my eyes and I are over 50 so I was concerned about the size of the text on the small OLED display, but it turned out to be OK.

The watch comes in two sizes, I prefer the smaller (36mm) variant; it includes a black silicone band that is very comfortable and secure, but I am used to a stainless band; fortunately, this watch takes any standard 18mm band so I bought a nice looking replacement on eBay for $10 and it fit perfectly.

It’s not yet officially available in the US, but it will be soon, you can read more about it here.

I still don’t understand why we don’t see old-fashioned LCD or modern eInk smart watches that show the time continuously and run for years on a coin cell, but for whatever reason, we don’t and for now, this is the best solution I’ve found.  Other features I’d like to see in the future:

  • blood pressure monitoring
  • display text of messages (not just who they are from)
  • saphire crystal and/or better protection for the crystal like a standard dive watch

10/24/2017 – A new contender is the Amazfit BiP or the snazzier Amazfit Pace. The BiP has very long battery life (45 days) and the Pace has much less (~5 days) but looks better, both are waterproof, have fitness monitor, GPS, smarter watch features, low price, and always on display. The only down-sides I can see are appearance/size: both are large and considerably less attractive than the Steel HR (the Pace looks better, but the battery life is too short). You can see a video review of the BiP here. When they make one that looks like the Pace but has the battery life of the BiP, I’ll buy one.

3D-Printer: Cube 3

I finally caved and bought a 3D printer: the Cube 3 from 3D Systems and so far I’m pretty happy with it.  See the manual here. The hardware is high quality, it’s easy to use, has dual-extruder jets, and looks pretty sharp.  In some ways it is like an Apple product: a beautiful, but closed eco-system: the main down-sides are that it uses proprietary software and requires proprietary filament cartridges which cost more andsee update below are limited to  PLA and ABS (the most popular material choices); other “cons” are that it isn’t fully enclosed and it doesn’t have a heated base which diminishes its performance with ABS and seems odd for a printer at the $1K price point.

I decided to get this for two reasons:

  1. I have an enclosure I need to prototype and I’m a beginner at 3D printing.  I’d read about folks spending a lot of time getting their printers working in the first place and then keeping them working including constant parts replacements.  The Cube 3 reviews indicate it is good for beginners and I want to focus on learning 3D mechanical design and printing instead of fighting with the tools.
  2. The Cube 3 has been discontinued and is available at fire-sale prices, sometimes under $200 shipped on eBay including two cartridges.  That’s an amazing price for a well-made printer and unheard of for one with dual-extruders.  At that price, it’s a no-brainer: if I start doing enough 3D printing for the cost of filament to become an issue, I’ll buy another printer and have gotten my money’s worth.

I’ve printed many objects in PLA which have come out nicely.  PLA seems to be the go-to material for 3D printing; it is very strong but brittle, has good dimensional stability while printing (doesn’t shrink much as it cools), and has no smell when you print.  I’ve also printed a couple of objects in ABS and they came out nicely although there was some mild warping at the base (because the platform is not heated). I printed a thin sheet of ABS too and it is remarkably flexible.  There is a slight smell of melting plastic with ABS, but in my basement (big space) it was barely noticeable and certainly not a problem.

Overall, I’m very happy with the purchase and am enjoying 3D printing.

Update: After having used the printer for a while, I still think it is a marvelous piece of engineering, but there are some serious problems with the cartridges.  I don’t mind paying more for the proprietary cartridges – I understand the 3D Systems business model, but  after my 8th cartridge failed, I was no longer sympathetic.  Since 3DSystems has discontinued these printers and abandoned the low-end/hobby market, they should really open the architecture so existing customers can make better use of them.  Fortunately, I have found ways to overcome these issues and will share them below:

  • Adjust the printer ‘z’ gap (the distance between the platform and the print nozzle) periodically.  You do this from the front panel using a provided feeler strip; it doesn’t take long.   You should adjust the gap until the feeler just barely slides beneath both nozzles with some friction between the platform and the lower nozzle.  Having the gap a smidge too wide is better than too tight.  If you are experiencing failure of filament to flow/jammed nozzles, the Z-gap being too small is almost certainly the problem.
  • Don’t be afraid to repair or refill the cartridges.  See how to do it here.  The top cover snaps off; it takes a lot of force, but the cover doesn’t break; 3D Systems advises this in their Advanced Cartridge Reset Guide.  Inside is a spool of filament with a clever latch to keep it from un-spooling when not mounted in the printer and a simple but effective feed mechanism.  Filament passes between two gears that grip the sides and push it forward or backward.  You can manually advance/withdraw the filament if it is broken using a Robertson (square) or Torx T20 screwdriver inserted into the feed mechanism drive (where the printer drives it).  Note that you can only do this when the filament is broken (which happens sometimes); otherwise, keep in mind that the end of the filament is melted into the tip of the nozzle and if you try to withdraw it the filament will break and problems will ensue.
  • Don’t be afraid to repair the nozzle.  The nozzle is a two-piece snap-together assembly that can easily be opened by inserting a screwdriver in the crack near where the nozzle assembly starts and the feed tube stops and prying forward (away from the feed tube).  You can repair a nozzle clogged with PLA by raising the temperature of the nozzle until the PLA softens and the nozzle tip slides off the tube; see here.  Be careful not to pull too hard or you’ll break the plastic feed tube.  If you have one, a hot air workstation (or perhaps a hairdryer) is a great way to heat the nozzle; if not, you can let it heat up in boiling water.  If you do any work with modern electronics, you should have one of these.  I set the hot air to 130-140C and heat the metal nozzle until it slides off the PTFE tube; I hold the nozzle with tweezers or needle nose pliers while it heats applying *very* gentle pressure; it should slide off the tube easily.
  • There are firmware hacks that allow you to use non-proprietary filament; this works, but you use it at your own risk: see Cube Toolbox.  A video showing how to use it is here if needed.
  • I find the cartridges sufficiently unreliable that I no longer use them as intended; I remove the filament spool and put it on an external spool holder.  I leave the cartridge cover off and feed the filament into the bottom of the extruder assembly and I hot-glue the portion of the PTFE sheath that fits into the cartridge edge so that it stays in place even with the cartridge open.
  • Finally, filament absorbs water from the air and becomes brittle and problematic.    This is not a problem specific to this printer, it affects all FDM printers.  Once opened, filament needs to be stored in a sealed airtight container, preferably with some desiccant.  To fix old filament, that has already absorbed moisture, I put the filament in a food dehydrator overnight at around 130F.  When filament is not being used, I store it in a ziplock bag with a few desiccant packets which I then put in an airtight container such as an ammo box (available at Sams and Costco).  For storing more filament, I use a bucket with screw-on cover and silica gel kitty litter for desiccant.

I haven’t yet tried it, but someone has made an enhanced feed mechanism for supporting other filament types; see here.  There is an even simpler method that I intend to try here. that uses

If you want to refill a cartridge, there is a filament winder apparatus here with video showing its use here.

Some Cube 3 resources:

Orange Pi

I bought two Orange Pi single board linux computers: an OPi One and an OPi PC. Getting up and running took me a lot of time, but once you know how, it’s easy peasy. The main issue with the OPi is lack of documentation, particularly from the manufacturer whose website is often down or slow as molasses.  There are some other sources of information including orange314

I’ll describe what you need in this post so you can have a smooth out-of-box experience. Documentation for these boards is lacking, but there is an extremely active user community and most of the negative reviews and comments you’ll see about the OPi no longer apply. You will need the following:

  • Good 5v/2A power supply with 4mm x 1.7mm DC barrel jack (same as used on Sony PSP)
  • 8GB or larger Class 10 or better microSD card
  • Ethernet cable and connection
  • Recommended: HDMI cable and monitor
  • Recommended: USB keyboard and mouse
  • Optional: USB-to-TTL-Serial adapter

I’ll describe these in more detail below:

POWER SUPPLY: The Orange Pi requires a 5V/2A good quality power supply. The power input is a 4mm x 1.7mm DC barrel jack (same as Sony PSP and many other devices). You cannot power it through a microUSB cable like a Raspberry Pi; you have to power it through the 4.0mm x 1.7mm DC power jack. I made the mistake of buying a really cheap after-market power supply meant for the Sony PSP and had lots of trouble because the power supply was too noisy; others have had similar problems. Get a good power supply like this one from LoveRPi or a microUSB to barrel jack adapter if you want to use a good existing micro-USB 5v/2A supply.

MICRO-SD CARD: There are a zillion Linux (and Android and other OS) distributions for the Orange Pi, but many of them are hard to install or missing important capabilities. I spent a lot of time sorting through them and ultimately installed ARMbian Linux (Debian Jessie Server) using Rufus onto a Samsung EVO 16GB Class 10 micro-SD card. I plugged in the uSD card, Ethernet, HDMI monitor, USB keyboard, and power, and my Pi was up and running (fast)! There was lots of space left over on the 16GB card; even an 8GB card would leave plenty, but try to avoid slow cards (e.g. don’t use Class 6). ARMbian is a great distribution that is pre-configured for the OPi PC; everything worked out of the box; my network connection came right up using DHCP and I could ssh into the OPi.

USER INTERFACE: The intended user interface is an HDMI monitor and a USB keyboard (and mouse if you are installing the desktop/GUI version). If you are technically inclined, the other thing that’s very useful is a USB-to-TTL-serial cable so you can access the serial console. 115200bps, 8, N, 1, Pin 1 on the 3-pin header is ground. Accessing the serial console lets you see what’s happening very early in the boot process; when booting is complete, you can login there as well. A tiny USB serial console is a lot smaller to carry in your laptop bag than a monitor and keyboard.

OTHER USEFUL TOOLS: You may also find SDFormatter useful for erasing/reformatting SD cards.

COOLING: ARMbian runs the CPU pretty cool; it rarely got more than slightly warm to the touch. However as I was experimenting with different linux distributions, some would get the SoC very hot very quickly. Self-adhesive heat sinks are very inexpensive and probably worth adding, at least one on the H3 SoC.

CONNECTING TO PROJECTS: If you plan to connect your OrangePi to some custom electronics, WiringPi has been ported to the OrangePi and I was able to have it blinking LEDs within a couple of minutes. If you need them, instructions are here and for more info see here.  If you follow the steps I mentioned above, you should be up and running quickly. Good luck and have fun!

JavaCV (OpenCV for Java) on Raspberry Pi

The Raspberry Pi has a powerful processor and GPU making it one of the few low cost embedded platforms suitable for machine vision and video processing.  The OpenCV computer vision library is popular for C++ development.

Update 11/25/2017:
Benji found JavaCV too limited in that it used OpenCV 3.0.0 and old/poorly documented ‘C’ APIs where the newer documentation is all focused on C++. He built OpenCV with the Java bindings from source on an RPi3 using the latest Raspbian; you can read about it here

JavaCV uses JavaCPP to automatically construct JNI wrappers around the CPP OpenCV classes.  The port was done by Samuel Audet and you can read about it here.  Good sources of documentation are the OpenCV documentation and the JavaCV wiki.

The Raspbian repositories don’t have up-to-date versions of either OpenCV or JavaCV so you’ll need to install them yourself:

  1. The easy way:
  • Download the 4 pre-compiled binary .jar files here  (source page: here) or from this site: javacv-1.0.jar javacpp-1.0.jar opencv-3.0.0-1.0.jar opencv-3.0.0-1.0-linux-arm.jar
  • To test:
    • put them in a folder such as “./opencv”
    • create this test program:

      import static org.bytedeco.javacpp.opencv_core.*;
      import static org.bytedeco.javacpp.opencv_imgproc.*;
      import static org.bytedeco.javacpp.opencv_imgcodecs.*;

      public class Smoother {
      public static void smooth(String filename) {
      IplImage image = cvLoadImage(filename);
      if (image != null) {
      cvSmooth(image, image);
      cvSaveImage(filename, image);
      cvReleaseImage(image);
      }
      }

      public static void main(String[] args) {
      if (args.length > 0) {
      smooth(args[0]);
      }
      }
      }

    • Compile (note: the binary .jar files were build w/Java 7 so you must target java 7 for your bytecode too):

      javac -source 1.7 -target 1.7 -classpath “./opencv/*” ./Smoother.java

    • Execute on a sample image file; the output will overwrite the file with a smoothed version of the image:

      java -cp opencv/*:. Smoother Rough_piddock_BW.jpg

2. The hard way…build it all from source while wrestling with gobs of dependency issues:

  • OpenCV 3.1 install instructions are here and here.
  • You will need to install many dependencies including maven, ant,  and doxygen.  You can read about the dependencies for JavaCV and JavaCpp by following install instructions here or here

 

NOOBS on Raspberry Pi

Notes on setting up NOOBS (Debian Linux) on a Raspberry Pi

  1. Download NOOBS linux (offline version) from here and copy all of the files in the .zip to the root of an SD card
  2. Boot the SD card with a monitor and keyboard attached to the Pi
  3. Use the Pi GUI to configure the WiFi network (if desired)
  4. Configure the Pi to use a default IP on the Ethernet interface that’s on the same subnet as the PC auto-IP subnet (169.254.x.y) – I used 169.254.82.80 (‘R’.’P’); this will let you boot the Pi headless, connect it to the Ethernet port of your PC, and ssh into it with no other hardware.  To do this, modify the file /boot/cmdline.txt and add “ip=169.254.82.80” to the end of the single long line.  See details here.
  5. Login (default user is ‘pi’ and default password is ‘raspberry’)
  6. sudo apt-get update
  7. sudo apt-get upgrade

Bare Metal STM32

Periodically I have to bring up a new device and my current favorite processor line is the STM32 Cortex ARM processors from STMicroelectronics.  When bringing up new hardware, JTAG debugging (or similar) is immensely useful and ST provides tools to make that easy including:

    • ST-Link V2 hardware debug interface – you can buy an official ST-Link V2 for $23 from Digikey or elsewhere or purchase a nicer clone on eBay for $3.25.  ST evaluation boards such as for the STM32L476 Discovery or STM32F4 Nucleo (with mBed support too!) cost $10-20 and include an ST-Link on board that you can disconnect from the evaluation processor and connect to your target via the SWD connector and by removing the two ST-LINK jumpers.  You’ll need to connect the SWD connector to Vcc, Gnd, SWCLK, SWDIO, and NRST on the target.
    • Use the GCC ARM Embedded development tools to build your software.  Build an .elf with debug information and a .hex file for programming.
      • For Ubuntu platforms see here for installation via package manager.
    • Use the ST-Link utility to flash your .hex file to the target using the ST-Link V2
    • Use Texane STLink to make your target debuggable via the ST-Link V2 and GDB (see this post for details on linux setup for texane)
    • Debug, by running the texane STLink utility and you should see something like this:

STLINK GDB Server v0.5.6 (Mar 24 2013 10:29:19)
Many thanks to the STLINK development team.
(https://github.com/texane/stlink)

2016-02-29T16:18:14 INFO src/stlink-common.c: Loading device parameters….
2016-02-29T16:18:14 WARN src/stlink-common.c: unknown chip id! 0x10036415
Chip ID is 00000415, Core ID is  2ba01477.
KARL – should read back as 0x03, not 60 02 00 00
Listening at *:4242…

 

  • Launch gdb for your executable, connect to the target, and start debugging:

arm-none-eabi-gdb myProgram.elf
(gdb) target remote localhost:4242
(gdb) break main
(gdb) continue

 

  • GDB has a huge set of commands; see the manual here .  For example:
    • step  (or ‘s’)                (step through one source line – steps into functions)
    • stepi (or ‘si’)                (step through one assembly instruction)
    • next (or ‘n’)                  (step over a function)
    • break *0x8004060       (set breakpoint at address)
    • break main                  (set breakpoint at function)
    • info breakpoints          (or info b)
    • del 3                            (delete breakpoint # 3)
    • info registers
    • info reg $r3
    • p <variable_name>   (print value of variable)
    • p/x  $r3                       (print value in register r3 in hex)
    • list                               (list source code)
    • disassemble              (disassemble around current PC)
    • display $pc                 (show value in program counter with each step)
    • display/i $pc               (disassemble code at program counter with each step)
    • display/20i $pc           (disassemble 20 lines starting at pc with each step)
    • x/20i *0x08004060      (disassemble 20 lines starting at address 0x8004060)
    • x/20xw $sp                 (dump 20 longwords from stack)
  • Note that a watchdog interrupt will appear as a SIGTRAP

ZTW 7×7 CNC machine

After reading a bunch of positive reviews, I purchased a Zen Toolworks 7×7 CNC machine on eBay.  It came with three SST43D2121 stepper motors, a 3-axis Univelop TB6560v2 motor controller , and a spindle (high speed 36v milling motor).  There is a remarkable absence of documentation for this stuff on the internet…hopefully this blog post will help.

I purchased a a MeanWell model S-100F-12 12v power supply ($20 on eBay) that supplies 12V/8.5A and connected it to the +7, +12v, GND inputs on the motor controller; numerous posts indicated that the 7v input can take 12v and so far I’ve had no problems with that.

ztw7x7

The wiring to the stepper motors is just as described on ZTW’s website:

2015-07-17 19.51.04

Stepper motor wiring

The motor controller has two sets of DIP switches for each motor: one has 2 switches and the other has 4 switches.  On the 2x switches I set 1,2=ON.  On the 4x switches I set 1=ON and 2,3,4=OFF.

DIP Switches

DIP Switches

This configures the motors for minimum (20%) current and smoothest movement (1/16 microsteps, 0% decay).  This was determined by trial and error.  Using the lowest load setting was important because the software I’m using (LinuxCNC) turns the motors on when powered; they are either held locked in place or driven (moving) but never turned off; so they are constantly drawing power…with 20% current, they stay cool and the 12v supply is never drawing more than 9.x Watts for all 3 motors and the controller.  Using the 1/16 microsteps made a huge difference in smoothness of movement; otherwise moving the motors was very noisy.

The motor controller connects to the computer using a straight-through DB-25 cable.  The pins are used as follows:

2 = Out = Step X
3 = Out = Dir X
4 = Out = Step Y
5 = Out = Dir Y
6 = Out = Step Z
7 = Out = Dir Z
8 = Out = Enable Y
9 = Out = Enable Z
14 = Out = Enable X
10 = In = Emergency Stop (low***)
11 = In = Limit X (low***)
12 = In = Limit Y (low***)
13 = In = Limit Z (low***)
1,15,16,17 = N/A = Not Utilized
18-25 = GND
***Signals are Active Low

Note that the Enable line must be active (high) for a motor to turn.  When properly configured, the software will enable the motor when the machine is powered and disable the motor when the emergency stop button is pressed (in software or hardware) which powers-down the motors.

I’m using LinuxCNC for the control software; it’s free and I like linux.  You can read about it here.  The software is extremely configurable which makes figuring the setup out problematic.  The software comes with two configuration wizards; one is for stepper-motor-based machines.  I used this and created a configuration file named ztw7x7, but the wizard doesn’t allow you to configure the Enable pins properly.  In the end, I had to edit the .hal file by hand to add definitions for Xenable, Yenable, and Zenable.  This link was very helpful.  I’ll post the edited file shortly.

There are many good choices for controlling NEMA17 stepper motors (1.2A/phase) including Arduino (Uno or Mega2560) with GRBL software (optimized for Mega2560 here) with a CNC shield using the Allegro A4988 or  TI DRV8255 drivers (1-2A w/fan) or TB6600 stepper motor drivers (3.5A).  See install info here.  Note that the drivers must be adjusted for max current and many suggest adding over-voltage protection for them including a 100uF cap across the motor. I would consider a suitably sized TVS diode instead because most 100uF caps aren’t rated for the ripple current they would experience.

Replacement spindles are available with 775 motors and the same ER11 spindle.

DIY PCB single-sided success

I am finally having success making single-sided PCBs at home using the toner transfer process.  I am generally using traces no thinner than 12 mils (although I think I did 10 mils a few times and it worked fine) and 12-15 mil spacing. With modern surface-mount parts, it’s amazing how much of the circuit can be done in a single layer and without drilling.

I’m using products from PulsarFx that are specifically made for this process and they work much better.  I came tantalizingly close many times using McGyver methods (magazine paper, clothes iron, etc.), but it never worked quite right and cost many hours of frustration.  In particular, getting the paper to release from the toner was always a problem and I often experienced over-etching.  I tried magazine, matte, and many varieties of glossy paper from Staples.  In the end, the PulsarFx products are not that expensive and work perfectly.

I have no relationship with PulsarFx other than that I am a customer and am now a fan.

The current process:

  • Print on PulsarFx toner transfer paper using an HP 1025nw printer.  Printing did not work well with my Canon D420 printer (did not put enough toner down) and I couldn’t feed the thick transfer paper through my Samsung ML-1865W or ML-2160.  The transfer paper is coated with a material that dissolves quickly in water, so after the toner is transferred to the copper board, the paper releases perfectly every time.  Configure your printer for thick glossy paper, black or grayscale, and maximum toner output.
  • Clean a blank copper board to a bright shine using steel wool.  I get the blank copper-clad boards on eBay from seller abcfab; ideally you should use 1/2oz copper for much faster etching, but I’ve also had success etching 1oz and 2oz copper.  After cleaning with steel wool, I’ve tried using tarn-x and/or acetone and they may help slightly but I’ve had good results without them.  Once the board is bright and shiny everywhere, don’t touch it with your bare hands…use gloves to avoid getting skin oil on it.  I use nitrile disposable gloves throughout this process; they cost $8 for 100 at Harbor Freight Tools.
  • Place the printed pattern face down (toner touching the shiny copper) on the copper board and run it several times (like 10) through a laminator.  I am using the PulsarFx “Applicator” which is just a big laminator.  I also have a much cheaper Harbor Freight Tools laminator which I am going to try and report on.  The board gets hot after a few passes through the laminator so I use leather work gloves.
  • After lamination, soak the board with the transfer paper stuck to it in water, I use a plastic tupperware container.  After a minute or two (sometimes within seconds), the paper’s coating dissolves and the paper just floats away from the copper board leaving the toner pattern on the copper.  Throw away the paper and pat the board dry with a paper towel. The water and container gets used again later in this process so keep it handy.
  • Follow the directions on the package and cut a sheet of PulsarFx Green Toner Reactive Foil a little larger than the copper board (2″ longer).  Place the foil dull-side down on the board and wrap 2″ under the board.  Place the side with the board with the 2″ wrapped under it in the laminator and try to keep apply some drag to the foil with your fingers as it goes through the laminator to prevent the foil from wrinkling.  I don’t have this quite right yet, but it still works pretty well.  I put it through the laminator a second time to make sure it has stuck.  Then peel the foil back from the board at a 180-degree angle.  What’s left is green foil covering most if not all of the toner.  The foil creates a stronger barrier to the etchant; without it, the etchant sometimes eats through the toner in places before the etching is finished resulting in pitting or uneven edges.  With the foil, I get perfect etching and nice clean edges, even with 2oz copper on the boards.
  • In another plastic (e.g. tupperware) container, mix the etching solution using nitrile gloves and chemical protective glasses, and preferably wearing old clothes: pour 1 cup of hydogen peroxide (purchased at my local supermarket) into the tupperware then mix in 1 cup of muriatic acid (hydrochloric acid) which I get in 1 gallon containers from Lowes which costs around $5/gallon.  I use a disposable styrofoam coffee cup as a measuring cup.  Because this is a sadly litigious world: these are harsh chemicals; don’t get them on your skin, on your clothes, or in your eyes; it is acid, it’s dangerous.  Use proper protective gear, if you don’t know how to handle chemicals, don’t do this.  Proceed at your own risk.  I do this in the back yard because the fumes (and liquid) can be corrosive to nearby metals.  I am going to try this again with the white vinegar/peroxide/salt etching method and report back.
  • Place the copper board in the etching solution with the pattern facing up; every minute or two gently brush the surface of the board with a foam paint brush (around $0.79 from Lowes).  Brush it a few times to brush away the etched material and expose more shiny copper; this makes the etching process go much faster.
  • When the copper is all gone and only the toner/transfer foil is showing, remove the board from the etchant and place it in the other tupperware container containing just water to stop the etching.  Note: the etchant solution doesn’t seem to effect the nitrile gloves so I just take it out by hand.
  • Carefully (gloves, chemical glasses) pour the etchant into a plastic container for storage and/or disposal.  I use a plastic funnel and a plastic bottle that seals liquid tight (e.g. an iced tea or juice bottle).  Take your time doing this so nothing splashes out.  Seal the bottle, then rinse clean your brush, tupperware, circuit board, etc.  You can’t just pour the used etchant down the drain (it is toxic and will probably ruin your pipes).  Take it to your local recycling/waste disposal facility for proper disposal (I’m looking into ways to manage this better).
  • The final step (for me, for now) is to remove the toner and foil from the board.  This is done using a rag or paper towel and acetone (which also costs around $5/gallon at Lowes).  Do this outside too, acetone is very smelly.

When you are done, you will have a nice shiny PCB ready to solder (or drill if you are still using through-hole parts).  Total time is under 30 minutes.

  • For drilling, I use an old Dremel model 380 rotary tool and an old Dremel model 210 drill press (purchased on eBay for ~$20 shipped – they are commonly available there – note, this press only fits tool models 245, 250, 260, 270, 280, 350, 370, and 380). I’ve read that the 210 press is much more precise than the newer ones but I can’t confirm that.  I can confirm that this combination drills precise holes in the PCB.  I get carbide drill bits that fit the rotary tool from Harbor Freight Tools.  You can also get them from All Electronics or Ebay.

My next steps are to experiment with soldermask, silkscreen, photo-transfer, and multiple layers.  I’m also going to look into more environmentally friendly etchants or good ways to make the left over etchant non-toxic.