MattG's Relay Switching

sammo303

Member
Build Rating
5.00 star(s)
Hi all,

This is a thread summarising my experience building MattG's v5.1 relay switching system, and some information I thought might help others.

For those who are not aware, MattG has done a huge amount of great work designing a relay switching system which is all open source and hosted here:


I stumbled across this by chance and it saved me so much pain.

There's a few versions of his pcb layout, I selected v5.1 as it was the smallest however it involves extensive use of SMD components so consider an earlier through hole version if that puts you off.

I used an ATtiny13A microcontroller and Panasonic TQ2-L2-3V relay. All other components are as follows:

R1-R5 - 1k (0805 Package)
CLR1 - 10k (0805 Package)
C2 & C5 - 100nF (0805 package)
C3 - 10nF (0603 Package)
C4 - 4.7uf (1206 Package)
C6 - 10uF (1206 Package)
D1-D3 - BAT54J (SOD-323 Package)
Q1-Q3 - 2N7002 (SOT-23 Package)
U3 - MCP1799T (SOT-23 Package)

What I particularly liked about this SMD version is that there is an empty space on the back (not interrupted by through hole components) just big enough to place some strong double sided tape allowing the board to be fixed directly to the switch. A couple of short wires from the switch terminals to the switch through holes coming from underneath make for a neat arrangement.

I opted to wire everything else up using JST-XH connectors which have 2.5mm spacing that suits the pcb and allows for a few tests to be made before installation. For example, an LED and DC jack mounted on XH connectors allow function testing on the bench and once made can sit in the toolbox for next time. A similar test connector allows a pedal pcb to be checked without wiring in a switch, giving you some options for QC during the build.

During the build I only found two things that could be improved, at least from my perspective. I offer these in good faith and completely accept that these are both preferential and will not impact functionality at all, which is a testament to MattG's work.

1. The solder pads for the diodes are really very small. I had some difficulty soldering these components and suspect that larger pads would make it easier. This might be a skill issue.
2. Given the use of very small components to keep size down, I'd have preferred to use the JST-PH connectors which have 2.0mm spacing, simple tweak to the pcb I'd imagine. Little detail but seems a more natural fit.

I hope this helps someone out there. If you have any questions, let me know and I'll try to help.
 

Attachments

  • 20250401_100645.jpg
    20250401_100645.jpg
    554.9 KB · Views: 23
  • 20250401_223719.jpg
    20250401_223719.jpg
    1 MB · Views: 23
Last edited:
(I would have replied sooner, but I've been traveling with only my phone and spotty internet service.)

This is so cool, you are the first person to "discover" this via GitHub, rather than through these forums. And if you haven't seen this, here's a forum thread where I first discussed this design: Custom microcontroller-based relay bypass - update - v2.0 board.

When I first started working on that relay bypass design, it was at the start of what could charitably be described as an obsession with bypass (which, to many, is probably the most mundane part of a pedal!).

To my knowledge, I'd like to think this particular microcontroller-based design has a couple features that make it stand out from other designs:
  • When not actively responding to a switch press, the microcontroller goes into a the deepest possible sleep state; I'd have to review the microcontroller data sheets, but IIRC, power consumption in the deep sleep states is below 1mA, making this suitable for battery use.
  • When I got into this project, microcontroller availability was spotty (might have been post-COVID supply chain issues). When I researched existing designs, there were those written for the ATtiny series XOR the PIC series of microcontrollers. For this project, I created a simple abstraction layer which allows the same logic to be used with either family of microcontroller.

What I particularly liked about this SMD version is that there is an empty space on the back (not interrupted by through hole components) just big enough to place some strong double sided tape allowing the board to be fixed directly to the switch. A couple of short wires from the switch terminals to the switch through holes coming from underneath make for a neat arrangement.

That wasn't an explicit design intent, but sort of a happy accident. However, I do the exact same thing. I use double-sided foam tape, which is thick enough that it even works well on through-hole PCBs that aren't nice and smooth on the back. I have to credit @bean for the double-sided foam tape idea, as he suggests it in the documentation for his "Softie" series of relay bypass boards.

1. The solder pads for the diodes are really very small. I had some difficulty soldering these components and suspect that larger pads would make it easier. This might be a skill issue.

You're right, hand-soldering those diodes requires good genes and young eyes (or some kind of magnifying optics), and a steady hands! My usual thought process when I design boards with SMD components is: if it's only one or two SMD components on and otherwise mostly through-hole PCB, I'll use big(ger) pads to make hand-soldering easier. But if it's all surface-mount, then I assume the components won't be hand-soldered, but built with solder paste and some kind of reflow process. That said, in this particular case, I think I probably could have used bigger pads for those diodes without increasing the actual board size.

Except for the first few times I soldered SMD (and excepting random one-off SMD devices), I've since done a "poor man's reflow" method. In this, I first use a toothpick to "paint" all the solder pads on the PCB with solder paste. Then I use tweezers to place all the components on the PCB. And then the "reflow" step is to put the PCB on a hot skillet on my stovetop, and leave it there until I can see the solder paste turn molten. The surface tension of the molten solder paste will neatly align any components that weren't laid perfectly straight. As soon as all the solder joints look good, I remove the PCB from the heat and let it cool.

I've since slightly upgraded this process such that, while the skillet heats the PCB from the bottom, I also hit the components with heat from the top using an SMD rework pen.

I still don't particularly enjoy this process, though, as I always worry about too much heat reducing component life. (But on the other hand, I've been running the my hand-soldered SMD tpa3118 amp for nearly 10 years without issue, so maybe my worry is overstated?)

(Although, when I built up those v5.x boards to validate, I had an unexpected happy helper: my wife actually enjoyed helping me paint the solder paste on the PCBs, and in fact her work was noticeably neater than mine, even though it was her first time!)

2. Given the use of very small components to keep size down, I'd have preferred to use the JST-PH connectors which have 2.0mm spacing, simple tweak to the pcb I'd imagine. Little detail but seems a more natural fit.

That could indeed make the PCB a bit smaller, but the flipside is that it would be harder to hand-solder. For better or worse, the 2.54mm spacing seems to be the "standard" that guitar pedal PCB makers (e.g. PedalPCB) generally use for offboard wiring.

Looks like I never put the KiCad files on GitHub, but I'm happy to share them!

My hope with the microcontroller relay bypass project was that others would, in the classic open source spirit, take it and build on it. But that never really happened. :) Although it works great as-is, I felt that using a microcontroller for simple on-off operation was a bit overkill. I've since designed a bypass circuit that uses a CMOS NAND chip (cd40106 or 74hc14) to maintain state and respond to switch presses (i.e. take the place of the microcontroller). I didn't make a GitHub project or do an explicit build report for this design, but looks like my Muroidea (ProCo Rat) may have been the first build that used this design. I've since shrunk the PCB a bit, and also did an SMD version; the surface-mount version I had assembled by JLCPCB to save me the trouble!

Most recently, I've created a Buffered Electrical Bypass Module. This aims to be like Boss-style switching (though with ICs instead of discrete components): an always-on buffer, and electrical (rather than mechanical) circuit switching. I've made it in both a through-hole version and pre-assembled SMD version.

I have spare PCBs for all (or at least most) of my bypass PCBs, I'm happy to give them away free to whoever wants one. (Note the pre-assembled boards aren't cheap, so I can't afford to give those away; but I can send those out to folks willing to help cover costs.) As always, just PM me!
 
Back
Top