Designing the Electronic Circuit for a Custom Foot Pedal for the Boss RC-202 Loop Station [Part 2 of 2]

Posted on Sunday April 26th, 2020

Read the previous entry for this topic: Researching commercially available options and gathering ideas

UPDATE: I never got around to building this project, instead I bought a Nektar Pacer MIDI Foot Controller which has pretty much all the functionality that I was planning for this build. You can read more about it here.

Note: this entry is still a work in progress..

As mentioned in the previous entries, the Bridge Controller will hold the brains and circuitry required to read from the footswitches and convert those signals into standard MIDI messages.

I'll break up the electronic circuit into different components and I'll go through the design requirements and solutions given to each one. The components are:

  • An Arduino Nano (ATmega328) microcontroller
  • 12 digital inputs to read the switch states
  • 5V power regulator to regulate from a 9V DC barrel jack (to use the same Boss PSA power adaptors) to 5V
  • MIDI IN opto-coupled circuit, to be used to soft merge and pass through messages to the MIDI OUT
  • MIDI OUT circuit
  • 2 5V mechanical relays to simulate a CTL1+CTL2 pedal output

Arduino Nano

The Arduino Nano uses the same microcontroller as the popular Arduino Uno, the ATmega328 chip, but comes in a much smaller package. There's not much to say about the Arduino that hasn't been already written on the internet.

I will be using the basic Arduino Nano 3.x version with headers, and I'll place some female headers in the PCB in order to be able to remove the Arduino if needed, or to replace it if something goes wrong. There are some newer versions that include Bluetooth BLE (Low Energy) such as the Nano 33 BLE or Nano 33 IoT which give me some ideas for a 2.0 version of this controller.

Here are some specs of the Nano from the official Arduino website that will be useful later on:

  • 22 digital I/O pins
  • Maximum current of 40mA per I/O pin, with a total maximum of 200mA through all of the pins.
  • Power consumption is about ~19mA

Digital Inputs from the Footswitches

Reading the status of a switch is one of the most basic functions for a microcontroller, but still, I'll first contextualize about the different type of switches and the things that should be considered in order to take reliable readings from the footswitches. The only thing that I'm skipping here is debouncing, since I will cover that on the software side.

Types of Switches

A switch is one of the simplest electrical elements and in its most simple version it's a cable that can be either disconnected (open: does not allow for current to flow through) or connected (closed: allows a current to pass).

There are many different types of switches with many different characteristics for every application, but I'll concentrate on two of them:

Action Mode determines the behaviour or state of the switch after it has been pressed. - Momentary action means that the switch makes contact (closes) only when it's pressed, and as soon as the force is removed the electrical contact opens. - Latching action means that the switch changes its state (from open to closed, and vice versa) each time it's pressed and maintains its current state until it's pressed again. In other words, if the switch is open and you press it, it closes and stays closed until you press it again. It toggles from one state to the other.

Polarity determines the default state of a momentary switch, and consequently its behavior when it's pressed. - In a normally open (NO) configuration, the switch is open when unpressed (default, normal or resting state), and it closes when it's pressed or activated. - In a normally closed (NC) configuration, the switch is closed when unpressed (default, normal or resting state), and it opens when it's pressed or activated.

Reading a Switch State

In my design I'm assuming that all of my footswitches will be (i) momentary action and (ii) with a normally open (NO) polarity. I believe this is by far the most common type of footswitch available in the market, and many of the more complex switches can be configured in either mode anyway.

Reading the state of a switch is a simple as reading the voltage from one node of the circuit and watching what happens when the circuit closes as the switch is pressed. However, there's a catch. A switch can be open or closed, but only when the switch is closed a circuit is formed and current is allowed to flow, and a voltage can only be measured on a closed circuit. That means that something must be done to account for the open state of the switch to be able to reliable measure it.

To solve this, I will be using a configuration known as pull-down resistor. What this does, is that it guarantees that whenever the switch is open the microcontroller will read 0V (LOW). In other words, when the switch is open the circuit pulls down the voltage. However, when the switch is closed the microcontroller will read +5V (HIGH). This prevents any undetermined or floating measurement.

Pull-Down resistor configuration

  • When the switch is open, the pin is connected to GND through a 1kΩ resistor, since there is no current flowing from the pin, there is no voltage difference in the resistor and the voltage on the pin is 0V.
  • When the switch is closed, a small current flows through the 1kΩ resistor to GND and closes the circuit. This also directly connects the pin to the +5V rail, thus getting a measurement of 5V in the pin.

All in all, this configuration translates to:

  • when the Switch is not pressed (open), we will read a LOW signal, interpreted as 0 in the microcontroller.
  • when the switch is pressed (closed), we will read a HIGH signal, interpreted as 1 in the microcontroller.

Handling different types of switches and plugs

For the actual footswitches, they will be connected to the Bridge Controller using a TRS 1/4" plug. A single TRS cable can connect 2 footswitches since it carries 3 wires: one for each switch and the third as a common connector.

Following the Boss/Roland custom, they map a TRS (Tip Ring Sleeve) 1/4" plug as: - Tip: mapped to the B switch - Ring: mapped to the A switch - Sleeve: common (return for both A & B)

The word "Jack" is used for the female socket, while "Plug" is used for the male connector

While this is a neat solution to wire two switches over a standard cable, it also presents an interesting problem when plugging a TS cable (Tip Sleeve) since there's no Ring in the plug. This means that the electrical connector that we'd expect for the A switch is merged into the Sleeve, so the device will always read the A switch as closed.

Since I want to be able to plug single footswitches (for example basic sustain pedals) as well as dual footswitches using the same TRS jacks, this means I have to apply some extra logic. The type of connector (TRS or TS) could be detected upon power-up if we assume that the switches are always NO. The logic for the detection would be:

Assuming that there are two pin inputs (D0 and D1) in the microcontroller, and they're mapped as:
- Pin D0 -> Tip
- Pin D1 -> Ring

Then:
- If D1 (Ring) is HIGH: set D0 as Input A, disable D1 and disappear the Input B
- If D1 (Ring) is LOW: set D0 as Input B, set D1 as Input A

This will require that whenever I turn on the bridge, I make sure that: - all of the pedals are already connected - I'm not pressing any button on any pedal - all of the pedals have a NO polarity, since it would not be able to differentiate a NC switch from a TS cable.

MIDI

The MIDI standard was released in 1983, about 35 years ago, and it's stood the test of time since it's still widely used.

It has a couple of design

it uses a 5-pin DIN connector, but it only uses 3 of those pins.

A newer standard has __ in the last few years, which uses a standard 3.5mm TRS minijack (headphones), since it only requires 3 cables. The wiring of the 3 pins in the TRS (Tip Ring Sleeve) _ has two variants, which have been called Type A and Type B.

The device will have both a 5-pin DIN connector and Type A (the newer one) __ __ don't depend on adaptors and for future compatibility.

MIDI communicates with a sends it signals by a __ current __ , 0mA (low) and 5mA (high). Instead of voltage.

And the devices that __ are not electrically connected. Instead, they are opto-isolated.

A device could be operating at 5V __ as long as the current is respected.

MIDI IN Circuit

asdfasdfasdf

Opto-isolated which means that the input signal __ is not electrically connected to any of the __ device's

The information is transmitted by light inside the optocoupler, which creates an insulation barrier, __

In order for this to work, the input signal coming from the external device has to provide the required power to light the LED inside the optocoupler, and this is were the required 5mA in the MIDI signal spec come into play.

MIDI OUT Circuit

The __ sends power...

the Tx pin actually sinks current.

+5V GND Tx

This is actually a pretty nifty and resilient design that __ both the operating spec, as well as protecting the device from any kind of

a standard 220Ω resistor is put in both the __

Let's assume the following scenarios where either the cable is faulty or the receiving device is faulty.

  • Shorting the +5V to GND, there's the Source 220Ω resistor, generating a ~23mA current. It __ in our 5V rail.
  • Shorting the Tx pin to GND while Tx is low, it doesn't matter, there's no voltage differential.
  • Shorting the Tx pin to GND while Tx is high, there's the Tx 220Ω resistor, generating a current of ~23mA. The ATmega328 max current is 40mA per pin, so we're safe.
  • Shorting the Tx pin to +5V while Tx is low, there's the Source 220Ω resistor as well as the Tx 220Ω resistor, generating a current of ~11mA. The ATmega328 max current is 40mA per pin, so we're safe.
  • Shorting the Tx pin to +5V while Tx is high, it doesn't matter, there's no voltage differential.

Those are all the possible __ operating malfunctions.

Now, under normal operation, the complete Tx circuit is:

+5V -> Source 220Ω resistor -> 220Ω resistor on the MIDI IN side -> 1.3V drop of the optocoupler LED -> Tx 220Ω resistor -> Tx pin sink

Total Current = (5V - 1.3V) / (3 x 220Ω) = 4.998mA

Just on spec!

Fault tolerance

MIDI IN to MIDI IN: there's no current at all

MIDI OUT to MIDI OUT: both circuits are grounded, ___ both should have a __

Even if there is a voltage differential between the 5V rails, and one of the Tx pins is LOW, the maximum current would be 5V / ((220Ω|220Ω) + 220Ω) = ~15mA

it doesn't affect our device since our ___ have at least 220Ω resistance between them.

Switching Relays

a small 5V

under load it ___ about 70mA. This is well over the maximum current of the Arduino's I/O pin, so we cannot handle it directly. For this, we'll need a small "buffer" stage.

The Arduino I/O pins will __ that will amplify the current to operate the relay's coil.

We need a small

Event

A simple NPN transistor operating as a buffer. I'll use the simplest design __ that still offers some security to the circuit, without worrying too much about .. this relay will never

We'll calculate for a maximum load of 100mA. Since the ___ has a base-to-collector ratio of about 1/10, we can ___ to source 10mA into the base to __ full saturation mode.

We'll only be using a base resistor, ~10kΩ ? 1k

1k in th ebase 10k in parallel between the base an the emitter

the relay has a coil inside, we need a "flywheel diode" in paralel to the coil to protect the circuit from surges when

a DPDT (double pole double throw) switch to change the "polarity" of the relay, by selecting between the Normally Open (NO) and the Normally Closed (NC) state.

Power Regulator

For simplicity, I will be using a LM7805 5V linear regulator. It's a very old and inefficient design, but that makes it very cheap and easily available. Since we are not running from a battery source.

I'm assuming a maximum load of ~300mA (~40mA for the Arduino, ~70mA for each relay, ~30mA for the MIDI circuits, ~90mA losses and other components such as LEDs, etc.)

Wattage dissipation: (9V - 5V) * 300mA = 1.2W

Under max load ~2W

Max operating temperature is around 125º C

it has a thermal resistance of 65C/W junction to air. This means that for every 1 Watt that is dissipated, the temperature raises 65º C over the room temperature.

Under our calculated maximum load the regulator would increase its temperature by 78º C over the room temperature (65C/W x 1.2W). Assuming a base temperature of 25º C, the final regulator temperature should be around 103º C when running a continuous load of 300mA.

Not great, but nothing to worry about. Nevertheless I'll be sticking a small heatsink to the regulator, but I'm not sure if it'll be of any help at all since it's all going to be inside a plastic enclosure.

The enclosure is not small, and there __

This __ will_ __ in a plastic enclosure of about

If temperature ever becomes an issue, I will need to change the enclosure to metal, and stick the backside of the regulator to the enclosure wall to dissipate heat into the box itself.

Programming

Since we'll be using the serial Tx/Rx ports in pins D0 and D1 of the Arduino to handle __ MIDI, it'll collide with __ when programming the ATmega328, since it uses those same serial connections.

There are two options to handle this issue: - Remove the Arduino Nano from the board, connect it via USB, flash it and put it back in the board. - Place a DPDT (double pole double throw) switch to disconnect the MIDI circuits from the Arduino's Tx/Rx, and then use this switch to change from "programming" mode and "run" mode, without having to physically remove the Arduino Nano.

The Final Design

Putting it all together, the final design is __

Refernces:

  • Nuts and Volts


Building a Custom Foot Pedal Controller for the Boss RC-202 Loop Station [Part 1 of 2]

Posted on Saturday April 25th, 2020

I recently bought a Boss RC-202 Loop Station, it's got two stereo tracks in a compact "desktop" form-factor, among many other nice features. The RC-202 is the smaller brother of the flagship RC-505 5-track looper from Boss, and shares many of the flagship features available in the RC-505.

I'm upgrading from a Boss RC-30, which has mostly the same looper capabilities (2 stereo tracks, same recording time, same bitrate) in a floor/stompbox form-factor, with the exception of MIDI connectivity and some new effects available in the RC-202.

MIDI support was main reason for the upgrade, because it allows me to sync the looper to my ever-growing array of digital toys. My setup has been growing from a simple guitar-and-effects rig to a more integrated station centered around the Novation Circuit synth as the brain for the DAW-less setup.

The Requirements

The RC-202 is a desktop loop station, which means that it's designed to be operated with your fingers, allowing for a much finer control than a simple two-pedal stompbox. However, I still need to be able to control some basic functions of the looper through a foot controller, to be able to use it while playing the guitar or any other instrument that requires both of my hands.

Luckily, the RC-202 supports external controls, but it's (artificially) limited in those. It supports 7 "switches" that can be assigned to one of 35 predefined functions, for example "Function #1: Switches track 1 between record/play", "Function #6: Clears track 2", and so on. However, there's a catch since the 7 "switches" are not all equal:

  • 2 of them are for an external dual footswitch, such as the Boss FS-6, connected through a 1/4" TRS jack (CTL1+CTL2 input).
  • 5 of them are for special MIDI Control Change (CC) messages that can be received through the MIDI IN connector and are fixed to CC 80 thru CC 84.

This means that by using a MIDI Foot Controller by itself we can only use 5 switches and assign them to 5 functions. If we'd wanted to assign 7 different controls, we would need to plug in a 5-switch controller through MIDI IN and a 2-switch external pedal through the CTL1+CTL2 TRS input.

Note: there's an 8th external control that can be mapped for an Expression Pedal (ex. Boss EV-30) to control things such as track volume or effect levels. However, there's only one input to connect either (a) 2 switches CTL1+CTL2 or (b) an EXP pedal. This is why I'm not considering it as an option, since I prefer two "buttons" than 1 "knob". If I require any fine tuning of some parameter, I prefer to do it by hand directly on the RC-202.

The complete list of assignments and functions is available in the Boss RC-202 Parameter Guide (EN).

The Options

There are many commercially available products that could work with the RC-202 with some limitations, but I have not been able to find a solution that does exactly what I have in mind.

I need to find a MIDI Foot Controller that has at least 5 foot switches and that allows for those switches to be mapped to the special MIDI CC messages numbers 80-84. I also need to balance between finding a compact solution, but that will also allow for future growth (in case I ever decide to upgrade to the RC-505).

Here are some of the options that I've thought of, in no particular order:

A. Behringer FCB 1010

This is probably the most popular foot controller at the time. It's a monster MIDI foot controller with a metal chasis that has 12 foot switches, 2 expression pedals, and some other configurable features. The device itself is pretty simple and it's possible to replace the chip inside of it to use a custom firmware to expand the factory capabilities of the device, such as the EurekaPROM fimrware, the UnO firmware or the UnO FCB505 firmware specifically made for the RC-505 loop station.

This controller can easily be found new from ~$180 USD, which is not actually cheap, but much much cheaper than its competition, making it the most popular controller in the market for this use case.

  • Pros: easily available, excellent build quality, 12 switches, lots of information available, has MIDI Thru.
  • Cons: too big at ~70cm wide, requires a firmware upgrade to solve some issues.

Behringer FCB 1010 MIDI Foot Controller

B. Behringer FCB 1010 "Short Mod"

There are many published modifications with full instructions in the internet, and one of those is the "short mod" or "cutdown mod". By doing this mod, you physically cut the right-most part of the pedal and remove the 2 expression pedals, keeping only the 12 foot switches.

  • Pros: same as above, but in a smaller package at ~50cm wide.
  • Cons: you lose your warranty and the power regulator must be relocated outside of the controller.

Behringer FCB 1010 MIDI Foot Controller Short Mod

C. Korg EC-5

This is a much simpler, dumber and cheaper pedal than can be bought new for ~$90 USD. It's actually a plastic board of 5 foot switches directly wired to a 6-pin DIN output and it's specifically made for some Korg arranger keyboards, so the actual logic of the switches is built on the keyboard itself. This pedal could be used as the starting point for a custom project, in which I could hook-up an Arduino board to "read" from the mechanical foot switches and then generate and output a valid MIDI message signal through a custom adapter.

  • Pros: very cheap and small, with the right amount of switches.
  • Cons: made of plastic, requires an external custom adaptor

Korg EC-5 External Controller

D. Roland GFC-50 / Boss FC-50

A pedal from the 90's, built like a tank, which has the classic Boss footswitches that I'm used to. Since it's a very old product, I have not been able to find a single resource online and the manuals might be lost to history. The product archive website does not have any kind of manuals or documentation, so I'm not sure if it's even configurable, or what are its actual capabilities. However, from some pictures online it appears to have just the right amount of pedals, in a manageable size (the website lists it as ~42 cm wide).

  • Pros: Boss' exceptional build quality, good size, MIDI enabled
  • Cons: it's a very old model from the 1990s, only available second-hand, actual capabilities unknown.

Roland GFC-50 / Boss FC-50 MIDI Foot Controller

E. Roland FC-300

Roland's current flagship to control many of their MIDI-based effects processors and synthetizers. It's feature packed, highly configurable but at a price point of $500 USD it's definitely out of my budget. It costs way more than the actual looper.

  • Pros: very nice build quality, durable, highly configurable
  • Cons: too big, too expensive.

Roland FC-300 MIDI Foot Controller

F. Roland FC-200

The previous version of the current FC-300, it's highly configurable with more foot switches than the current FC-300, which I like. This controller has been discontinued, but many units are available second hand. However, even buying it used is a more expensive FCB1010, while having pretty much the same functionality.

  • Pros: nice build quality, good number of switches, MIDI enabled
  • Cons: discontinued, too big, and only available second-hand but still expensive

Roland FC-200 MIDI Foot Controller

The Custom Solution

Of the options above, I'd be more inclined to get a FCB 1010 and do the short mod, but it requires to purchase $180 USD of gear only to open it up and hacksaw it in half, and it would still not be exactly what I'm looking for.

What I've decided instead is to start a new project and build a custom controller. This way I can build it exactly as I want it, reuse some parts and gear that I already have, and learn in the process. I'm not sure if this will be cheaper than the modded FCB1010, but I'm certain it will be much more complicated and rewarding.

My main idea is to split the controller in two components:

  • Pedalboard: The mechanical/physical footswitches.
  • Bridge Contoller: A microcontroller reading any type of switch as inputs, and outputting standard MIDI messages or controlling a pair of relays.

Custom Pedalboard Design Blueprint

The Bridge Controller

All of the interesting bits of wiring, electronics and programming will be contained in the Bridge Controller (the name I'm giving to the main control unit), while keeping the pedals as simple and dumb as possible. The idea is to make this unit very flexible to be able to use it as a generic "mechanical-switch-to-MIDI" bridge. This way I will have complete control over the programming, presets, functionality, and anything else really.

For the inputs, I'm planning on having 6 TRS jacks, where each TRS cable can handle 2 switches. This will allow me to hook-up as many as 12 footswitches if needed.

For the outputs, it will have:

  • MIDI OUT, to send MIDI messages to compatible devices
  • MIDI IN, to perform a soft thru function and pass through messages to the MIDI OUT, this will allow to daisy chain this controller in a more complex arrangement.
  • 2 mechanical relays to simulate a footswitch when connecting to devices that do not support MIDI. These outputs could go into an amplifier channel switch jack or into a pedal's CTL1+CTL2 type of connectors.

To use this with the RC-202 I will be using 3 double footswitches using the first 3 TRS inputs, for a total of 6 buttons. Of those, 4 switches will communicate via MIDI CC messages through the MIDI Out connector, while the remaining 2 switches will be connected to the CTL1+CTL2 input and will be simulated with the 2 relays in the Bridge Controller.

The Foot Switches

I have a couple of Boss FS-7 dual footswitches that I really like but I'm not longer using since I simplified my setup. The Boss FS-7 packs two footswitches in a small package measuring approximately 6x12cm. Also, unlike the bigger Boss FS-6, the FS-7 does not require batteries when operating as a simple momentary switch.

The build quality of the FS-7 is excellent as expected from Boss, and they're easy to find on stores everywhere, with a price ranging from $50 to $70 USD. This is definitely not the cheapest option at $25 to $35 USD per footswitch, specially when compared to the FCB1010 which has 12 footswitches for $180 USD, at ~$15 USD per footswitch. Still, I already have 2 of them so I only need to buy one more FS-7.

The good thing about this design is that I can add more footswitches as needed, and any kind of switch will do; be it a footswitch, a simple sustain pedal, a Korg EC-5, etc. Also, I can easily disassemble the pedalboard in case I need to use my FS-7s in other place.

I've drawn a mockup based on my real measurements of the FS-7, and it fits 6 pedals in a 24cm wide x 15cm deep board, while still being very usable.

Custom Pedalboard Design Blueprint

Read the next part: Designing the Electronic Circuit


UPDATE: I never got around to building this project, instead I bought a Nektar Pacer MIDI Foot Controller which has pretty much all the functionality that I was planning for this build. You can read more about it here.