Programmable 8 Loops Pedal Switcher With Arduino Mega2560

33,606

52

162

last update: february 17 2016

This is the second part of my previous tutorial about how to do simple programable pedals switcher (or looper) now with a MEGA2560 Arduino to achieve 8 storable loops on 8 presets. I recommend to take it a view for the coding part explanation and how the things are tight together.

Note that is possible to improve the number of total 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!

Number of max loops = total number of digital pins - 5 /3 (minus 3 pins for selecting mode and the two Rx/Tx)

In this tutorial we have 51 digital pins - 3 = 48 / 3 so 16 loops available. Just think you can add more interesting options like increasing the number of presets, add a display or read pot values for expression pedals by exemple, thus decreasing the number of available loops. But frankly: "who needs 16 pedals on a pedalboard?"

Sure, they are...

AVOID using analog pins named A0 to A15, just use the digital ones! (2 to 53) See the MEGA2560 pinout

Note: this project DOESN'T allow to reverse order of the pedals. This involves to matrix all that! That means: number of relays = (quantity of pedals) X (quantity of pedals)!!! and a lot of nightmares and 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 provided obviously! The only thing to do is to add a couple of chassis jack between two relays, the choice is yours. This is called the "breaking technique".

We can also use pin D1(Tx) for Midi communication.

So, in order to keep it as simple as wanted, see the schematic of this version of the project.

-----------------------------------------------------------------------

Caution: some noise issues where experienced by some
builders (me included). I suspect those cheap and chinese relays aren't made for audio signals. The ideal relays should be some called DPDT but for instance few advices can be followed: use shielded cables all along the signal path, ensure all the circuit in a metallic box use caps (usually 10u) for decoupling and/or add some high resistances to all in and outs jacks. Adding a booster pedal in front of the input may strongly reduce these noise...

______________________________________________________

Hardware:
-1 chinese Arduino Mega 2560 (keep your original for test other projects)

-8 momentary switches

-1 LM7805 regulator (5v.)

-1 three ways selector

-8 double relay modules or

-1 sixteen relays module (9 / 12 volts) or 1 eight dpdt relay bord (it's a lot expensiver)

-18 chassis 6.3 female jack (minimum) / 20 if you want to add the "breaking technique"

-1 9V-12v /3A power supply

-16 leds and 470 ohms resistors

-1 MIDI din + 1 220 ohms resistor (for optional MIDI out)

-spare cable or chinese Dupont wire (male to female)

(not included: the box)

______________________________________________________

Tools:

-plyers/ cutter

-soldering station/ iron

______________________________________________________

USE:

-position "A" from the selector (cases a,b,c,d,e,f,g,h on the sketch) -> select wich pedal to loop ON (1,2... 8)

-position "B" (cases i,j,k,l,m,n,o,p) -> select the number of the preset (1 to 8) where you want to preserve the loops (the led of the preset you choose will lit 2 or 3 times)

-position "C" (cases q,r,s,t,u,v,w,x)-> read the preset (1 to 8) you stored previously

Watch it on youtube

______________________________________________________

needed Arduino library:

keypad.h

Step 1: Programmable MEGA2560 Arduino Based 8 Pedals Looper

You can even add some pot reading for expression pedals: there's enough room for it! Or even 8 more leds that can indicate wich effect loop is engaged when in "read" mode (in parallel to relays). Some follower suggested me to implement the possibility to select in wich "pre" or "post preamp" mode each effect can be selected (google for "4 cables" technique). This is also possible but adding a 16 relays module that will take more space and weight 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) !

For this simple project, I suggest you to buy a cheap chinese copy of this board as you can find it for ~7$. You'll save your original board for arduino practicing.

So, here is the code for this beast as an example (choose your own pins):

Many thanx to PascalP3 to have corrected and improved this sketch!

Step 2: Hardware Building

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.

-------------------------------------------------------------------------------------------------------

check out some outstanding bands I play with

ZeK

Cosmic Rain

6 People Made This Project!

Recommendations

  • Make it Glow Contest 2018

    Make it Glow Contest 2018
  • Optics Contest

    Optics Contest
  • Plastics Contest

    Plastics Contest

162 Discussions

0
None
rodrigueze

26 days ago

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
3 replies
0
None
CarraNrodrigueze

Reply 26 days ago

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.

0
None
rodriguezeCarraN

Reply 26 days ago

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

0
None
CarraNrodrigueze

Reply 26 days ago

je dirais: continue à débugger t'es dans la bonne voie!

0
None
KyleV36

5 months ago

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.

1 reply
0
None
CarraNKyleV36

Reply 5 months ago

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

0
None
JimT130

Question 9 months ago

hi,

I managed to cnnect the led's that lights up when the pedals are pressed, however, on the youtube video it shows someone programming the presets and there are more led's ... i noticed in the parts list you listed 16 led's. I am assuming some are related to the saving of presets. I am unsure where to connect these extra led's. Could you please help me. My screen now lights up but nothing written on it so I am having problems with that as well. Not sure why there is nothing showing. When I unplug everything and try just the screen with the arduino, i can get the "hello world". I assuming it is in the programming and compatibility with my screen.

Please help me.

1 more answer
0
None
JimT130JimT130

Answer 8 months ago

Hi all,

Just a quick update. After having no luck trying to get some answers with regards to the LCD issue I was having, I reverted to going to the official Arduino forum. There is a guy there called Bill (username Bperrybap) who was absolutely amazing and managed to help guide me in the right direction in order to solve this issue. I am posting a link here as to what was done to rectify the problem I was having.

https://forum.arduino.cc/index.php?topic=529808.0

In my struggles I have posted something below with regardsto changing the pin names for example changing EN to E in the programming. This is absolutely not necessary.

My main issue was with the fact that the LCD i bought was a 16 pin wired directly to the arduina, whilst the library for the I2C lcd was totally different.

In the beginning I had no clue that the lcd I bought was totally different to an lcd that has an I2c board attached. Something to watch out for. If ythe code you are trying to use, uses an I2C library please buy and I2C lcd to save yourself a lot of hassle. I am slowly getting to grips with all the programming but it takes time and that is the fun of it all.

Many thanks to CarraN here as well.

Regards

0
None
JimT130

Question 9 months ago

HI,
I am struggling with the connection of the Liquid crystal display. mine has these pins on there and I am not sure where/how to connect it in as there is no mention of the screen in the diagrams.

1 VSS VDD VO RS RW E D0 D1 D2 D3 D4 D5 D6 D7 A K 16

With regards to your code, which pins above connect with which pins on the mega board?

Regards

1 more answer
0
None
JimT130JimT130

Answer 9 months ago

I managed to work it out. The trick is in how they are labelled by e\ch manufacturer. Mine has E instead of EN so in the code this needs to read E and not EN.

Regards

0
None
JimT130

Tip 9 months ago

m I doing anything wrong or have I got a dead lcd to start with?

0
None
JimT130

Question 9 months ago on Step 1

I have been looking at the coding for this and one question that comes to mind is this:
How does the arduino mega know that pin A13 A14 A15 have a three way switch connected to it? I cannot see any reference in the coding that refers to A13 A14 or A15.

Just trying to understand how this works

5 more answers
0
None
JimT130JimT130

Answer 9 months ago

Hi CarraN,

Just to clarify, in the code it says this:

byte rowPins[rows] = {22, 23, 24,25, 26,27, 28, 29}; /*relay pins 1 to 8 */
byte colPins[cols] = {30, 31, 32}; /*selector pins a to h/ i to p/ q to x */
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, rows, cols);
int relayPin[8] = {33,34,35,36,37,38,39,40};
int ledPin[8] = {41,42,43,44,45,46,47,48};
byte midiChannel = 0;
int i;
int readOut;
int numberOfPedal = 8; /*adapt this number to your needs = number of loop pedals */

So in theory this line should read Footswitch es pins 1-8 .... It says relay and I am guessing it is just a typing error.

byte rowPins[rows] = {22, 23, 24,25, 26,27, 28, 29}; /*relay pins 1 to 8 */

0
None
JimT130JimT130

Answer 9 months ago

Hi CarraN,

Thanks for the info regarding the pins. The diagram threw me off and i thought the relays connected to the A0, A1 etc... I got that part now.

So for example, let us take the first push button. The push buttons I have only have two connections on there. When one side of the push button is connected to pin 22, where does the other lug on the push button connect to.

If you have the time maybe a diagram on the actual physical connection of switched and Jack connectors would be a great help.

I have sorted out the relay now. There was nothing wrong with it, however, it only works if I use the installed version of arduino 1.8.5 .... when I use the online editor nothing works. It compiles but appears not to push the code to the arduino board. Not sure why, but I am happy using 1.8.5.

You are a great help and please keep up the good work. From my questions and your answers, in tyhe last two days I have a much better understanding how this works. As I said a diagram of the physical wiring would be all that I am missing.

Regards

0
None
CarraNJimT130

Answer 9 months ago

OK I see you' re completly lost. Did you check all the pins that are on the code?
byte rowPins[rows] = {22, 23, 24,25, 26,27, 28, 29}; /*footswitches pins 1 to 8 */
byte colPins[cols] = {30, 31, 32}; /*selector pins a to h/ i to p/ q to x */
Remember it' s all yours if you want to change these, just adapt your code! If the footswitch 1 is connected to pin 22, your code MUST to tell 22!!! you get the idea?
The same for relays and all that is connected to your MEGA, it must to match to your code. And don't forget that ports A0 to A15 are analog inputs, so don't use them but instead the ports 2 to 52 that are DIGITAL ports!

0
None
JimT130JimT130

Answer 9 months ago

I am well and truly stuck. not sure if it is the switch I bought. It only has two lugs on it. connected at least two relays to the arduino. Everything powers up but activating the switch does not kick in the relay at all. Also I do not have the voltage regulator yet so I am trying to power everything from the Arduino mega.
So far no overheating or anything. I have connected one guitar pedal on relay 1 and then sent that signal straight to the amp just to confirm it will work. I can hear my guitar through the amp and can hear the noise coming from the switch. However, no noise from the relay to make me think the relay is switching. I have tried powering the relay from a separate power supply (5v 2A). Still no switching.

0
None
CarraNJimT130

Answer 9 months ago

just the instructable , it's all in there!

0
None
JimT130

Question 9 months ago

I just followed this video on youtube to test my relay module and not a single light on it comes on!! Does that mean it is a faulty module? should there be lights on there?

https://www.youtube.com/watch?v=rygfpmuMe78

0
None
JimT130

9 months ago

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

1 reply
0
None
CarraNJimT130

Reply 9 months ago

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!