Tag Archives: anandamidi

Building Anandamidi, part 4

This is the last post about Anandamidi, I promise! So, in case you forgot, this is the remaining stuff to finish the controller:

  1. Painting the case
  2. Interfacing Arduino with separate USB MIDI chip on separate PCB (Altmustech AU-123)

1) Painting the case

Fairly easy part. I’ve simply bought black spray for wood and sprayed the case 3-4 times. Looks really cool!


Thing I haven’t mentioned before is the cable plate and the cable itself. I bought several of these USB cables off eBay:OLYMPUS DIGITAL CAMERA

I’ve cut off the mini-b part of cable and replaced it with 4 cables with female headers on them, so that I can simply plug it to USB MIDI or serial conversion board. Since just screwing that cable directly on wooden case would look rather ugly, I’ve also designed a cable plate board, made from same Gravoply board as the main plate.

OLYMPUS DIGITAL CAMERAMuch nicer, although I’m not too happy with screws on that plate (I haven’t had anything else). Right, let’s move on to #2.

2) USB MIDI board

OLYMPUS DIGITAL CAMERAThere were more than several issues with this thing, as usual. After I received the PCBs, I asked a friend to help me solder that MIDI chip, since I’ve never soldered SMD component before, plus I don’t have necessary equipment for that job. After we soldered everything, connecting the board to PC did nothing. No errors, no anything. Checked everything few times, but I couldn’t find the error. Grrr! Since that didn’t work, I’ve decided to give the controller to the guy for whom I was building it without that board. Instead, there’s simple CP2102 serial module inside the Anandamidi at the moment. Everything is the same, except that way you need to install drivers (atleast if you’re on Windows), install virtual midi port and an app which converts serial messages from Arduino to MIDI. Couple of extra unnecessary layers, but it works without issues. After I got home, I spent few more days trying to figure out where I did mistake. Eventually, I figured I used capacitors far too large to be put in parallel with 12MHz crystal which MIDI chip needs. I bought 22µF tantalum caps, simply because the official documentation said only “22” for two crystal caps, so I assumed they meant microfarads. Did I mention how expensive tantalum caps are? Very. Tantalum caps are very expensive. Oh well. What I needed was 22pF caps, so after I bought them, suddenly everything worked. Hooray! Windows happily reported it found new USB MIDI device. Awesome. Unfortunately, issues didn’t end here.

Testing the board

For first try, I only connected TX pin from Arduino to RX pin to that board, so I was only able to send data from Arduino to PC. It worked without any issue whatsoever, so I assumed sending MIDI data to that chip would work as well. Wrong. I’ve tried to send some  MIDI messages to Arduino via that chip, only to get some gibberish values. Checked everything more than dozen of times, didn’t find anything wrong. So, I went back to reading the AU-123 documentation (after things don’t work, RTFM, right?) and noticed something interesting:


Active high? What the hell is that? Apparently, pins on microcontrollers can be either active high or active low. Active high means that HIGH signal (usually +5V) represents binary 1 and vice versa. Active low is exactly the opposite: +5V signal represents binary 0 and 0V represents binary 1. After some more investigation, I learned that USART pins on AVRs are active low, meaning that I need inverter if I want to interface them with active high signals. That was also the reason I got gibberish value on Arduino end without the inversion. Obviously, there’s more than several ways to invert digital signal. First I tried with NAND gates (74HCT00 chip) – worked! I simply connected one input of single NAND gate to +5V, and other input was the TX pin from AU-123 chip. Output from gate was inverted, so I connected it directly to Arduino RX pin. While this solution works, that chip contains 4 NAND gates and has 16 pins, and I only need one input on gate, so it’s a waste of chip. Instead, I went with transistor solution (2n2222):


Really simple schematic and works just like the NAND gate solution. Finally, the MIDI USB board is fully fuctional.

Controller demo

Since everything works, here’s a video with Anandamidi, and my first controller, Tannin. Note that this was recorded before the case was painted. Enjoy.


Building Anandamidi, part 3

Like last time I posted here, there’s been much progress. In fact, the controller is already working, even though everything isn’t finished yet. So, let’s start where we finished last time. Faders!

Placing faders

As I’ve already stated, I had some issues with placing the faders. Main source of issues was that I didn’t have any 2mm screws to screw them to the plate. As I’ve found out, those tiny screws are incredibly hard to find, at least in my area, so I had to figure out something else.


Above each fader, there is really thin piece of plastic board super-glued to its surface. Couple of mm away there is standard 3mm hole. To make it more stable (otherwise that plastic would’ve fallen off) there are wooden holders screwed really tight so that there’s no way anything can happen with faders. Wooden pieces on left/right fader are shown here only for reference, as I designed PCB to fit between those two faders, but more on that later. Pretty dirty hack, as it involves extra stuff like wooden pieces, plastic and superglue. And, as the only real constant in universe says “thou shalt not use superglue without supergluing thyself”, I managed to spill some glue on my sweat suit. 😦 So yeah, building MIDI controllers is dangerous. You have been warned.

Worth of mention is that all of this would never happen if I had those damn small screws! I eventually ordered bag of them from eBay, when I finished all this, since eBay shipping times are getting horrible lately, and I wanted to get this done as soon as possible.


I’ve done PCB schematic in EAGLE CAD, my so-far favourite PCB design application. The board houses Arduino Pro Mini, two resistors for LED rows in matrix, 16 diodes for buttons in matrix to enable multi-press, 4051 multiplexer for potentiometers and couple of capacitors to make everything run more smoothly. There’s also lot of pin headers for wiring LEDs, buttons and fader. Pretty simple schematic, but prone to errors like everything. After all, what is a project without issues? There were three issues in total with PCB, but luckily, all are solved.



1) The board dimensions

PCB has been designed to fit between left and right fader, to make wiring more efficient and easier. Unfortunately, I completely forgot that I have to pay attention to board height, as those 3 mm screws actually set the height limit. To my good fortune, lower dimensions were okay and upper  needed a bit of trimming with sandpaper. Luckily, I’ve checked the design in EAGLE with upper few mm cut off, to see if that would mess with ground planes. It didn’t! One issue solved.


2) Button matrix and diodes wiring

This issue popped out after I’ve finished wiring all the buttons. So, I connected the controller in PC to check if everything is OK with buttons. Yes, they all worked, but eight left buttons registered as only four buttons, and same thing happened on the right side. Basically, pressing buttons next to each other showed up as same button. A bit of inspective work later, I found out I made really stupid mistake of connecting two buttons under same row and column on PCB design. Ugh!

OLYMPUS DIGITAL CAMERAThe fix consisted of soldering four buttons on the left to right side of PCB and vice versa. Not too much of a problem, but after that I had 8 wires in total soldered directly to PCB, which really broke my modular design, as I wanted each component to be un-pluggable.

3) Ground issues

This is probably the last time I’m ever going to build something with PCB without protective layers. Only reason I did it this time is because I ordered PCB from local shop from which I can get PCB done in a few days, but the prices are absurdly high compared to ITead studio, for example (I found out about that site after I already sent PCB to production, of course). Ordering 10 of those boards from ITead with protective layers, silks etc. would’ve costed me LESS than single board I used here, without any of those layers, just plain double-layered board. Ugh. Lesson learned. Anyways, after I connected pretty-much everything, the LEDs started to behave weirdly, as well as two buttons (their presses showed up like pressing couple of buttons instead of only one). Again, some investigation revelead that one of my columns in matrix-setup was connected to ground. The reason it did is because after I soldered PCB to faders, one tiny bit of PCB surface touched a piece of metal part on fader, short-circuiting that column line to ground. With protective layers this would’ve never happened. What I had to do was to un-solder faders, disconnect every wire from PCB and also to un-solder those 8 wires from issue #2 (somehow I knew sooner or later I would have to do that, things just DON’T work at first, second or third try). After that I’ve put some isolation tape across whole bottom of both faders, and also on PCB to places where I connect faders, just to be sure. Messy bussiness again, but I fixed it.

After solving all the issues with PCB, everything worked. Below the board there are two wooden pieces, put there so that I can screw the four screws to secure both the board and faders, and also to avoid bending of PCB.

The box

After I finally solved all the issues with electronics, I was still left with couple of other things. The first was the case. It’s a fairly simple wooden case, and the guy who did it has done pretty good job. Things can always be better, but sometimes they don’t have to be.


Remaining stuff:

  1. Painting the case (black!)
  2. Interfacing Arduino with separate USB MIDI chip on separate PCB

More on that next time!

Building Anandamidi, part 2

Lots of progress since my last post. I got the plate, already placed most of the components, finished software and just today I made some final adjustments to PCB.

Here’s how the plate looked after I got it and after I’ve put some stuff on it:


That board is really awesome, sometimes I feel it’s not worth even designing anything since the board alone looks so good with anything engraved on it. The fader screws in this picture were not actually those I prepared for Anandamidi. They’re only here since at the time I did not have them yet. LED holders are here, but they don’t contain any LEDs yet. Buttons were originally mechanical buttons, but not anymore. More on that later.

One of the advantages of having 2-plate board (plexiglass+gravoply in this case) is that you can make two different layouts for each board. I used that advantage to make holes for screws bigger on engraved board, and smaller on plexi, so that they don’t stick out. I made the same thing with buttons: round hole on plexi, square hole on top. I only wish I made those squares for buttons 0.2mm smaller so that they truly don’t move at all, even tho it’s fine like this as well, when I screwed them I hardly noticed anything.



Tweaking the buttons

Here’s the thing with those buttons. I had a bunch of them, back when I first started doing all this and was unaware of many different types of switches (hey, a button is a button, right?). These were mechanical, and they’re truly awful, atleast if you intend to use them on DJ controller where you need instant reaction. However, unlike most of mechanical buttons I’ve seen, these can actually be disassembled. Let’s see what’s inside!



Lots of stuff inside. They’re really hard-to-press because of those strings. When you press them, you push them until that small metal circle touches the pins on the cap. Some buttons react better, some worse, some react just random (no reaction at all on hard press, reaction on light press, etc.). In short, pretty crappy. However, given that they can be hacked into, plus they look really nice,  I figured I must somehow use those things instead of throwing them to garbage can (where they almost did end up few years ago when I bought over 30 of them only to find out they’re crap – they were not cheap, that’s the worst part). So, just for the kicks, I removed all that stuff inside the button and tried to put a tactile switch underneath it to see if they fit.


 Awesome! Now all I needed was something to put inside the button instead of those strings, and something to keep that tactile switch from falling. Simple metal screws proved as great replacement. It turned out you can even screw them inside the switch, so that they don’t fall out. Wow, these buttons are truly awesome for tweaking! That’s the first part of problem, the second was to keep tactile switch below the button. It’s the best to take a look at the pictures, instead of reading an explanation:

983653_452628388217130_1167125224532009197_n 10154176_452628404883795_6039742779084255572_n 10151967_452628478217121_7552256885835806934_n

 Great. Nice looking buttons with even nicer tactile switches below them.


LEDs were a lot simpler task. I had lots of both LEDs and metal holders for them, however, those holders don’t actually “hold” the LED in place as they should, as they tend to move a lot. Simple solution was adding a bit of heat-shrinkable tube between that plastic cap in which LED goes and LED itself. LED does need to be pushed a bit harder into the holder after that, but you don’t have to worry about whether will it move or fall out – because it won’t.



Only thing I added to pots are pin headers. That way the wiring is a lot easier, and if for some reason pot fails, or you (for whatever reason) want to unplug it, then you just do. No need to unsolder, then solder again etc. Plug and play.


I already did some soldering work to LEDs. Since they work in matrix (like buttons), each column of LEDs on Anandamidi has a single row, which simplifies soldering a lot.

Only components not there yet are faders. They are kind of tricky, and I had some issues with deciding how to screw them, but more on that in next part.

Building Anandamidi controller, part 1

Anandamidi, MIDI controller with a strange name, is my latest project. Guy for whom I’m building it sent me basic layout and a name, while I’m working on everything else, from design (which always come first) to electronics and programming.


Let’s explain the name first. “Anandamide is a molecule that plays a role in many bodily activities, including appetite, memory, pain, depression, and fertility – hence its name, which is derived from the word ‘ananda’ which means ‘extreme delight’ or ‘bliss’ in the Sanskrit language” (Source). The molecule looks like this:


Anandamide molecule



Moving on to layout. Project is fairly simple, as far as component number is concerned. It consists of 8 switches, 2 rows and 4 columns on the left side of controller and another 8 on the right side. Middle part consists of two vertically placed faders, with 5 LEDs in column next to each of them. Next to each LED column are 3 potentiometers. Below that is another horizontally placed fader. That’s it actually.



After few days of playing in CorelDraw, this is what I’ve come up with:


I’m very fond of Ace Futurism font, so I’m using it almost exclusively in my designs. You can get font for free here. Anandamide molecule is used around the controller name, along with the logo from the guy who ordered it inside it.

Shantea Controls is a name for a imaginary company which builds custom MIDI controllers, and the sole employee is me.) The leaf represents Camelia Sinensis leafs, a plant used for production of green, black and white teas (hence the “tea” in Shantea).



The plate actually consists of two parts. First is black 3mm thick plexiglass on which black Gravoply plate is glued, resulting in a very professional looking product. The Gravoply board is then engraved with laser CNC, so the final look is pretty much identical to the picture posted above.

That would be it for part 1, next time I’ll talk about some quirks and hacks involved into placement of components, among other things.