Mono Jack 6.3 mm to USB using Arduino to send midi CC

Hi there,

I'm going to build a simple Arduino device and I need your guidance : )

The goal here is to use my Double footswitch Boss pedal (via 2x Mono Jack 6.3 mm cables) to control Ableton Live parameters.

Today, i'm using my master keyboard to connect the pedals and send midi CC messages to usb using its software.
The goal of my project is to replace the keyboard with a (transportable) Arduino box that takes jack cable as input and usb as output, while preserving the momentary & latch signals sent by the pedal.

From my researches, I need :

So here is a few questions :

  • Would this setup work or am i missing something ?
  • Should I use any resistance between my jack sockets and the Arduino connectors ?
  • If yes, how to know which resistance value to use ?
  • What kind of cables should I use to connect the jack sockets to the Arduino connectors ?
  • Is it necessary to use a breadboard or can I solder directly on Arduino headers?

Looking forward your guidance, I wish you all a great day
David

There is a USB MIDI library for the Arduino, but I don't know anything about it.

2.Should I use any resistance between my jack sockets and the Arduino connectors ?
3.If yes, how to know which resistance value to use ?

I assume the switches can be wired so they switch between ground & open?

In that case, simply [u]enable the Arduino's internal plull-up resistor(s)[/u]. When the switch is open the resistor pulls the input high. When the switch is closed (on) it will ground the input "overpowering" the pull-up resistor pulling the input low.

4.What kind of cables should I use to connect the jack sockets to the Arduino connectors ?

Since it's DC and almost no current, any wire/cable will work. (Use something rugged, of course).

5.Is it necessary to use a breadboard or can I solder directly on Arduino headers?

The headers on the board are female, so you can't solder to them but you can solder directly to the bottom of the board. I've never done that because it makes development/testing/troubleshooting more difficult and the thing is less serviceable.

I've soldered wires to [u]header pins[/u], and covered the solder joints with heatshrink to make a connector, but I'm really not satisfied with that.

I'm probably going to use a [u]Arduino-shield perfboard[/u] next time to make the connections and/or to adapt to some "normal" connectors (and maybe for some other circuitry), or I may get a custom "shield" PC board made..

The Uno and Mega boards are not good choices for a USB MIDI device, because they don't have a native USB connection, they communicate with the computer over a serial TTL connection to a second microcontroller (ATmega16U2) that acts as a virtual USB COM port. This means that it doesn't support MIDI over USB unless you upload custom firmware to the ATmega16U2. Not recommended for beginners and very cumbersome during development and debugging.

I'd recommend an Arduino Micro, Leonardo, or a Teensy.
If you need more I/O, use a Due.

Read this for more information about MIDI over USB and how it works on different Arduino boards:

Pieter

@DVDdoug

DVDdoug:
any wire/cable will work. (Use something rugged, of course).

Could I use those ones ? or those ? If you can recommend some high quality ones, i'd be grateful

DVDdoug:
I'm probably going to use a [u]Arduino-shield perfboard[/u] next time

Thanks for that advice, i'll probably go with a protoshield. It will do for a first version and i'll work on the size later on

@PieterP

PieterP:
The Uno and Mega (...) doesn't support MIDI over USB unless you upload custom firmware (...) I'd recommend an Arduino Micro, Leonardo, or a Teensy.

Thanks a lot for that crucial info! I have read about some boards with native usb support but it didn't seem critical to my project.
I have actually read about a few projects using Uno board for making midi controllers, does it mean they have loaded a custom firmware to make it work ?

PieterP:
Read this for more information about MIDI over USB and how it works on different Arduino boards:MIDI over USB · tttapa/MIDI_controller Wiki · GitHub

Interesting reading, thanks a lot!
Out of curiosity, would you recommend using Chinese clones, quality wise ?

pyronb:
Thanks a lot for that crucial info! I have read about some boards with native usb support but it didn't seem critical to my project.
I have actually read about a few projects using Uno board for making midi controllers, does it mean they have loaded a custom firmware to make it work ?

Yes, you either need to have special software running on the computer (not great if you just want your controller to work instantly when you plug it into any computer) or custom firmware in the ATmega16U2.
Both solutions are a real pain (been there, done that). You can't upload Arduino programs while this firmware is loaded (unless you have an external programmer or USB-to-Serial converter connected).
Do yourself a favor and get a board that's suited for the job, it'll save you a lot of time and effort. An Arduino Uno or Mega simply wasn't designed to do advanced USB stuff.

pyronb:
Interesting reading, thanks a lot!
Out of curiosity, would you recommend using Chinese clones, quality wise ?

I always buy an official board first, to support the development. Then when I blow the original one up, or if I need a second one for prototyping, I sometimes get a Chinese clone.
Can't complain about the quality of the Chinese boards I got, however, if you really really want to use an Uno clone for USB MIDI, make sure you get one with an ATmega16U2, and not one that uses an FTDI FT232 or CH340G or cp2102. Beware false advertising, some sellers show pictures of an ATmega16U2 while the description says it's a CH340G. Most of the time this means that it probably comes with the CH340G, which can't be used for USB MIDI.

Or just avoid all these problems, and get a Leonardo (clone?) with native USB support. There's really no point in choosing an UNO for USB MIDI if you have to buy a new board.

Pieter

Thanks a lot PieterP for all those infos. I'll definitely take those under account.

By any chance, do you know of a nice electronic components online store located in Europe ?
Sparkfun looks good but shipping from the States are are gonna cost a lot for me

David

Could I use those ones ? or those ? If you can recommend some high quality ones, i'd be grateful.[/quote]The first is good for internal wiring. 22 or 24 gauge is about right. The second is good for connecting to the Arduino header sockets or to a plug-in breadboard and/or experimenting & prototyping. You may not need them with a protoboard.

But, I thought you were asking about soldering to the 6.3mm plugs to make cables and I was thinking about something like [u]this[/u]. Of course, if you are using 6.3mm jacks (sockets) on the Arduino-side, you can use pre-made cables for connections to the floor-switch.

I agree with Peter about the Chinese stuff (or eBay or Alibaba)... A lot of it is poorly documented and I "feel better" about buying from a reputable supplier and a known manufacturer. i.e. Sparkfun & Adafruit (which I realize are U.S. suppliers) usually link to the chip-manufacturer's datasheet, and if it's a circuit board there is usually a schematic, and often some application examples, etc.

And when you add-up the real total-cost of your project, including the case, power supply, switches, knobs, connectors, and all of the little things, you aren't saving much money by skimping on the "most important" electronic components.

If you're going "into production" and you need to make a profit, then it's more important to minimize costs... If you can save 5 or 10%, that goes directly to profit or it allows you to compete. (Of course, that doesn't mean you can use unreliable parts.) But as a hobbyist, you're going to spend more than you expect anyway and you're going to spend lots of development time for a one-off project and not worth taking chances with unknown parts.

you either need to have special software running on the computer (not great if you just want your controller to work instantly when you plug it into any computer)

True, but if you don't mind a helper application on your PC the one called hairless is the best. Versions for most OS. It converts a serial stream into a MIDI stream.

As to an electronics store then I would recommend Farnell or Rapid

DVDdoug:
The first is good for internal wiring. 22 or 24 gauge is about right. The second is good for connecting to the Arduino header sockets or to a plug-in breadboard and/or experimenting & prototyping. You may not need them with a protoboard.

I'm new to this and I can't really make sense of that sentence to be honest. Could you throw a link about wire documentation by any chance so that I learn a bit about that ?

DVDdoug:
But, I thought you were asking about soldering to the 6.3mm plugs to make cables

No no : ) I have cables already. What I need to do is to solder those female sockets into the Arduino (using some cables I guess). That's for that purpose that I need those cables.

Speaking about soldering, I didn't looked deeply yet into the connection that I would have to make. Could you please tell me if those tutorials are good exemple for what i'm trying to accomplish ? Here, here, here, here and here.
I couldn't find tutos using jack sockets but midi ones should be somewhat close, am I right ?

DVDdoug:
usually link to the chip-manufacturer's datasheet, and if it's a circuit board there is usually a schematic, and often some application examples, etc.

DVDdoug:
not worth taking chances with unknown parts.

Good to know, it can't hurt for a first project to go with the real deal.

Into the Arduino's female sockets you plug male header pin strips. Then you solderd to those header pins.
Google DuPont header pin strip
header pin strips

Grumpy_Mike:
Wire gauge - Wikipedia

Into the Arduino's female sockets you plug male header pin strips. Then you solderd to those header pins.
Google DuPont header pin strip
header pin strips

Ahah everything makes sense now : ) Thanks a lot

I'll make all required purchases in the next few days and keep you all updated on how it goes.

David

Hey guys, I have picked everything needed for the project (gonna go with Due, Pro Micro or Teensy btw) but i'm struggling to pick the 1/4 inch 6.35mm female Jack socket mono.

Here the selection I have made so far, can you please help me decide which to pick ?

Choice 1

Choice 2

Choice 3

Choice 4

I'm open to any other connection of course

I wish you all a great weekend

Any will do. Basically their are PCB mounting or panel mounting, so it depends on how you intend to box your project.

Cool thanks Grumpy_Mike !

I have found some exactly like Choice 1 by visiting a few shops in my city yesterday : )

Hi Guys ! i'm back here :slight_smile:

So i have now received all hardware I wanted for my project :

  • some Arduino boards with native usb support : a Due, a Pro Micro and a Teensy 3.2
  • some 1/4 inch (6.35mm) female Jack socket like this one
  • some jump wires
    But now comes the time to solder stuff and i'm kind of lost ! There are so many pins on each board that i don't know which to solder my jack sockets to.

So few questions :

  • Can I use any digital pin of my Arduino boards to connect my Jack sockets ? I have read pinout diagrams like this one but i'm far from understanding everything
  • I found that wiring image online that seems to tell I should connect one of the (un-switched) socket leg to a digital pin and the other to the ground. Do I get this right ?
  • Can I connect multiple sockets to the same ground pin ? There isn't many of them
  • What about RX serial ports ? They seem to be useful for usb related stuff but I don't understand precisely what for
  • Is there anything else I should need for my project ? (like resistors)

I apologize in advance if (most of) those questions are stupid. I'm trying to understand the big picture :cold_sweat:

Warm regards to all of you (and merry christmas by the way),
David

Before you connect to any pins, get a multimeter to do some simple tests.

The very first test is the measure the voltages when the buttons are pressed and not pressed. That pedal takes a 9 volt battery. The very first thing you want to learn is whether it's sending you 9 volts when you press (or don't press) the buttons. If this thing sends you voltages, then you're going to need to do more work to connect it safely to an Arduino or Teensy.

DO NOT CONNECT DIRECTLY if the plug measures 9 volts!

If you get no voltage at all (except perhaps very minor fluctuations when you touch the wires), then switch to resistance/ohms measurement. It's possible the wires just connect to switches. In that case, you'd expect to see infinite (or over / overload) ohms in one state and close to zero ohms in the other state. If this is how the pedal works, then you can connect each switch directly to a digital pin and use pinMode(pin, INPUT_PULLUP).

Whichever way things work, I highly recommend using the Bounce library to read the pins. You can use digitalRead(), but then you have to do quite a bit of extra work to deal with the mechanical chatter in the switches. The Bounce lib does all that for you. Especially with MIDI, you want clean signals so you can transmit only 1 MIDI message when the button presses, and perhaps another when it releases, so do yourself a favor and use the Bounce lib.

If using Teensy (and you've installed Teensyduino), click File > Examples > Teensy > USB_MIDI > Buttons to get started with a MIDI example using Bounce. The comments in that code explain how it works. If you wanted something other than note on/off, just change the MIDI messages.