< back

Week 8: Output Devices

Buttons, Boston, Bluetooth & More

November 12, 2015


After a bit of a breather due to Veteran's Day, and the craziness of Member's Week finally subsiding, I was feeling excited to try out a few new ideas, and hopefully delve into some of the networking technologies we learned about a few weeks ago. I wanted to put together two mini projects for this week:

  1. Use Charlieplexing to design an LED array in the shape of the Boston T map (or at least some portion of it...red, green and blue lines?). I thought Charlieplexing looked really cool and I also love the design aesthetic of subway maps, so this seemed like a good way to combine the two.
  2. A capacitive touch sensor that controls a small motor or servo. The readings from the touch sensor will be communicated to the motor using Bluetooth. I realize this project is a bit ambitious in that it combines three new ideas, but they are all things I want to learn about so I figured I'd give it a go. I'm hoping to use some sort of capacitive touch sensing for my final project, so this seemed like good practice. Given my experiences with other project cycles, I will be sure to include a number of LEDs on each board for debugging purposes.

Before I designed anything, I wanted to familiarize myself more with the technologies/ techniques I planned to use. Here is some information (hopefully at a HTMAA-appropriate level) about some of these technologies:

Charlieplexing:

Capacitive Touch Sensing:



Bluetooth:

Motors (Types, Operation, etc):

After all of this investigation, I thought I would jump in by trying to design a board with a charlieplexed LED array output in the shape of the Boston T map. This seemed a little easier since it only involved one board, and I could modify Neil's design. I thought I'd use 6 pins so that I could have 6*6 - 6 = 30 LEDs, 10 for each the Red line, Green line, and Blue line.

As usual, designing the board took way, way longer than anticipated. I should have realized this, but I do think it's easy to delude yourself about the amount of work required when you're really excited about a project. I designed the schematic and board in Eagle, using some of the tips and tricks I'd picked up in Week 5. I was more comfortable with the basic mechanics of using Eagle, but laying out all the LEDs for the Charlieplexed LED array took a very long time, since there are a lot of traces to route and I wanted to have the LEDs in a particular pattern. I ended up having to use about 10 jumper resistors to be able to route everything the way I wanted. I'm not sure there's any way around this, short of using a two-layer board or exactly following one of the established Charlieplexing layouts. In any case, I finally got a board design I was happy with. There were a few clearance issues when I had a jumper trying to cross two traces, but I plan to check for those after milling and make manual corrections if needed.

Next up: milling and stuffing the board. As usual, this did not go as smoothly as anticipated. I'd heard that the Modelas were having some trouble, so I milled a few test boards before starting my (giant) board. These test boards, pictured below, had a ton of burrs and the cuts were really deep. Acceptable, but pretty ugly. Will came to help me troubleshoot the Modela, and thought that there was a spindle problem (I believe he has since replaced the spindle/ fixed the problem). In lieu of using the MRX-20, he taught Andrew and I how to use the SRM-20 (another milling machine which is in the same machine shop as the ShopBot). The procedure is roughly the same, except that you need to set the permissions manually (type "sudo chmod 777 /dev/usb/lp0" in a terminal) and the zeroing process for the z axis is slightly different. You get the endmill close to the stock using the z0 parameter in fab modules (instead of using a button on the board), and then lower it manually. You also need to "trick" the machine into thinking it's closed by placing a pin in the door sensor in the upper right hand corner. This allows you to make the manual zeroing adjustment and still allows the machine to receive signals. I used all the default settings, except for cut depth. I set cut depth to .13mm because we noticed that the bed was uneven and the cuts weren't deep enough on one side.


The board took almost 1.5 hours to mill, but when it was finished, it came out beautifully. Next, I very, very carefully and painstakingly stuffed the board. Even though I've gotten a lot better at stuffing boards, it took me ~2.5 hours because I wanted to be sure that I wasn't shorting anything and that all my LEDs were oriented correctly. I also needed to be extra careful about soldering my jumper resistors. For each LED, I needed to check its orientation against my board design to make sure the anode and cathode were connected to the correct pin. Though it took a long time and required great attention to detail, my only real trouble during this phase was tracking down the correct LEDs...the basement shop was out of red and blue LEDs. I was able to find a few red LEDs, and ended up using "blueish white" LEDs for the blue line.

I programmed the board using the command line toolchain discussed in Week 7. I downloaded Neil's Charlieplexing code and modified it to add another pin and change the order in which the LEDs are flashed. After connecting everything up, I used the following commands to program the board:

Lo and behold...after programming the board, it works!! This is a happy moment. I played around with a few different light speeds, but preferred just having the lights change at one slowish, steady speed. I noticed that two of my "red" LEDs are actually green. If I'm able to track down some more red ones, I'll swap them out tomorrow. Otherwise, I'm just really happy this works!


I unfortunately ran out of time and wasn't able to work on the Bluetooth/ capacitive touch/ servo project. However, I think I laid good groundwork for that project this week, and will hopefully be able to work on it more next week (it could work as my Input Devices project because it involves capacitive touch sensing!)

Update 11/24/2015: I switched out 12 LEDs so that the red line was completely red and the blue line was actually blue. Happily, the board still works great after making these switches...


Design Files & Code