Saturday, May 18, 2024

DIY Custom Breakout Board for ESP8266 or ESP32

Do you often find yourself creating the same basic starting circuit on a breadboard for your ESP8266 or ESP32 project or component bench testing?  Instead, create a simple breakout board that can be used as a starting point for projects that use a Wemos D1 Mini (ESP8266) or an ESP32 Mini.

There are many different types of retail breakout boards that can be purchased.  Most of these simply breakout the ESP's pins to screw terminals and/or female Dupont connectors.  A few may provide some additional power points, but nearly all are designed only accept a single type of ESP or MCU board... mainly those that are the NodeMCU-style.  This means that you must keep various breakout boards on hand if you use both the ESP8266 and ESP32 in your projects.

What's more, if most of your projects add a standard component or two, like a level shifter, you still have to manually wire that in each time you build a test/breadboard version of you project.  So I set out to build my own custom DIY breakout board that provides a standard base that will meet around 95% of my project builds.

This is also an excellent project to hone your skills if you are somewhat new to soldering.  It is a low-cost, low-risk way to practice soldering techniques.  Plus, the end result is a convenient, usable breakout board.  Naturally, this is designed around my common projects, but you could easily modify it to meet your particular needs.

This article is primarily designed as supporting materials for the video.  It is highly recommended that you watch the YouTube video first, which will contain additional information (and some soldering tips), then return to this article as a guide when ready to build your own:


Parts Used


These are the parts I used, including some items also shown in the related video.  Naturally you can substitute as needed for your particular design.

ITEM

NOTES

Breakout Board

 

ElectroCookie Snappable PCB

 

Straight Pin Headers

 

90° Pin Headers

 

Socket Headers

 

Screw Terminal

 

PCB Standoffs

 

20 Gauge Solid Core Wire

 

24 Gauge Bare Copper Wire

Optional – you can strip standard 20-24 wire

 

 

 

 

Other Components

 

Wemos D1 Mini (ESP8266)

 

ESP32 Mini

 

Bi-Directional Level Shifter

 

 

 

 

 

Tools and Misc Parts

 

Solder

 

Flux Pen

 

Breadboards

 

Soldering Iron

This model has been discontinued.

Helping Hands

 

 

 

 

 

 Some of these links may be Amazon affiliate links.  Use of these links will not affect your pricing, but as an affiliate this blog may earn a small commission if you make a purchase.

Naturally, you will need other miscellaneous tools, like wire cutters, strippers, needle-nosed pliers (for bending solid core wire), etc.

Wiring Diagram


Here is the wiring diagram for my design.  I'll cover a few notes and a bit of the assembly process below, but please refer to the video for more of a step-by-step guide.

Click to enlarge

Note that this diagram only shows the wiring connections, not necessarily the path of the wiring runs.  I mounted my board on short M2 standoffs, which allows wiring to be run on the top or bottom of the board.

The board is socketed to work with a Wemos D1 Mini (ESP8266) via the white highlighted areas.  It will also work with an ESP32 mini, using the same pins with an optional third row of pins, highlighted by the area in pink.  

For the D1 Mini, all 16 pins are broken out.  For the ESP32, 24 of the 40 pins are broken out, which contains 15 of the possible 18 GPIO pins.

I added a logic level shifter to my design since I do so many LED projects, but it is configured so that you can use the GPIO pins "unshifted" at the original 3.3V or "shifted" up to 5V.  Two additional 'not connected' pins are provides so that you can shift an additional two signals by jumping other GPIO pins through the shifter.

Again, see the related YouTube video for more info on the various pins and breakouts.

Assembly


The video also provides the step-by-step process I used for assembling the board, along with a few soldering tips, but I'll cover the general steps here.

Attach pin headers


I generally use a standard breadboard to hold the header pins in place and keep them vertical when soldering.  In some cases, like this one, the pins may not align with a standard breadboard, so you may have to solder in multiple steps or use more than one breadboard to support your pin alignment.


Remember that since you are soldering from the bottom of the board, the diagram will be 'flipped'.  I find it can be helpful to take a photo, like the one above of the pin layout, and use photo software to flip the image vertically.  This will give you the equivalent of the pin layout from the underside of the board.  This, along with the wiring diagram can help assure you are soldering the pins in the proper location.


For the right-angled pin headers, I simply use some sort of spacer (in this case one of the socket headers) to keep the pins straight.  I tape this in place, flip the board and solder the pins in place.

Attach Socket Headers and Other Components


I've found that the best way to attach socket headers is to first put the headers onto the MCU, an ESP32 mini in this case, with the three rows of pin headers attached that correspond to the three headers, and then place into the proper location on the breakout board and tape in place.


I can then flip the board over and solder the headers in place.  Using this technique assures that the socket headers will be aligned with the pins on the ESP board.  Once the sockets are soldered, the ESP32 can be removed and the new sockets should be able to also accommodate a Wemos D1 Mini.


Obviously, the D1 Mini only uses 2 of the 3 socket headers, but it will only fit in one position, assuring you have the the proper pins in the proper socket location.


I then used the same process of using masking tape to solder the level shifter and screw terminal in place, using the wiring diagram to assure I had proper pin position.  This only leaves the wiring connections.

Power and Ground Connections

I opted to mount my breakout board on small M2 brass standoffs.


This will keep the breakout board raised off the surface and allows me to run wiring connections on both the top and bottom side of the board, much like a standard two layer PCB.

The wire routing is somewhat arbitrary here.  I simply based it on the best wire routing and the ability to get my soldering iron into a position to solder without melting something like the plastic on the pin or socket headers.


I opted to make my 5V and 3.3V connections to the ESP board on the top.  No real reason for this, other than overall spacing and ease-of-soldering.  Do note that both the ESP32 mini and D1 Mini have the 5V, 3.3V and ground connections in the same pin locations, so this is what allows the two boards to be interchangeable.  I located the rest of the power wiring on the bottom of the board.

Click to enlarge

I really just followed the wiring diagram, but I'll add a few notes.  First, the two power rails (5V and 3.3V) are joined together with short wire to bridge the trace gaps.  The 5V rail connections to the positive pin of the screw terminal. For the ground breakout pins along one edge, I used a short piece of bare copper wire to bridge all the ground connections back to the ground pin on the screw terminal.

I opted to create a short solder bridge to connect the 3.3V wire to the 3.3V pin for the ESP.  I really just did this for a bit easier wiring/soldering, but you could certainly make that connection between the socket header and breakout pins.


At this point, I socketed an ESP board (a D1 mini in this case) and did continuity checks on all the 5V, 3.3V and ground connections, including at the ESP pins, the shifter pins and any breakout pins.

At this point, the board could be powered by either an external 5V supply via the screw terminals or by the ESP onboard USB connection, but never both at the same time!  Regardless of whether using an external supply or USB, both power rails and any breakout pins will have 5V or 3.3V accordingly.

Another important power note:  This board is not designed for high current applications.  The power pins on the ESP boards are only designed to handle a couple hundred milliamps.  And even if using the screw terminals and the breakout 5V pins, the small trace size on the ElectroCookie board means you should probably keep the total amp draw to around 1A or less.  Do not attempt to connect anything more than a few LEDs (<10 or so) directly to the 5V and ground pins on this board.  If you want to use this board as a test controller for a larger LED install, the power to the LEDs should be run in parallel to this prototype board.  For more information, see one of my other videos/articles on LEDs, including my Standard Wiring Diagrams article with diagrams for LED controllers, including a section on proper parallel wiring.

All that is left to do now, is make the wiring connections for the GPIO breakout pins.

GPIO Breakout Connections

Only six wiring connections will be needed for the GPIO pins.


For both the ESP32 and ESP8266 D1 Mini, the top pins highlighted in yellow, are broken out directly to the 90° pin headers.  These are connected by traces on the board so no wiring is necessary.

Similarly, the third row of pins for the ESP32, again highlighted in yellow, are broken out directly to the straight pin headers along the bottom.  It is the GPIO pins highlighted in blue for both the ESP32 and D1 Mini that will need to be broken out to other pins on the board.  The other two pins in this row are the 5V and GND pins and those were connected in the power connections above.

The pins x'ed out in red for the ESP32 don't exists for the D1 mini and are not broken out.  Many of these pins aren't standard GPIO pins and would not normally be used anyway.  On the ESP32 mini, only three GPIO pins are not connected, meaning 15 of the available 18 GPIO pins are available via the pin headers.


I opted to run the two GPIO pins for the low side of the level shifter (GPIO 1 and 16 for the ESP32 and GPIO 1 and 2 for the D1 Mini) on the top of the board.  This pins can be used directly at their original 3.3V by connecting to the blue breakout pins or to the shifted 5V data signal by using the green pins.  The yellow breakout pins are connected through the shifter but not directly to any GPIO pins.  This means they could be jumped from any other GPIO pins on the low side and give you a total of 4 different shifted data channels if needed.


The final four GPIO pins were just connected directly to the four breakout pins located near the ground pins on the bottom of the board.

This completes the assembly.   Now it's time to try it out with a few sample projects.

Testing the Board


Not only did I want to test the board and wiring connections, I wanted to see how easy it would be to change from one type of controller to another.

WLED Controller

I opted to first test the board as a simple WLED controller.


I simply connected a 5V power source to the screw terminals and dropped in an ESP32 Mini flashed with WLED.  Then I only needed to connect a single data line wire to one of the shifted GPIO pins and I had a fully functioning WLED controller.


Then if I wanted to test adding a push button, I could easily connect it to one of the GPIO pins and any available ground connection, adding button control to the LEDs.  In a similar manner, I could add or swap out other peripherals.  And if I wanted to add something like a PIR sensor that also required power, I have breakout for both 5V and 3.3V available, along with multiple ground connections.

(If you want to see a video on all the different types of peripherals that can be used with a WLED controller... and how they are configured in WLED controller, you can watch this:  Level Up Your WLED Projects: A Guide to adding Components

But what if I now wanted a different type of controller?  How quick and easy would it be to convert this to a completely different build?

ESPHome Controller

To convert this to a test ESPHome controller, I removed the LED data line (and any other connected peripherals).  I then swapped out the ESP32 WLED controller for a D1 Mini flashed with ESPHome code.



I then simply connected the peripheral (an AHT20 temperature/humidity sensor in this case... using 3.3V, ground and two GPIO pins) and powered it on.


And I had a working ESPHome controller.  It literally took about 30 seconds to swap from a WLED controller to an ESPHome controller.  In the case of this ESPHome controller, I was attempting to help one of my YouTube subscribers troubleshoot an issue he was having with his ESPHome build, so this was strictly a temporary build for me and nothing I was going to keep.  I created this test controller in a matter of a couple of minutes and I didn't have to futz around with locating and placing any jumpers on a breadboard.



Pin Mapping


The breakout board really doesn't have a good way to mark the GPIO pins on the board itself (especially since they are different for the ESP32 vs. the D1 Mini), so I just printed out a pin mapping.

Click to enlarge / download

I scaled this to an appropriate size and printed it out.  I store it with the breakout board in a simple 3D printed enclosure.  That way, I always have a pinout reference when using the board.



Final Thoughts


I designed and built my breakout board to work with most of the types of projects I build.  Will it work for every future project?  


Of course not!  There will be occasional projects that still require some sort of breadboard build to test.  But for me, I estimate that my breakout board will probably cover around 95% of my needs.  And it is ideal for quickly testing out a new version of controller software, or maybe some Arduino code that is under development.  Or for creating a temporary build to assist someone with an issue they may be having.

Naturally, you could easily modify this design to work with the types of projects you normally do.  And you could also eventually turn this into a true PCB, using the design as the guide:


But honestly, since my design will meet most of my needs and PCB orders generally have a minimum order quantity of 5 or so, I really don't need a bunch of extras.  What's more, unless you are going to pay the PCB manufacturer for the parts and assembly (can get costly), you'd still have to solder all the components onto the PCB when your received it.  For me, I'll stick with my DIY version for now...maybe I'll create a PCB version down the road.

Let me know down in the comments if you have any questions of thoughts.  And thanks for reading!

Links and Additional Information



Supporting this blog and related YouTube channel


If you'd like to support future content on this blog and the related YouTube channel, or just say thanks for something that helped you out, you can say thanks by buying me a one-off cup of coffee at:


No comments:

Post a Comment

To help eliminate spam and to keep all conversations civil, submitted comments are moderated. Therefore your post may not show up immediately. Please be patient as most reviews are completed within a few hours.