I was in need of a logic level shifter so I could easily interface to an in-circuit low voltage EEPROM with my Beagle Bone Black board via a breadboard for some debugging and poking around. While there are a few existing solutions out there, not all of them were in stock due to the recent chip shortages and supply chain issues, and others I did not like. So rather than keep waiting for availability on one of the electronics websites, I’ve decided to dust off my EE degree after nearly a decade, and build my own breakout board.
Why make my own?
During my university years making a custom PCB was much more of a hassle than these days. My options were either rather expensive custom manufacturing, trying to get a slot in my university’s lab (typically reserved for school projects), or doing it myself via different methods of printing and using chemicals at home.
Later when working in the embedded industry I was typically working on or close to hardware, but I never got to design a product end to end. While I did a lot of board bring ups, as well as made suggestions that went into later revisions of said boards, the companies I’ve worked for always had a dedicated hardware design team and my main focus was on the firmware side.
These days however, the electronics space has improved a lot, and not only there is a wide selection of affordable and quality manufacturers, but they also accept design files from open source software like KiCad, which also has become much better over the years. This is not only more convenient, but also there is no need to keep special chemicals at home and instead I get to utilize a likely efficient and more environmentally friendly industrial process. I little excuse not to make my own board if I can.
Additionally instead of being unhappy with the existing solutions, this was also a chance to try to improve on the existing designs and make an, even if marginally, better board than the rest out there.
Obviously this project is not overly complex or challenging, however I saw this as an opportunity to try out recent tools and services and take my first step in getting back into building and tinkering with electronics via this simple and cheap board.
Requirements
The main purpose of this break-out is to enable communication between boards over serial buses like SPI, JTAG, or RS-232 running on different voltages. It could be also used for in circuit debugging, bus sniffing, or reverse engineering purposes. Because of this it has to:
- do bidirectional signal conversion
- sense direction automatically
- have at least 4 signal lines
- allow to control output enable (OE)
- support all popular logic levels (LVCMOS, CMOS, TTL)
- provide at least 100Mbps data rate to support faster boards and peripherals
Additionally it would be nice if the footprint was minimal to save on limited breadboard space.
A review of available solutions
There are several sites targeting electronics hobbyists and enthusiasts, which offer breakout boards for different ICs. The following are available at this time:
- SparkFun Logic Level Converter - Bi-Directional: does bidirectional conversion for four signal lines based on the BSS138 transistor, however it has no output enable (OE) line to gate signals. Cannot convert 1.2V lines. Cost: $3.5
- SparkFun Level Translator Breakout - PCA9306: does bidirectional conversion, has output enable pin, however it only can convert two signal lines. Cost: $4.95
- SparkFun Voltage-Level Translator Breakout - TXB0104: does bidirectional conversion, has four signal lines, however output enable (OE) is permanently enabled. It’s also missing a pull down for OE, which can cause signal interference. Cost: $4.95
- Adafruit TXB0104 Bi-Directional Level Shifter Practically reference design, however lacks a proper ground plane which reduces noise rejection. Capacitors are also not as close to the power pins as they could be. It’s the smallest board of all while maintaining good legends. Cost: $3.5
- CJMCU-401 TXB0104 4-Bit Bidirectional Voltage Level Translator with Auto Direction Sensing does not follow design best practices (e.g. there should not be a GND layer on top), no OE available, no schematic, potentially some clone IC, good legend though, ships from China (i.e. too much time). Cost: $4.00
Design
Considerations
The current situation and the requirements left me with few ICs to pick from. I also wanted to keep costs down, so I can keep my board “competitive” with the pre-made ones. Because of this I’ve decided to go with a TXB0104D chip with SOIC-14 packaging.
Since the limiting factor for reducing the board size was the main IC and the breadboard pin rows, to make placing and soldering a bit easier, I went with 0805 SMD parts for the resistor and the capacitors.
The user controlled OE pin is configured to disable the level translation by default and has to be explicitly enabled via en external signal. This also prevents transient signals on the bus lines during power up.
Schematic
The schematic is nothing to write home about, it’s essentially just the main IC and some required passive components based on the datasheet recommendations.
PCB layout
I went with a two layer PCB, with a ground plane on the bottom, signal layer and parts on the top. I’ve placed the buffer capacitors as close as possible to the power pins, following the layout guidelines in the datasheet. The same goes for the OE pull down resistor.
I made the signal traces as short as possible (between 70mil and 100mil) and their length is symmetrical for the same signal line on both A and B sides.
When doing the silkscreen, I’ve placed part labels on the front, something not available on the other boards. The pin rows are deliberately designed to be soldered on the top side, which means that when inserting the breakout into the breadboard the IC will face down. In exchange this allows on the bottom side for a more spacious labeling of the IC type and pin out. I consider the latter point to be an important design decision as it improves the circuits legibility making building and debugging easier (i.e. the hardware version of better user experience).
Build
PCB manufacturing
These days there are many manufacturing houses that are willing to produce small quantities of prototype boards for a low price at the cost of some lead time. I’ve decided to go with OSH Park for this build, mainly because they are local, thus eliminating the need to ship my board halfway across the world (i.e. less pollution). I also really like their purple color of their solder mask.
The boards were produced and shipped approximately 10 days after my order and it took another few days to arrive.
The quality of the boards seems to be really good, only with a few some small issues. Obviously this board is hardly a challenge for OSH Park’s manufacturing process, so I should not be making any far reaching conclusions based on this build alone regarding their capabilities and overall quality.
The most obvious issue is the CNC router tabs, used for the panelization process, were not shaved off the board. Though given for the price point I don’t think it’s reasonable to expect the additional manual labour required to remove these.
The other problem is the solder mask sometimes covers the vias. This could be problematic for larger complex designs where vias can be used as ad-hoc test measure points. The lesson here is to include dedicated test pads rather than relying on vias for measurements.
Populating the board
This is the first time I’ve used solder paste and a heat gun to reflow solder the SMD parts, rather than just using a soldering iron for everything. The result looks okay, but I feel it could have been better. Initially I set the heat gun temperature a bit low and the airflow too high, which made life harder than necessary. Having a hot plate for preheating the PCB would have been also helpful. A lesson that will for sure pay dividends in my next project.
Testing
As a quick test I’ve used my signal generator to produce a 3.3V 100kHz PWM signal that I’ve fed into the B side, while measured the output with an oscilloscope on the A side, which was running at 2.5V. The board itself was powered from my dual power supply. It has functioned as intended on the first try, producing the same frequency PWM signal at a lower voltage on the other side.
Summary
The costs came down as following:
Parts | Cost |
---|---|
PCB | $0.82 |
TXB0104DR | $1.19 |
R1 10kOhm | $0.073 |
C1 0.1uF | $0.506 |
C2 0.1uF | $0.506 |
J1 + J2 header pins | $0.5 |
Which brings the total cost to $3.595 not counting the soldering material I’ve already had at home. This total cost is pretty much on par with the commercially available solutions, even cheaper than some. While my solution does not have the benefit of economies of scale or automation, it also does not consider my labour costs.
This makes me conclude that if available and the design meets my criteria it’s often better to buy readily available boards, since I can save my labour and time, unless I can significantly reduce the costs. The only times worth doing a custom board are if there is a supply shortage, the available ones don’t meet my specifications, I need some specific customization, or a particular design does not exist. Since the cost for self made is pretty much the same as commercial, the optimization factor should be my time and the project at hand.
Nonetheless I’m happy with the end result and this gives me the confidence to go forward with my more interesting and complex project ideas.