Sunday, June 29, 2014

File Under: Lessons Learned the Hard Way

Wowzers.  3 posts in one day, 4 in two... you know the shnizzit must be gettins realziz.

Everything was working just swell shortly after the last post - I soldered some wires for the speaker to the perfboard, and hand-twisted these around the wires attached to the dartboard's speaker. I screwed the perfboard to the mounts in the frame, connected the USB and ran my enhanced python test app (will upload to git shortly and link here, for all you monster fan boys out there).  It was working perfectly - the speaker spake, the hits were registering flawlessly, the LEDs were LEDing all over the place like the mad beasts that they are.

And then...

I untwisted the speaker wires and attempted to solder the ones from the perfboard to the speaker itself.  I think the existing speaker wires were attached with silver play-doh - or at least that's how it acted.  It sloshed around like some pseudo-plasmatic vomit and only succeeded in frustrating your humble narrator.  It was at this point that it was me against the speaker... mano y speako... except mano ceased to consider the hot soldering iron in his hand to be of primary importance.

Eventually, the wires were attached to the speaker with some fresh, solderesque solder and victory was declared once more.

And then...

The dartboard was again connected to the laptop and the tests were run again and tests began to fail.  Notably, the speaker didn't work. "C'mon!  Really!  Really? After all that?!" are words that approximate the feelings.  The triple ring, double ring and single wedges appeared to work from some quick tests - tests that were assumed to work since nothing really changed except for the speaker wires... but when I tried to hit a double bull to quit my testing...

(nothing)

Single bull - fine.
Double bull - nothing.
All numbers except 9 and 14 - fine.
9 and 14 - nothing.
Double bull, 9 and 14 all happen to share the same wire... row 3 in the matrix (in the code)... pin 1 of the first 595 shift register... pin "11" (first pin of the second row) of the 20-pin ribbon connector... nothing.

I resoldered pin 1 at the first 595. I resoldered pin 11 at the ribbon connector.  I checked continuity.  Everything appeared to be adequate.  But my blurry eyes noticed, as I flipped the plastic sheets over to try another retest, that there was a cookie monster bite out of one of the plastic layers.  Closer examination revealed that it was probably melted by a soldering iron and that it took a complete chunk out of only the outer most conductive trace on that side.  Following the broken trace back to the ribbon and 20-pin connector, it led to the 11th pin... following it the other way, it led to 9/14/double bull.

"C'mon!  Really!  Really? After all that?! REALLY?!?! AFTER ALL THAT?!?!" ... or something like that.

I tried to bridge the gap with electrical tape and a small piece of wire, but it would not budge a metric inch.  My thoughts once again started to frantically consider other hobbies.  Scrapbooking sounds, well, completely awful (to me --  I'm sure it's spiritually, intellectually and artistically fulfilling for tons of people, but my fraction of a ton simply does not contribute to that total).

Then I remembered that I have an electronic dartboard on deck, and yet another in the hole.  The first was within arms reach during this crisis, so I quickly had the back cover removed and the wires violently separated from the dartboard factory's obviously inferior brainboard.

My perfboard would not even come close to fitting in this new frame, but the sheets looked like a match - they actually look a little better-made.  The patterns on both sides are essentially the same, but the layout looks a little better, nicer, cleaner, safer... can't explain it very well at the moment, but I'll take a polaroid of it and post it so you can see what I mean.

The ribbon connector is also essentially the same, but instead of one 20-pin connector, there are 2 ten pin connectors...10 wires on one side and 7 on the other - same deal.  I desoldered these chumps, easily needle-nosed away the glue that tried to hold them down more permanently, and this factory board was tossed on the bones of the other one.

When my gumption levels are sufficient, I will desolder the old ribbon connector from my circuit and solder in the new guy.  I might use the new dartboard's speaker as well, if it accepts my solder more readily than the other bastard.

Yeah.  A lesson was learned today.  If the project frustrates you, put down the soldering iron and step away from the electronics.  Count to 10 in a numbering system other than base 10, preferably octal and then hexadecimal... and then nobody gets hurt -- not you, not your self esteem, not your project.  And, nobody gets forced into scrapbooking.

V

Pulled out the old multimeter and tested the 18/19 connection and the red LED connection for continuity.

The ground wire from the red LED to the yellow LED was no longer attached at the yellow LED, meaning the red LED was not grounded.  So I soldered it back... the wire is a little too short, so this might happen again... these ground wires were pretty much the first connections I soldered, so it is no surprise that I screwed one of them up.

No problems with the path from the shift register to the ribbon connector for the 18/19 wedges, so I just heated up the joint and added an itty bit of solder.

Plugged the sucker back in and both the light and the 18/19 wedges worked.  Ran through a successful test of all wedges (just the single, not bull or double/triple, so i could be in for an unpleasant surprise later).

Everything appears to be working correctly, so I will just connect the speaker wires and screw the perfboard into place.  Methinks I will re-drill a few of the mounting holes since I had to bend the board a little to fit on the mounting posts and I cannot imagine bending it is helpful to the quality soldering job.

Another worry is the ribbon connector looks to be connected a little too close to the dart board, cause it is sort of looping up and may create a situation with the ribbon, the near-edge of the contact sheets and/or the cover -- in other words, there is a little too much slack in the ribbon so it protrudes up too high and to flatten it out results in the contact sheet lifting up from the plastic wedges a little.  We'll just have to wait and see what happens here, it may just work itself out and be happy,

Anyway, the gist is, yeah, victory, yay team.  I know it works and if it doesn't stand up to the abuse for which it is destined, I only have to repair and tweak.

Fixing A Hole Where The Rain Gets In And Stops My Mind From Wandering, Where It Will Go

Did some testing and troubleshooting and fixing today.  The results are encouraging.

I updated my sketch to output the row and column when a hit is detected, and I found out a few interesting things about the issues I reported to myself yesterday.

Firstly, only the red "Server Connection" LED is not working.  The yellow and green light up as instructed when a connection is established.

Secondly, all the number wedges were registering hits today, only the second half of the triple ring was not.

So I charted out all the row/column pairs for each hit combination and updated my matrices in the sketch to match.  A retest found that all hits were registering correctly, except: the second triple ring remains silent and the 18/19 pair stopped registering.

Glancing at the perfboard and ribbon connector, I quickly found the problem with the triple ring... the 7 outputs from the dartboard start on the second pin.  I connected the shift register to pins 1-7 when I should have connected them to pins 2-8.  An easy fix, I will just solder in another small wire connecting pin 1 to pin 8... this also explains why the single/double/triple/bull portion of the matrix was off by 1 in every case. Doh!

The 18/19 pair of wedges may be a precarious solder.  It is the first pin in the second row of the ribbon connectors, and I was flipping the perfboard over and back to inspect the connections, so it is possible that I have been disturbing this joint in the process.  I will de- and resolder this connection, and inspect the other end of the connection at the shift register to see if that may be where the problem actually lies.  I can imagine some of these connections breaking when the board is actively pummeled by darts, so I will be sure to generate the proper documentation that details what shift register pins goes to which dartboard ribbon pin, and what row/column and point/multiplier these match -- if one stops registering, I will be able to find the solder joints quickly and easily.

Finally, I will test the connections to the red server connectivity LED and test the LED itself to see why it is not functioning properly.  To be honest, I will consider this project a success even if this one LED doesn't work, so put that in your pipe and don't smoke it because smoking is a health risk.

On another front, I downloaded some free circuit board design cad software and created the dartboard circuit.  It is a mess.  I need to seriously reconsider the layout to optimize the traces because there is so much crossover in this layout.  The circuit has some layout restrictions due to the location of the LEDs, the location of the ribbon connector and to some extent the orientation of the boarduino.  Unfortunately the software I am using does not appear to have an option to automatically route the copper or optimize the layout.  Also unfortunate is that the other free software that does have this option also has restrictions on the board size -which my circuit exceeds.

I will keep looking for other softwares and maybe try to defeat the limitations by trying to export from one into another.  Fear ye not, I will surely keep all of you updated on this topic, so there is no need to flood the comments section nor my inbox with all of your complaints.  Gee whiz.

Saturday, June 28, 2014

Moment of Truth; Drum Roll, Please; It's...

This story is longer than it should be, but... well, there is no "but."

Finished all the soldering, finally.  left the ribbon connector for last and thought it would be much more difficult than it was.  the soldering was probably not the best in some places, but it is done.

So I had low expectations when I plugged the USB cable into the duino and then into the laptop.  The red LED signifying a USB connection lit up on the duino, but Windows wouldn't recognize it.  I fiddled with a few whatnots and whatevers with no luck. I was convinced that I had a fatal short that fried the processor and was mentally preparing myself to find a new hobby.

I reinstalled the Arduino IDE and drivers and tried plugging in again, this time both of my yellow LEDs lit up for a minute or so, then all of my LEDs turned on and off somewhat randomly before staying off.

I should mention that between my original breadboard prototype and this perfboard version, some of the pins were changed, so I had to change around the code to account for this.  But when I plugged in, the duino was still running the old code, which probably explains the LED madness.

I uploaded the latest sketch and fired up the serial monitor in the IDE.  The "play state" LED set had red lit up but the "Server connection" LEDs were all off.

I typed "C" into the serial monitor, and the dartboard echoed "C" back, yet no LED action. "Q" got an "X" response.  A good sign that the duino wasn't fried and serial communication was functioning.  "P" got an echoed "P" and the play state LEDs went to yellow and then to green, a very good sign. Another "Q" inquiry prompted a "P" response.  Splendid, but now the big test... The Board!

A few random presses on the board resulted in serveral "H"s hollering back from the board to the serial monitor.  This revealed the second issue: the"H"s should have been followed by the point value and multiplier of the wedge being pressed. Soon I identified two more issues: one of the two halves of the triple ring was not registering, nor was one pair of numbers.  Other than that, everything else seems to work!

I consider this a victory.  I have a few relatively minor things to track down... The missing points and multipliers are likely a software bug introduced when the pins were switched around...probably the same with the second set of LEDs, since at least some of them were working to some extent under the original code.  Fixing this may also fix one of the other board hit problems.  I suspect a bad solder may be the cause of one of these things, but this should not be very difficult to track down and fix.  Oh, and I just need to wire up the speaker, but that's hardly a big deal.

It's pretty hard to believe that in a few days this thing could be hanging on the wall and all I have left is the game software (which will probably never be"done")...and not quite the end of June
- almost, but not quite.