WIRELESS MIDI RADIO – XBEE


Make a Wireless MIDI Transmitter and Receiver using a simple logic translator that translates the XBEE’s 3.3V to 5V, an optoisolator, a couple of resistors and a couple of voltage regulators.

Required parts list:

1 – Resistor 330 Ohm 1/4W

3 – Resistor 220 Ohm 1/4W

6 – Capacitor Ceramic 1UF 50V

2 – Capacitor Ceramic 0.1UF 25V

1 – 5V VOLTAGE REGULATOR TO-92 MCP1702-5002E/TO

2 – 3.3V VOLTAGE REGULATOR TO-92 MCP1700-3302E/TO

1 – SN74LVC1T45DBVR

1 – PC900V0NSZXF

1 – DIODE 1N914

1 – 4XAA BATTERY HOLDER W/SWITCH SBH341AS

2 – XBEE RADIOS ZNET XB24-BPIT-004

2 – XBEE TO BREADBOARD ADAPTERS BOB-08276

4 – 2MM 10 POS FEMALE HEADERS FOR XBEE NPPN101BFCN-RC

4 – 0.1″ 10 POS MALE HEADERS FOR XBEE M20-9991046

1 – ADAPTER FOR SOT 23-5 74LVCT25 TRANSLATOR ADAFRUIT PN: 1230

1 – XBEE USB ADAPTER FOR PROGRAMMING PARALLAX PN: 32400 otherwise 3.3V TTL to USB Smart Cable would work.

2 – Standard MIDI Cables one short to go from keyboard to transmitter, other length depending upon distance from sound source

Depending upon enclosure and breadboarding there’s through hole or panel mount 5 PIN DIN MIDI connectors available. Examples include:

2 – Through Hole 5 Position DIN Connector Right Angle PN: SDS-50J

2 – Panel Mount 5 Position DIN Connector PN: SD-50LS

This writer’s weapon of choice is going to be making a wireless keytar.

Donor vehicle choices have been carefully researched, the easiest way from point A to B is to choose a MIDI keyboard that has a Battery Option Built in, but MIDI keyboards don’t always have that option and power can be injected in a pinch via the USB connector or for the more ambitious type drill a panel mount connector into the case and hard solder in the power.
Donor keyboard for this build should include the old school MIDI connector output (5 Pin DIN – 180 Degree to be precise) Many of todays MIDI keyboards only have a USB option so check to verify. Candidates include but are not limited to:

 

DIY WIRELESS KEYTAR

KORG MICROKONTROL KEYTAR

I found the above Korg Microkontrol real cheap on a popular auction site, missing a fader knob and a bit scuffed up. It’s got lots of knobs and drum pads, this is by far my favorite for this kind of application.

BEHRINGER UMX25
Behringer U-Control UMX Series

The Behringer UMX Series of MIDI keyboards have a battery option and are available with multiple octave options. They still can be had new, I prefer buying used in scuffed up condition to save money.

MAD_CATZ_KEYBOARD

Click Here for Mad Catz Keyboard

 The one keyboard that brings this project into the affordable price range for many people is the Rock Band 3 Keyboard from Mad Catz which can be had at the time of this writing for $30 US new, if the user is ok with being limited to 2 octaves and one doesn’t need knobs this is a great option. Two of the buttons allow octave changes on the fly and the the handle on top has a ribbon controller that defaults to mod wheel and when the button is pressed it changes to pitch bend.

The two trickiest things of pulling this project off are configuring the XBEE radios to the communication speed of MIDI and not burning up the tiny SOT-23-6 electronic component when soldering to it. 

MIDI’s BAUD RATE , otherwise known as Bit Rate is 31250.  That probably something silly like take a crystal and divide the 5Mhz  by 16. Anyways, to program an XBEE to a non-standard bit rate you have to program it within the terminal window and program the speed in hexidecimal.

31250 in hex is 7A12.

Lets start out by configuring the radio that is connected to the keyboard.

To figure out the original settings you can click >

Read

Now, to program your Series 2 <make sure to do this with a Series 2 radio, if it’s Series 1 I can’t help you>

First, chose the firmware setting >

XB24-ZB.

Then under Function Set choose:

ZIGBEE ROUTER AT

Under PAN ID choose a PAN ID, and make sure to write it on something and stick it to your radio.

 

XCTU_ROUTER_PAN_ID

Then Click>

Write

We’re not done with this radio yet. Now the BAUD rate needs to get programmed in the terminal window:

To get into AT Command Mode in terminal window, you have to enter in the Guard Sequence, which by default is +++.  You have to type them at a certain speed and after a defined amount of seconds if you stop typing Command Mode will time out and you have to type +++ again to get back and start over. If you’re a slow typer I would recommend figuring out how to set the Command Mode Timeout setting to something a little longer. Also, write down all the commands you need to type and have them handy before you start.

Let’s explain the commands I used in the figure below…

The radio, when receiving a successful command will send an acknowledgment > OK

First, I ask what my Personal Area Network (PAN ID)  is by typing >

ATID

The radio response by telling me the ID is 218, which happens to be my area code.

Now I ask what is my Baud Rate setting (communication speed). It tells me it’s a 3, which if you check the user’s manual indicates the current setting is factory default, 9600 baud, which is a common speed.

Now I’ll set the baud rate in hex to 31250 by typing

atbd7A12

ATBD means AT Command Baud.

It indicates an acknowledgement of OK. I would recommend typing ATBD again to check and make sure the setting took.

Now I’m going to program what my target reciepient of my messages within the network is. Since my keyboard is a Router, my base station is going to be the network Coordinator. This is a two radio serial application but you can use your Coordinator to accept MIDI messages from more than just one Router. Per the manual to address the network Coordinator I need to program two settings, Destination Address Low and Destination Address High both to zero.

Type>

ATDL0

then type >

ATDH0

again, to check to see if your programming took you can type ATDL and ATDH and the radio will spit out the current settings.

Then, make sure before you stop programming to type >

ATWR.

This is important, ATWR means ATCommand Write to memory, if you don’t type this none of the settings you just typed will take. Also, note you can program ATDL and ATDH in the Modem Configuration window shown in the picture above which can make it a little easier. The only thing that has to be programmed in the terminal window is the Baud Rate setting.

ROUTER_TERMINAL_CONFIG

 

Now let’s do similar with the Coordinator, only do not program the ATDL and ATDH to zero, in this case just program the ATDL to FFFF which means broadcast.

Make sure the Coordinator has the same firmware chosen, XB24-ZB in my case.

XB24-ZB-ZIGBEE_COORDINATOR_AT

COORDINATOR_TERMINAL_CONFIG

 

The only other thing to note with the XBees is in Modem Configuration window make sure the power setting is at it’s highest.

I spun up a circuit board for this project.

OLYMPUS DIGITAL CAMERA

 

My current design, unlike the above picture has standard MIDI connectors on both boards, it’s just the keyboard side I like to have a locking connector on the radio, so I usually go with a bayonet style locking connector like the ones a company called Bulgin makes.

CLICK HERE FOR Gerbers (board design files) MIDI_XCIEVER_7_10_15

Click here to get qty 3 of this board from Osh Park

When attempting this build a soldering iron with adjustable temp is recommended, small SOT-23-6 size devices have a limited soldering time, also, a healthy amount of flux helps the process.

 

2 thoughts on “WIRELESS MIDI RADIO – XBEE

Leave a Reply to kr1st0f Cancel reply

Your email address will not be published. Required fields are marked *