When ordering PCBs online, you often get 5 or more of the identical PCB and don’t always need all of them. The low cost of having these custom made-to-order PCBs is very enticing and we often don’t worry about what to do with the extra ones. In a past project I have tried to re-use them as best as I could and this time, I decided to plan ahead. In another Instructable I needed a PCB to hold a couple of Espressif based microcontroller development boards and I thought this would be the ideal case for re-usable PCBs. However, not everything goes as planned.
Step 1: Design
That project needed a PCB to house an ESP32 development board and a Lolin type ESP8266 dev board. These two boards have quite a few useful IO pins that were not going to be used in that project at all. The extra boards could be quite useful later on if more of those unused pins were accessible. I also wanted to accommodate two variants of the ESP32 dev boards. I had the 38-pin and the 30-pin version. Comparing the pinouts of the two, one can see that if pin ‘1’ of the 30-pin variant is plugged into the position of pin 2 of the 38-pin version, then most of the pins on the left side would match. I decided I could fix that by careful use of some jumpers.
On the right side of the board, they did not match very well. The I2C pins (IO22 and IO21), were fine as was UART0 (TX0 and RX0), however the SPI pins and UART2 were all shifted. I thought I could fix this with jumpers as well. So that plan was to be able to use both types of ESP32 boards and also fill the PCB with as many IO pin headers as I thought I might use some day. I also wanted the possibility of using the two (ESP32 and ESP8266) boards separately, so the layout would have to allow for cutting the PCB.
Step 2: The PCB Layout
I started with the initial (basic) design that I needed for that project and then decided to upgrade it to accommodate as many uses as I could reasonably fit on the board. You can see in the second schematic that it is quite a bit more crowed.
The PCB could be no larger than 100mmx100mm (smaller would be better), so this added a bit of a space constraint. I had the initial layout in Fritzing and decided to continue with it, but I did not bother much with the breadboard view as you can see it is nearly unintelligible.
I set up multiple I2C port connectors for both the ESP32 and the ESP8266 boards, I setup each one to have their own power connecter and brought out some of the digital IO pins for both. I placed extra mounting holes to allow them to be cut and mounted separately. I decided I would not bother with IO00, IO02 or IO15 at all and I ended up with the layout depicted.
For use with the 38-pin ESP32 board, the following jumpers needed to be shorted: JG1, JG2 and JG4
For use with 30-pin ESP32 boards, these jumpers needed shorting: JG3, JG5, JP1, JP2, JMISO, JCS, JCLK, JPT and JPR.
Step 3: The PCBs
I ordered the PCBs from PCBWay, but there are other manufacturers who have similar economical and fast services. They looked great … until I looked more closely. The width of the ESP32 and ESP8266 board footprints was not right. The footprint width (between pins) was 22.9mm instead of 25.4mm for the ESP32 board and 27.9mm for the ESP8266 board. The DC power jack hole layout also did not match my power jacks (and the holes were too small). This was not the PCB manufacturer's fault, it was all mine. I should have double checked all of these of course and now I had to find a work around. I also did a test cut to see what more problems would surface and of course it ruined the SPI jumper configuration (which incidentally wasn’t going to work as planned).
I found that if I bent the female header pins at 90 degrees, I could solder them to the surface of the PCB allowing for some width adjustment. After carefully soldering on the corner pins and checking the width, I solder them all in place and tested out the fit. It worked!
The power jack required a similar workaround, but the rest of the headers all fit fine. I populated one uncut PCB and tested it with my Webserver setup and it ran fine. I then moved on to the cut PCBs. The Lolin ESP8266 board worked fine, but the spacing to the mounting holes was a bit close.
The 30-pin ESP32 board also worked fine, however the SPI port was not working and the only fix to that was jumper wires on the bottom side of the board.
Step 4: Final Notes
Overall I think it was worth the effort to make the boards more re-usable. and I have already begun to use one of the cut PCBs for testing a future project. I much prefer it over using breadboards. I will not likely use Fritzing anymore, since it is not user friendly for making footprints/symbols compared to other packages (e.g. KiCad). It does make very easy to read breadboard views though as long as they are not too complex.
Lessons learned are:
- Always verify footprints from other sources to ensure they match the part you are holding in your hands.
- Use EDA software that allows symbols and footprints to be (reasonably) easily modified.
- Expect the unexpected and make the best of it!
An additional note is to always ensure pin-outs are the same when fetching third party symbols for your schematic. I didn't have any problems with this, but in the past I have had an issue where a common voltage regulator had different pin-outs between manufacturers.