Tuesday, May 26, 2015

Week Nine

This week, we have four main goals: to complete soldering of the keyboard, to test the keyboard with the written code, to finalize the acrylic board structure, and to prepare the final report and the final presentation.

We are having soldering iron consistency problems. #LifeOfAnEngineer
The soldering for the key matrix is complete as of 9:15 Tuesday night.
PSA, hot things are hot.
There was minimal plastic melting and finger burns. Testing of the keyboard code will begin on Wednesday evening.

As of the beginning of Wednesday evening work sesh, Gabrielle feels like a drenched cat, but her jacket seems to have saved the electronics.


So as expected, the keyboard had some technical difficulties in the functionality department. So, we ran through some tests.

1) Try various codes to see if it was just that code. Result: No me gusta.
2) Test the old test matrix to ensure 3 by 2 code does actually work. Result: Success!
3) Once again try test code on full keyboard. Result: No luck.
4) Try column 1 (pin 0) as a choice in the test code. Result: Huzzah
5) Move ground to opposite side of matrix. Result: Tears
6) Wire ground directly to diode. Result: Can we not?
7) Realize coded for not used pin 14 in test 5 and change to pin 13 (column 14). Result: Progress!
8) Switch direction of diode from test 6. Result: Now we're getting somewhere.
9) Wire 1 ground to two changed direction diodes. Result: Booyah.
10) Wire entire row 5. Result: I could cry tears of happiness at this point.

Okay, so we finished the rewiring of all of the rows and then on Thursday tested the keyboard and found it was kind of functional. In the effort to make it fully functional, however, the Arduino decided to conduct an attack on Gabrielle's laptop - rendering it useless twice. First, it rewrote the keyboard so that the only keys were Ctrl and Alt, however they weren't even located in the correct position. The second time, the mouse and cursor were affected. The computer had to be reset twice, and we decided to stop at our mostly functional code until another day. Mercedes continued to work on the poster and final presentation, while Gabrielle chose to forge ahead on wiring the LED matrix. Hopefully the computer and Arduino will negotiate a peace treaty by tomorrow evening.

On Friday, the Arduino code was updated to a complete state (though still without the capacitive sensing at the moment), ready for testing when soldering is complete. Work continued on the LED matrix, and all but the bottom row was completed. The back of the keyboard is beginning to look much like a bird's nest, with many sets of wires. The poster, presentation, and report were updated as much as possible at the present time.

We ran the integrated code, and we experienced some of the same issues with keys - a few did not work, and some printed continuously when only pressed once. The LEDs of the keys that printed continuously also turned on at strange times, and were among the few LEDs that responded. More work is planned for Saturday to fix the switch and LED problems, primarily from the wiring perspective.

So Saturday, let me tell you about Saturday. The keys weren't working, right? Well we decided to try taping the continuity keys up so that they wouldn't have shorts, thinking shorts were the problem. It didn't work. But that was okay. We were going to try to completely resolder those columns. Gabrielle managed to desolder a single column, and was testing it to make sure the keys didn't work, you know, so it wouldn't be a code issue. Meanwhile Mercedes and Amy were placing the letter stickers on the key caps. But then the fire alarm went off. The team has moved to Bossone and  will pick up where they left off.

Completed Back of Keyboard
In Bossone, the second to last column was completely unsoldered and resoldered. The continuity problem was still an issue. Amy and Gabrielle decided to test the matrix and full keyboard codes without LEDs once again. It was learned that it was not a hardware problem, but in fact something wrong with the code. The keys were completely resoldered and taped up to be able to test.  Gabrielle meanwhile rewrote the integrated code, without an off switch for the LEDs. When this had been finished, it was decided to take a break from problem solving, and we'd extend the support switch holes for the space bar, which were improperly cut. During this process, the acrylic board cracked right down the middle. Gabrielle hot glued it together and the cutting of holes continued. The team members bemoaned not having a file to speed up the process.

After two hours of hacking, sawing, scraping, and complaining, the space bar and its three switches fit into their slots. This process was just for the purpose of being able to put key caps on. We had to then wire the bottom row LEDs in order to finally get to putting on the key caps. After this happened, Amy realized we needed to wire the capacitive sensing prior to adding the key caps. While she began on that, Mercedes and Gabrielle finished up placing the key and LED wires in the Arduino Due and are now going to test the keyboard again. However, we realized we had planned to cry if enlarging the holes took more than hour. We have not had time to cry yet. Crying has been postponed until 10pm.

Final update of the day at almost 11:00 PM: much progress has been made. Most of the keys typed once the wires were placed in the correct pins on the Arduino. The "s" key did not work, but after replacing all its components, it worked; all keys work, although modifier keys must be pressed and released before pressing the second required key in sequence. In addition, the | does not print due to the use of an ASCII code for backslash.

The next focus was making the LED matrix work. A test matrix was used to diagnose, and the row and column functions were switched slightly while lighting up the LEDs, a similar method to what was done for the keyswitch matrix. Then, once the correct LEDs lit up, a reset function was finalized to turn those LEDs off. The function millis was used as a timer; all LEDs will turn off every second. THIS WORKED! SUCCESS! One major LED issue is left: the spacebar central LED seemed to have a short and needed to be examined. Tomorrow the focus will be capacitive sensing. The crying session was not held and is yet to be rescheduled.

A video blog of our progress can be seen below.


Sunday we started off with the capacitive sensing. At first we attempted to hot glue the resistor leads to the conductive trails on the key to find that the glue would insulate between the lead and the conductive trail. Next we tried to use the conductive paint itself to attach the leads; this could have worked given enough time and hands but proved impractical for today. In the end we decided to use hot glue to attach the resistors and use the resistor leads themselves as the sensors, abandoning the conductive paint entirely. The wires for the capacitive sensors were twisted, labelled, and run underneath key caps on top of the keyboard. 

The test code for the capacitive sensing seemed encouraging at first but soon proved challenging. Initially the arbitrary values for touched and not touched were predictable ergo the capacitive sensing code was integrated into the main code. Upon testing this the capacitive sensors started dropping like flies; variations of wiring and code were tested to no avail. In the end it was decided to only have the semicolon key active a capacitive sensor in the code as it was the most reliable throughout the whole ordeal. The rest of the capacitive sensing wires were trimmed and tucked as appropriate. 

Update: The capacitive sensing code started causing all kinds of other bugs so it was removed entirely. The keyboard has since been entirely assembled and the group crying session was canceled in favor of a group sigh due to time constraints. PSA: hot things are still hot.




No comments:

Post a Comment