Arduino Based 8 Loops Pedal Switcher
Arduino Based 8 Loops Pedal Switcher
by CarraN
last update: february 17 2016 disillusion! But actually you can consider 2 (or more)
groups of loops, ie: one before the jack input of your
amp and the other on the fx loop, if your amp is
This is the second part of my previous tutorial about provided obviously! The only thing to do is to add a
how to do simple programable pedals switcher (or couple of chassis jack between two relays, the choice
looper) now with a MEGA2560 Arduino to achieve 8 is yours. This is called the "breaking technique".
storable loops on 8 presets. I recommend to take it a
view for the coding part explanation and how the We can also use pin D1(Tx) for Midi communication.
things are tight together.
So, in order to keep it as simple as wanted, see the
Note that is possible to improve the number of total schematic of this version of the project.
loops. Just keep in mind that it add more lines to the
code and more cost on hardware. That said, -----------------------------------------------------------------------
improving the possibilities in the mean time!
Caution: some noise issues where experienced by
Number of max loops = total number of digital pins - 5 some
/3 (minus 3 pins for selecting mode and the two builders (me included). I suspect those cheap and
Rx/Tx) chinese relays aren't made for audio signals. The
ideal relays should be some called DPDT but for
In this tutorial we have 51 digital pins - 3 = 48 / 3 so instance few advices can be followed: use shielded
16 loops available. Just think you can add more cables all along the signal path, ensure all the circuit
interesting options like increasing the number of in a metallic box use caps (usually 10u) for
presets, add a display or read pot values for decoupling and/or add some high resistances to all in
expression pedals by exemple, thus decreasing the and outs jacks. Adding a booster pedal in front of the
number of available loops. But frankly: "who needs 16 input may strongly reduce these noise...
pedals on a pedalboard?"
___________________________________________
Sure, they are... ___________
___________________________________________
___________
Tools:
-plyers/ cutter
___________________________________________
___________
USE:
Watch it on youtube
You can even add some pot reading for expression For this simple project, I suggest you to buy a cheap
pedals: there's enough room for it! Or even 8 more chinese copy of this board as you can find it for ~7$.
leds that can indicate wich effect loop is engaged You'll save your original board for arduino practicing.
when in "read" mode (in parallel to relays). Some
follower suggested me to implement the possibility to So, here is the code for this beast as an example
select in wich "pre" or "post preamp" mode each (choose your own pins):
effect can be selected (google for "4 cables"
technique). This is also possible but adding a 16 Many thanx to PascalP3 to have corrected and
relays module that will take more space and weight improved this sketch!
on the box. I suggest choosing "16 x DPDT relay
module" to limit space waste but I must admit that I
didn't found any cheap of these (~100$/piece) !
Download
https://www.instructables.com/ORIG/FKC/3JJ2/JDOV175X/FKC3JJ2JDOV175X.ino
…
Here's an example with 5 switches and 1 function selector and another 8 loops project by David B1 who gently
share pictures of his great job! Thanks to him.
-------------------------------------------------------------------------------------------------------
ZeK
2
4
1
1
3
1. this aluminium profile is smaller than the other. Both have the same 1. here come the 2 relays boards
length. 2. and here for the pushbutton / led
3. the hole for the future jack in from guitar
4. the send and return loops
5. the output to amp
Programmable 8 Loops Pedal Switcher With Arduino Mega2560: Page 5
5. the output to amp
6. the function selector will come here
2
1
5
4
Can I create infinite patches for the 8 pedal loops? How would I do that? Thanks!
hey!
Many thanks!
30 x 30 = 900 memory presets in a MEGA2560?
cheers
Something like:
void byteToRelayStates(byte b) {
for (byte i = 0; i < 8; i++) {
int bitValue = bitRead(b, 8-(i+1));
relay[i] = bitValue == 1;
}
}
Hey, why not to share the whole code ? Because is not clear how to implement these few lines into
the rest of the sketch. If you don't want it's ok, it's up to you!
cheers
Hey, I definitely will do so. But I want to do some clean up as the current version is a little bit
messy and needs some polish ;-)
I am a professional developer but new to Arduino and C and the IDE. I still want to raise the code
quality to my personal desired level.
Sure I understand ! So can you please explain (to us) this line code I don't got it:
relay[i] = bitValue == 1;
cheers
cheers
Finally I wrote the full code all by myself but used the basics for the wiring from this instruction.
Thank you very much for this inspiration
Nice !
do u have schematic or layout for the midi connection betwen arduino,relay,and midi socket, if
want to use the midi connection for program change, how can i edit the midi program,as we
know,there is midi section in the ino file..thank you so much i apreciated
please check the upgraded schem up there, I have added midi out connection on it. For more
information just watch the usefull Amanda's instructable here->
https://www.instructables.com/id/Send-and-Receive-...
cheers
Nice...Thank you so much...
you're welcome!
Hello! first thanks so much for sharing this! greetings from Brazil!
I have a newbie doubt. In the list of materials were listed 9 / 12v relays. but in the images I am
seeing the 5v connections.
I will buy DPDT relays! should i buy 5v or 12v?
thank you very much.
Hi!
yes you're right! These are 5v. relays. In fact it's not as important as this but the schematic sould
be a bit different wit 12v. relays...
So following this instructable step by step, there are 5v. relays. I'm going to change this.
cheers
Hello, thank you for this ecxellent project.
I encounter a problem: when I switch to A mode to select my loops no led lights up except that of
the last loaded bank. Why?
Greatings from France
salut!
en mode A (programmation des loops), c'est toi qui décide quel loop est engagé ou non. Par
défaut, il y a la dernière combinaison que tu peux garder ou changer comme tu veux.
merci, j'ai debuger j'avais simplement une soudure défectueuse. Mais j'ai un autre problème en
mode A, quand la loop 5 est sélectionnée, elle est contrairement aux autres impossible à
deseiectionner
I have noticed a few people in the comments talking about having to give up on this because they
could not solve the noise issue. I have mine working almost silent. Any noise you do hear is so low
compared to the volume of the instrument that unless you were sitting there repeatedly hitting a
switch without playing a note, you MIGHT hear it. I have also completely eliminated any
interference and buzz or hum that comes along with it. Without decoupling caps, resistors, shielded
cable or any of that stuff.
In my case the secret was simply connecting to an actual earth ground.
I have a 120v standard computer mains inlet in the back of my case, from there is a typical 12v
transformer I stole from a wall wart power adapter. Connect that to an lm7805 and 7809 ( 5 to
power relays, 9 to power the MEGA R3. While also keeping the MEGA behind its own 5v regulator
for added safety.
But yeah this thing was a noisy piece of crap just using wall warts and regulators, once I brought a
3 prong mains cord into the case and attached all the "ground" wires to an actual earth ground and
not just the negative pole on an AC/DC adapter, thing went dead silent and sounds brilliant. I am
also using low signal relays. I just went to my local electronics surplus and bought a bunch of 5v
relays that can handle a max of like 0.037A, made my own driver board for them and yep works
like a charm, I would have no problem using this live now and even with my sovtek bigmuff the
click is barely noticeable, you could have to know exactly what you are listening for to notice it. For
reference the relays I am using: are CP Clare LSR 2C05.
MFR:CP Clare
MFR No.LSR2C05
STOCK No.JCFD-1011
SKU No.204184
Hope this helps someone out.
Thanks to share Kyle!
I'm convinced about how better are the low signal relays and the quality of the power! Nice job with
a computer supply indeed!
cheers
carranen
I am confused with the additional voltage regulator that is needed between the arduino and the
relays. Where does that go on the board? or is it just floating around whilst being grounded to the
chasis which is metal?
Regards
Jim
fix it on the chassis, just take care that the other pins don't touch it (the chassis) or it will blow! The
central leg is the same as the radiating part of the regulator so you can leave it off or ground it, it's
yours. In the schematic it doesn' t appears but you can add one capacitor (100n/50v. typically)
between input and ground and another (~10uF/25v) between output and ground. Good luck!
Thanks for that. I am using 8 relays, on one single board. Do I need 8 regulators?
one is enough.
https://www.amazon.co.uk/WINGONEER-L7805-LM7805-three-
regulator/dp/B071VS43R5/ref=sr_1_1?ie=UTF8&qid=1518465787&sr=8-
1&keywords=LM7805+regulator+%285v.%29&dpID=41OeDfGaP-
L&preST=_SY300_QL70_&dpSrc=srch
will this project be capable of switching amp channels as well as different loops? I'm trying to find
something that will for instance...go from dirty channel on amp, to clean with lets say a chorus and
delay with one click, then with another button switch to dirty channel with delay.
hey
cheers
Hi Pascal!
yes, I let it down for the same reason, though the noise appears only with distortion pedal, and I
guess those chinese relays are not so friendly with audio. If I remember, putting a booster signal
pedal before the switcher threw out this noise issue for a large part but not entirely... It will be
interesting to see how many people achieved it without any sound issues. Some build are very
impressive!
cheers
Hi CarraN,
It's been a while since i checked in. The last i worked on,was trying to get rid of the clicks of the
relays in the audio line. Unfortunately i did not succeed and got quite discouraged. So the project
ended up on a shelf in the attic. I'm wondering if anybody experience similar problems and if they
managed to solve it...
I'm thinking about using audio relays which are much smaller too.
Also i've looking at the possibilities of using the CD4053 integrated circuit which should be
noiseless (at least without relay clicks...)
Looking forward to some usefull input.
best regards,Pascal
cheers
carran
Hi there! I've been working through this and have come up with a few things.
1) Banks! I figured out some math that allows banks for easy storage with only one extra
button/switch. I can share if you like.
2) I put together some code to allow for 2 buttons/switches and 2 relays to control read/program
loops/program preset instead of using a rotary switch. Again, happy to share...
HOWEVER - I'm trying to get this to use 16 loops, and that's not working. With 10 loops, where "i"
is always a single digit, it works great - but with 11 or more, where "i" is a double digit, it is running
the loop constantly because it is reading each digit separately (e.g. 1 and 1, 1 and 2, 1 and 3
instead of 11, 12, 13, etc. — this is my theory anyway).
Any insight on how this might be fixed?
Hi!
please can you send us a brief schematic because I don't understand what's not working on your
project. Is it the display or selector or what?
cheers
The issue isn't in the schematic... 10 or less loops, and your program works perfectly. From 11 or
more loops, the program stops working properly. I think it's in the number of loops vs. keypad rows.
Your instruction said this could go up to 21 loops (or 0 to 20), but as soon as you get more than 10
(or 0 to 9), the whole program hangs up. Some debugging is showing me that it's possible the
"char keys[rows][cols] = {" line is only using the first number in "byte rows" (in my case, 1 instead
of 16) because it's not set for a 2 digit number, and I'm not sure how to make that work.
Running a serial line in Void Setup to see what "i" produces shows there is no issue there with 2
digit numbers, so I think that the keypad itself isn't setup to handle more than 10 rows (as it is set
from 0 to 9).
This issue has the butterfly effect of having all these pins set for the keypad with nothing to use
them for - thus the writeOut and memory functions hang up, and the readPreset mode doesn't work
at all. It just keeps cycling through everything.
I may have a workaround for my specific issue, but it won't work for anyone with more than 10
loops. Does that make sense?
I don't think (but I'm not 100% sure though) the keypad library is limited to n caracters, except the
by the max of ascii caracters available in keyboards, of course! check the keypad library.
So you're telling me that when you select the loop 11 by exemple, relay 11 doesn't work! is that
right?
Hi Mike!
cheers
carran
Hi CarraN! Code is below (doesn't include the 2 relays for programming yet. I also removed the
midi stuff because it is not needed for what I'm doing, and I need every single pin I can get, hehe):
#include <LiquidCrystal.h>
#include <Wire.h>
#include <EEPROM.h>
#include <Keypad.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
const int bankButton = 53; //Pin for Bank Button
const byte rows = 16;
const byte cols = 3;
char keys[rows][cols] = {
{'a','q','7'},
{'b','r','8'},
{'c','s','9'},
{'d','t','0'},
{'e','u','~'},
{'f','v','!'},
{'g','w','@'},
{'h','x','#'},
{'i','y','$'},
{'j','z','%'},
{'k','1','^'},
{'l','2','&'},
{'m','3','*'},
{'n','4','('},
{'o','5',')'},
{'p','6','+'}
};
byte rowPins[rows] = {30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45};
byte colPins[cols] = {46,47,48};
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, rows, cols);
int relayPin[16] = {14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29};
int ledPin[16] = {A0,A1,2,3,4,5,6,7,A8,A9,A10,A11,A12,A13,A14,A15};
int i;
int readOut;
int numberOfPedal = 16;
Programmable 8 Loops Pedal Switcher With Arduino Mega2560: Page 13
int bankVariable = 20;
int numberOfBanks = 5;
int bank = 0; //Starting Bank Number
boolean lastBankButton = LOW;
boolean currentBankButton = LOW;
/* SETUP */
void setup() {
lcd.begin (16,2);
lcd.print("Line 1");
lcd.setCursor(0,1);
lcd.print("Line 2");
for(i=0; i<numberOfPedal; i++) {
pinMode(relayPin[i], OUTPUT);
pinMode(ledPin[i], OUTPUT);
digitalWrite(relayPin[i],LOW); //turn ON all relays
digitalWrite(ledPin[i],LOW); //turn ON all preset LEDs
};
delay(500);
for(i=0; i<numberOfPedal; i++) {
pinMode(relayPin[i], OUTPUT);
pinMode(ledPin[i], OUTPUT);
digitalWrite(relayPin[i],HIGH); //turn OFF all relays
digitalWrite(ledPin[i],HIGH); //turn OFF all preset LEDs
};
pinMode(bankButton, INPUT);
Serial.begin(9600);
delay(1000);
lcd.clear();
lcd.print("Press any preset");
lcd.setCursor(0,1);
lcd.print("to start");
delay(1000);
}
/* Bank Button Debounce */
boolean bankdebounce(boolean last) {
boolean current = digitalRead(bankButton);
if (last != current) {
delay(5);
current = digitalRead(bankButton);
I'm a complete newbie on the arduino world, and I'm also a guitar player :)
I'd like to control 10 loops with thin project. Can you give me a hand with the code, please?
Also,
is it possible to add some kind of control over the text that is
displayed? Maybe costumize the name of the preset, change the midi PC
message...
all you need is in this instructable. The display stuff is a follower's addon of the initial project that
I've included in the code but without any waranty from my part. So if you have a specific question
you can still post here, maybe someone can will help you!
I suggest reading first some comments related to.
cheers
carran
Can this looper be use as footswitch? I mean changing loops AND amp channels?
yes it can! Just wire off those amp channel relays! Similar to the "breaking technique" explained on
cheers
I've checked YouTube videos and there is a big delay between button press and changing loop. It's
unavoidable?
Hi!
no problem of any latency on my side! You'll do not have neither!
Youtube isn't lip synching accurate, maybe you 've experienced this...