Electronic Product Design: Final Report

portaMid: A Miniature Bluetooth MIDI Keyboard

The portaMid keyboard is a MIDI keyboard that works over the Bluetooth Low Energy (BLE) protocol which allows one to control music apps on any Apple iOS device. The device contains a 500 mAh lithium polymer rechargeable battery which lasts for many hours of use.

The one octave of piano style keys are soft to the touch but contain tactile feedback so that the user knows when the key has been pressed. Utilizing the octave keys, the user may lower or raise the octave in which the piano-style keys play. The LED represents the octave selection via different color output.

A removable phone mount allows for use on the go for different sizes of iPhone. In fact, every iPhone since the 4S is supported by the device. Most music apps support MIDI over BLE natively and connect to the portaMid with no configuration required: just connect and use. An example of set-up with the GarageBand app may be found in the user manual.

User Feedback

For testing, the portaMid was given to two people for a week each. The following is the feedback from the first person:

I love the PortaMid!! As a musician who uses midi for all of my projects, it’s so convenient to be able to have an external midi controller. Especially because it’s so portable! I can easily fit it into my purse or backpack and use it wherever I go, train, bus, or at home. I also really love the design, the PortaMid looks as fun as it is to use. The buttons are accessible and labeled to help easily find the functions. I can’t wait to have a PortaMid of my own!

The second person had the following to say:

Positive Reactions!

• Good size to hold

• Clear and simple user manual

• LOVE the color change for different octaves- that was very useful

• Bluetooth easy to set up

• It only took me 10-15 min to get the hang of it and start playing melodies.

• I was really excited about the product, and it was more fun to use than I thought it would be

Thoughts or Critiques

• My phone would weigh down the stand and end up laying out horizontally. (I tended to use portaMid horizontally on my lap anyway)

• It would be nice to have a battery indicator so I knew how much charge it had left.

• I plugged it in to charge and naturally expected the light to show that it was charging. After reading the manual, I still expected the STATUS light to turn amber, and got confused. I re-read and realized that a light by the connector delineates that the device is charging

• I love click-y buttons, but it was difficult to push them down (at least if you wanted to try and play a chord)

• It may be easier to use if it looked more like a piano in some way- so by brain would not take as long to think of where a particular note is

• The ‘porta’ part in the name almost reminds me of porta potty. But of course it gets across what it is and comes with an awesome logo

• Thank you for letting me test it!

Improvements & Future Work

Going forward, further refinements to the device will be made. For example, it would be nice to have buttons that have the tactile feeling but are less difficult to press and create less noise. Research needs to be done on what could replace the standard tactile buttons with something that is better. In addition, it would be nice to have some velocity sensitive keys for playing more than one dynamic.

In addition, I will need to create a circuit that can poll the battery level at intervals in order to indicate the current charge level or if the battery is dying.

The stand could use a wing-nut to allow the user to adjust the tension so as to keep the unit in the proper position when in use. Also, it would allow for ease of removing the stand entirely.

While using the product, I found myself gripping the device like a game-pad. I had the thought of incorporating shoulder buttons which could be used for modulation, pitch bend, after-touch pressure, etc.

I envision an entire line of these being made with different properties. For example it would be nice to have a version that mimics the Moog style ribbons, or another version that is a mini sequencer. It would only take finding different sensors or button layouts and incorporating them into the current design for a completely different type of interface.

Electronic Product Design Progress Report: Weeks 8 & 9

Finished Product

IMG_0100.JPEG

Before the boards arrived, I made the final version of the case in Fusion 360. In order to ensure that I had the correct dimensions, I exported the board from KiCAD as a STEP file. Other components such as switches, USB ports, and LEDs were imported into Fusion from a website called GrabCAD. This website is a community website similar to Thingiverse, but contains mostly engineering components.

I printed the buttons in NinjaFlex 85A TPU, which leaves the buttons tactile but feeling soft and reduces noise. The phone clamp connects to the case utilizing a ball joint which allows the keyboard to be used without the phone attached.

IMG_0101.JPEG

The side of the case contains an indentation that allows a USB micro cable to be plugged into the Adafruit feather for charging. The charging LED is visible through one hole near the port and a programmable LED is visible through another.

3D Printing Challenges

After creating the case, I discovered some difficulty 3D printing the panel. The design contains engraved lettering for the name of the device and the functions of the buttons and switches. At first I discovered that the letters for the functions were too small and attempted to reprint. The reprint was warped and squashed and still had an “ashy” color. To compensate for this problem, I ensured the bed was level by installing a glass bed and re-adjusting the bed.

While this corrected the squashing and color issues, the red PLA still warped. After a bit of research, I discovered that this was an adhesion issue with the PLA itself. This was confirmed when printing with other brands and colors as it only happened with the red PLA. I found that printing the face plate with a brim instead of a skirt corrected the issue with warping.

Software Updates

Since I changed the design of the circuit board to use a 5mm Adafruit Neopixel, I had to update the code in order to accommodate. The LED now blinks blue upon starting to indicate the need for pairing, then immediately changes to a color corresponding to the current octave in use:

switch (octaveMultiplier){
    case 0 :
       pixel.clear(); // off
    
    case 1 :
      pixel.setPixelColor(0, 255, 0, 0); // red
      break;

    case 2 :
      pixel.setPixelColor(0, 255, 127, 0); // orange
      break;
      
    case 3 :
      pixel.setPixelColor(0, 255, 255, 0); // yellow
      break;
      
    case 4 : 
      pixel.setPixelColor(0, 0, 230, 0); // green
      break;
      
    case 5 : 
      pixel.setPixelColor(0, 0, 255, 255); // aqua
      break;

    case 6 : 
      pixel.setPixelColor(0, 0, 42, 255); // blue
      break;

    case 7 :
      pixel.setPixelColor(0, 221, 51, 255); // purple
      break;

    case 8: 
      pixel.setPixelColor(0, 255, 25, 255); // fuchsia
      break;

    default :
      pixel.setPixelColor(0, 255, 255, 255); // white
    
  }

Bodge

After receiving the printed circuit boards from OSH Park, I soldered up one of the boards. I soon discovered the same problem plaguing prior incarnations of the board: the MCP23017 would stop working after a few seconds. Considering that I changed the entire design to accommodate a larger version of the IC, I was frustrated. However, after some research I ran across a Feather wiring schematic for an MCP23017 and discovered that they had used a pull-up resistor for SDA and SCL lines. After soldering up another board with two resistors bodged into the circuit, I discovered that the product worked without any issues!

Next Steps

This week, I will work on making the manual. Meanwhile, I will send it with two of my friends for overnight testing.

Electronic Product Design Progress Report: Week 7

PCB Design: Version 3

Having tried multiple times to unsuccessfully solder the TSSOP version of the MCP23017 to the version 2 PCB, I decided that a redesign was needed for the PCB. This also gave me the opportunity to replace the original RGB LED to a 5mm neopixel in order to have access to more colors for the interface.

Annotation 2019-04-07 184340.jpg

Changing to the neopixel also lessened the amount of wires between the main PCB and the Feather Bluefruit. The board was retraced and sent to OSHPark for printing. It is estimated to arrive within the week.

3D Printer Purchase

IMG_0084.JPEG

After using the 3D printer in Leslie eLab, I realized that purchasing one would be an excellent way to prototype without having the hassle of scheduling time and traveling downtown. Upon hearing how successful it was, while being affordable, I purchased an Ender 3.

Since this is a no-frills printer, I decided to add a couple of features to make life a little easier. Firstly, I added a better Bowden tube in the hopes that it will be more reliable than the stock one. Capricorn makes a tube that is not only better quality but works well with printing TPU and high temperature materials. I thought by adding this, it would make printing flexible materials much easier due to being more slippery than the stock tubing.

Due to a concern with thermal runaway, I upgraded the stock firmware to the unified firmware made by TH3D. This firmware also allowed me to add their auto bed leveling modification which reduces the hassle when starting a new print. So far, this kit has performed extremely well. However, I had to modify the amount of calibration points to compensate for the lousy stock bed; now it takes 15 readings instead of the stock 9.

After experimenting with printing NinjaFlex TPU, I realized that I will require one more add-on as the material was backing-up out of the Bowden tube during all of my test prints. I ordered a SeeMeCNC EzR Struder to replace the original extruder.

Next Steps

Next week, I will receive version 3 of the board. Upon soldering and testing, I will make a new 3D printed case using PLA and TPU. I have already been experimenting with phone clamps and may have found a solution to print that utilizes rubber bands as the spring mechanism that holds the phone in place. I am hoping to have the product out for testing within the next two weeks.

Electronic Product Design Progress Report: Week 6 (Midterm Report)

Fully Working Breadboard Prototype

After discovering that the MCP23017 has built-in pull-up resistors and updating libraries, I built a functional prototype on a breadboard:

PCB Version 2 Woes

After redesigning the circuit and sending the circuit board design to OSHPark, the boards arrived within a week. I then solder the boards only to discover a problem: the MCP23017 chip only lasts a minute then stops working. Having seen this problem before, I suspected that the chip is super sensitive to temperatures and therefore is very difficult to hand-solder.

Version 2 of the PCB. Note the melted hole in the table on the right. This comes from using removing TSSOP packages using hot air.

Version 2 of the PCB. Note the melted hole in the table on the right. This comes from using removing TSSOP packages using hot air.

After removing the chip from the board using a hot air gun, I tried soldering another chip to the board. This one was dead on arrival. I repeated this process a couple of times and even melted a couple of buttons, a power switch, and the work table.

While the boards are designed well this time, the chips are allergic to hand soldering. Therefore, I am re-evaluating the use of the chip in the design and may make another PCB that uses a DIP package instead. Initially, I chose this chip to save space in a portable device but the chip is proving to be too difficult for the prototyping stage.

3D Printing Success Story

After designing a case for the portaMid that would not fit on any cheaply available 3D printer, I really wanted to remake the case so I could try (and possibly fail) a 3D print. While waiting on the version 2 portaMid PCBs, I realized that I needed to make a custom case for another project I am working on for my thesis.

This project utilizes an accelerator and vibration motors to create an input device that can give vibrotactile feedback to the user. I wanted to make the device so that it may be strapped onto the user’s arm near their wrist using a standard NATO-style watch band.

After some work in Fusion 360, I printed the design using PLA with PVA as the support material. The design features screw holes for a Feather board, a hole for the USB charging port, a hole for the on/off switch, and a lid that snaps into place using tabs. I found the snap design on the Adafruit YouTube channel and thought it was the best design as it used no screws and could easily be removed.

The part printed well and all components fit in place nicely!

Plans for the Remaining Weeks

Since I am still having difficulties using the TSSOP chip, I may look into having the chip placed on the board by a professional or redesign the board so that it accepts a DIP package version of the MCP23017. This will also give me the opportunity to shrink the board horizontally a tiny bit and add an extra hole in the middle for more support. This could be accomplished by next week.

The case will be designed and laser cut, with buttons 3D-printed, by week 7 or 8. I am considering dropping the support for a phone case so that the product may be designed a little faster. I hope to make two of the products so that I can send one out for testing by week 8 or 9. After that, I will test and make refinements to the software, as per the feedback given by the testers.

Electronic Product Design Progress Report: Week 5

Back to the Breadboard

Since the PCBs from OSHPark were not working properly, I decided to go back and setup the project on the breadboard again. I could not get the project to work properly with the components setup as per the schematic.

After studying the datasheet for the MCP23017, I discovered that the chip has an internal pull-up resistor. Armed with this information, I tried wiring the board differently:

Annotation 2019-03-10 110245.jpg

Now the keyboard was working properly but another problem occurred: the low C on the board would play two distinct notes and the B and high C would not respond at all.

Library Update

I checked the wiring, breadboard, the code, and other MCP23017 chips with no change in the responsiveness of the three keys. I began to suspect one of the libraries that I was using to code the project was not working as promised.

My first assumption was that the library that I used to debounce the buttons on the MCP23017 was broken. It hasn’t been updated in four years so maybe the code was broken. I removed the library without success.

After more tinkering, I then suspected the Adafruit MCP23017 library. While I was researching how to communicate to the MCP23017 via the Wire library, Arduino popped up a message that some of the libraries were out dated and required updates. I followed the link and discovered that the library used to communicate to the Bluetooth module was two versions out of date. Once the library had been updated and the code pushed to the Feather board, all keys responded properly!

Back to the Drawing Board

After handling the printed circuit boards, I discovered that the keyboard would be too wide for my thumbs to reach the middle of the board comfortably. In addition, the outer case was difficult to 3D print on an Ultimaker 3 due to its size and shape. Therefore, I decided to reduce the number of keys from an octave and a third to just an octave. Plus, to reduce the height of the soldered PCB, the Feather board would be removed from the PCB, mounted in the case separately, and then connected via a ribbon cable.

Armed with a working breadboard prototype and plans to shrink the PCB, I updated the schematic:

portaMidV2.png

Then I redesigned the PCB and sent it to OSHPark for printing:

Electronic Product Design Progress Report: Week 4

PCB Arrival

This week, the printed circuit boards arrived in the mail. Upon inspection, I noticed the first problem: the holes for the 12 x 12 mm tactile switches were not big enough for the leads to fit into. Bending the leads of the buttons inwards allowed them to be surface mounted on the board.

While this worked brilliantly, the buttons would not have been flush with the board as they contain a little peg on the bottom. I ordered surface mount switches to compensate for this problem.

In addition, the resistor networks that I purchased were way too small for the board. The footprint in KiCAD was labeled as a 1206 x 4 part. Therefore, when I purchased the part on Mouser, I chose a 1206 sized part; this part was 1206 in LENGTH where as the footprint is 1206 in HEIGHT. This required me to place an order for new parts that would fit the board properly.

More Problems

After soldering the parts onto the board, and testing with a multi-meter, I discovered that the unit powered on, but would not send MIDI when the buttons were pressed. Some more poking around with the multi-meter resulted in finding a short to +3V on the I2C bus SDA line. I then inspected the board, the schematic, and the PCB layout for anything that would bridge the two together. The Feather board worked, the other PCBs didn’t bridge the connection. I concluded that the MCP23017 chips were toast.

Upon removing the chips (and damaging them in the process), the SDA line was still being bridged to +3V. I decided to solder up one of the other boards with new components. Fortunately, the surface-mount buttons arrived earlier which allowed for the buttons to sit flush on the board and easily soldered on the through-hole pads.

Code Update

After soldering to the second board, I decided to update the code so that the key presses would be more responsive. I did this by removing the debouncer library and adding a delay. During the testing of the code, the keyboard responded decently — for a minute.

Fail

While testing the second board, suddenly all of the notes were activated at once then the keyboard was no longer responsive. I tried to reset the microcontroller, upload the firmware again, reset the bluetooth module, and restart the phone without any result. The unit was dead!

I checked if the SDA line was shorting to +3V and it wasn’t. Hooking up the scope to the MCP23017 chips resulted in no activity as well — not even a clock signal.

Electronic Product Design Progress Report: Week 3

Training

On Friday, February 15, I attended the training for laser cutting and 3D printing offered by the Leslie eLab (again!). After the training, I spoke with the trainer about making a case using two materials on top of one another. He did not have an answer and was going to ask around to see if a solution exists. In the mean-time I decided to design the product using two materials in separate printings. Ninja-flex for the buttons and PLA for the rest of the case.

Case Design

The case was designed in Fusion 360 for 3D printing. Borrowing an existing iPhone case from Thingiverse, I created the rest of the portaMid’s case around the existing STL file.

It was necessary to make precise measurements of each part that the case will enclose. However, I was able to use an STL render of the PCB from KiCAD to aid in making sure everything fits together. While the case itself will be printed in standard PLA plastic, the buttons will be printed in a flexible material such as Ninjaflex. The buttons contain a one-millimeter groove in the material so that the plastic will be more flexible. I got this idea from other rubber button designs that I have seen throughout my experience repairing electronics.

Bottom of case as shown in Cura 3D printing software.

Bottom of case as shown in Cura 3D printing software.

Unfortunately, the case is nearly impossible to print in its current form. Despite the part fitting with the advertised 215 x 215 x 200mm build volume for the Ultimaker 3, it cannot print as the part does not conform to the “shadows” on the print bed in Cura. In order to 3D print this design, I must seek a larger printer or change my design to be assembled from multiple parts. Therefore, I am thinking about creating a hybrid of a 3D printed part for the phone case and buttons, and laser cut the rest.

Code Update

Having received the MCP23017 data extender chips, I changed the source code to utilize two of the chips. Unfortunately, my implementation is not efficient and creates serious delay between key presses. Also, the octave keys aren’t functional. I will continue to massage the code until it works properly.

Printed Circuit Board Update

On Monday, my custom PCB will arrive! However, I already discovered two mistakes when updating the code: the RGB LED pins I purchased are in a slightly different order than the part I ordered; and I forgot to include resistors for the LED. This can be solved by bending two of the pins to route them to the proper holes and bodging in the resistors. Next week, I will update the PCB design to correct for this problem.

GitHub

All code and project files have been pushed to GitHub.

Electronic Product Design Progress Report: Week 2

Schematic

This week, I decided to focus on drawing a schematic in KiCAD so that I can design a printed circuit board.

Annotation 2019-02-10 123607.jpg

Due to the amount of input required for the keyboard, two MCP23017 integrated circuits were added to acomodate up to 32 extra GPIO ports on the Feather board. The MCP2307 was chosen due to my preference of working with !2C devices.

PCB Design

After completing the schematic, the PCB was laid out and designed.

PCB Front Copper Layer

PCB Front Copper Layer

PCB Back Copper Layer

PCB Back Copper Layer

PCB Front Silk Screen Layer

PCB Front Silk Screen Layer

During the creation of the PCB, I decided to utilize some surface mount components in order to keep the size of the board as small as possible. Also, I had to reduce the number of notes as the number of buttons in the original design would not fit on the size of circuit board that I chose.

I purchased 12x12mm buttons with plungers (stems) for the keys as they supported key caps that would protrude through the final case.

The footprint for the surface-mounted on-off switch that I purchased were not included with KiCAD or could be found in the Digikey or Adafruit libraries. Therefore, I had to make a custom footprint in order to create the pads in order to solder the part to the board (SW15).

3D Render of the Front of the PCB

3D Render of the Front of the PCB

3D Render of the Back of the PCB

3D Render of the Back of the PCB

Ordering PCBs

After checking my design for any mistakes, I uploaded the KiCAD file to OSHPark and placed an order for 3 PCBs.

Order confirmation from OSHPark

Order confirmation from OSHPark

The schematic and PCB files can be found on the GitHub page for this project.