Tuesday, July 8, 2014

Re-V

Just a quick note to myself to say that I re-completed the hardware... transplanted the contact sheet from another board without major incidents.  I really fried the perfboard where the 20-pin ribbon connector attached...through desoldering the old and resoldering the new.... and I broke the ends of a couple wires from the shift registers bending them into place, switching a couple of the wires in the process... but a quick edit to the duino sketch put everything back in order.

Another "doh!" here.... I had no experience with these ribbon connectors, so I was afraid to mess with them too much.  After I desoldered the old one from my perfboard circuit and while moving the new one from the other board, I realized that the ribbons slide in and out of the connectors quite easily. The big DOH! was that I could have simple left the 20-pin connector from the other board and just switched out the ribbons much more quickly, easily and without the heightened danger of screwing up what was working.

Despite that big miss, I removed the ribbons while I was soldering the connector to the board, so I wouldn't melt the new contact sheets in the process.  I also applied a little hot glue to the connector to hold it in place while upside down when soldering, which made it easier and may have been necessary since I desoldered most of the solder pads along with the solder, so I couldn't really solder the pins securely in place by solder alone.

Oh, almost forgot... I also used the speaker from the new board, which is much smaller than the other.  Instead of soldering the connecting wires, I twisted and taped them.  I also taped the speaker itself into the cavity since it is too small to be held into place by the screws for the factory speaker.

Whatever I did and however I did it, it worked well enough - at least for now.  The board passed regression testing with my serial test python script and then passed some spot-checked dart hits after closing everything up in the case.

I put some black electrical tape around the button holes out of which the LEDs emerge.  This looks a little cleaner and hopefully will protect the perf board from some dust and maybe any stray darts --- although I'd like to find something else to cover the LEDs for dart protection.  I also printed some small labels for the LEDs and a big label for the big window in the middle.  I might revisit these for aesthetic reasons -- I was happy just to get them almost lined up on the label sheets using Open Office Writer.

I hung the thing on my wall with a couple screws and started another test python script using some pygame menu code I found.  I checked it all in to git and am updating the pi as I type so I will port it over and take it for a test run.  Maybe I'll try to make a vid and start a dumb you tube channel as a companion to my dumb blog.

I have some more pics to post here and I still need to update the circuit diagrams to reflect the current circuit and duino sketch.  But, hey, I REALLY finished the hardware... something I wasn't sure I could pull off.  I know I can handle the software, so "Woo Hoo."

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.

Sunday, May 4, 2014

Step by Step (NKOTB)

Slowly and painfully,  but forward I go. Frustration smothers experience, yet close,  I am close. 9 points torn in space and time, lacking what they lacked.  A white hot iron, silver, molten blood. One step from, from done. Ugly blobs, globs, lobbed and flawed. Yet continuity continues, no short, possible it might work. Step by step.

Sunday, April 13, 2014

Back on Track

Finally was able to sit down and solder for a little bit yesterday.

Completed all connections from the 589 parallel outs to pull down resistors, from the 589 serial out to 'duino, grounds, voltage and control lines from 'duino to 589.

Remaining work:

  • control lines from duino to 595 set
  • ground from 595 set to duino
  • voltage from duino to 595 set
  • line from duino to speaker resistor
  • ground second set of LEDs to duino
  • and probably should expose some convenient pins to attach the speaker wires

Wow.  All of the sudden, the workload looks reasonable and testing is in sight.  I only have 2 months left to finish on schedule.

I am still not very confident in my soldering and hope testing isn't overwhelmingly painful, requiring a bunch of resoldered joints.  I am afraid that a few dart hits will cause some of the joints to fail.

I am really liking the idea of a printed board if there is a v2.

Sunday, April 6, 2014

Perf Board Diagrams

The diagram I made last night is very cluttered, so I broke it out into a series of specific diagrams that are easier to follow:
The full rats nest

Parts:
  • 2 x 74HC595 Serial-Parallel Shift Register
  • 1 x 74HC589 Parallel-Serial Shift Register
  • 6 x 5mm LED 
    • 2 x red
    • 2 x yellow
    • 2 x green
  • 15 x Resistor
    • 1 x 100 Ohm
    • 6 x 220 Ohm
    • 8 x 10 k-Ohm
  • 1 x Arduino
  • 1 x Electonic Dartboard
    • 1 x 20 pin Ribbon Connector in 2 rows of 10
    • 1 x Small Piezo Speaker


Here is the Shopping List exported from Fritzing:
AmountPart TypeProperties
1Piezo Speaker
1Generic shrouded header - 20 pinspackage THT; hole size 1.0mm,0.508mm; row double; form ♂ (shrouded male); pins 20; pin spacing 0.1in (2.54mm)
2Green LED - 5mmpackage 5 mm [THT]; leg yes; color Green (555nm)
2Yellow LED - 5mmpackage 5 mm [THT]; leg yes; color Yellow (595nm)
2Red LED - 5mmpackage 5 mm [THT]; leg yes; color Red (633nm)
1Arduino Micro (Rev3)type Arduino Micro (Rev3)
1100 Ω Resistorpackage THT; tolerance ±5%; bands 4; resistance 100Ω; pin spacing 400 mil
810k Ω Resistorpackage THT; tolerance ±5%; bands 4; resistance 10kΩ; pin spacing 400 mil
6220 Ω Resistorpackage THT; tolerance ±5%; bands 4; resistance 220Ω; pin spacing 400 mil
174HC589package DIP16 [THT]; type 74HC595; variant variant 1
274HC595package DIP16 [THT]; type 74HC595




Voltage (red) and Ground (black)

ColorComponentConnectionPinComponentConnectionPin
Red'duino5v5v>74HC589vcc16
>74HC595-1Master Reset10
>vcc16
>74HC595-2Master Reset10
>vcc16
Black'duinogndgnd>74HC589gnd8
>Output Enable10
>74HC595-1gnd8
>Output Enable13
>74HC595-2gnd8
>Output Enable13
>LED (x6)Cathode-
>Piezo SpeakerNegative Terminal-
>10k-Ohm Resistor (x8)
[pull-down]



Shift Register Control:
Shift Clock (blue), Latch Clock (yellow) and Parallel Load (white)

ColorComponentConnectionPinComponentConnectionPin
Blue'duinodigital 5d5>74HC589Shift Clock11

digital 10d10>74HC595-1Shift Clock11

>74HC595-2Shift Clock11
Yellow'duinodigital 6d6>74HC589Latch Clock12
digital 11d11>74HC595-1Latch Clock12
>74HC595-2Latch Clock12
White'duinodigital 4d4>74HC589Parallel Load13

Serial to Parallel - 'duino to Dartboard:
Serial In from 'duino (orange), Serial Daisy Chain (green), Parallel Out to Dartboard (purple)

ColorComponentConnectionPinComponentConnectionPin
Orange'duinodigital 9d9>74HC595-1Serial In14
Green74HC595-1Serial Out9>74HC595-2Serial In14
Purple74HC595-1Parallel Data Out15, 1-7>DartBoardRow 1: 1-81-8

74HC595-2Parallel Data Out6-7>DartBoardRow 1: 9-109-10
Parallel to Serial - Dartboard to 'duino:
Parallel In from Dartboard (brown), Serial Out to 'duino (orange)


ColorComponentConnectionPinComponentConnectionPin
Orange'duinodigital 7d7>74HC589Serial Out9
Brown74HC589Parallel Data In1-7>DartBoardRow 2: 1-71-7


Parallel Data In15, 1-7>10k-Ohm Resistor (x8)
[pull-down]

LEDs and Speaker:
Parallel Out to LED (rgb), 'duino to Piezo Speaker (pink)

ColorComponentConnectionPinComponentConnectionPin
RGB74HC595-2Parallel Data Out15, 1-5>220 Ohm Resistor (x6)

Pink'duinodigital 8d8>100 Ohm Resistor

Silver220 Ohm Resistor (x6)
>LED (x6)Anode+
100 Ohm Resistor>Piezo SpeakerPositive Terminal+



Follower Hoax and Winter Sucks

OK, I think the whole follower thing was a hoax.  Probably someone hired to try to keep bloggers posting or something.  whew!  Things are going to be a lot easier now that nobody is watching again.

I was going to get a lot done over the winter, but winter sucks.  No motivation.  Winter's still trying to linger, but spring is squeezing in enough to matter. So I got a little inspired tonight.

Downloaded the latest version of Fritzing and whipped up an "accurate" perf board diagram:

Well, the "no motivation" thing wasn't entirely true.  I did spend a little time messing with Pygame and OpenGL, 'cause when you are making progress on a project and need to focus on its tasks to make the project a success, it's always a good idea to start more projects.

Sigh.  I'll probably end up posting about the "new" game projects.

Me out.

Monday, February 17, 2014

Still Breathing

So, I'm still here and still of the opinion that I will finish this thing by the end of the summer.

I have done a little bit of work on the game engine over the past month, so will have to check my code into git for posterity.  I am still risking over-engineering the game engine, but we'll just have to wait and see... it might be worthwhile.

I forget just about everything I learned about the circuit and the arduino and the shift registers... and this thing that looks like the pictures in the last post is sitting on my desk, waiting for me to solder some more wires from some parts to some other parts.  Without this blog, it would be very difficult to know what goes where, sooooo, yay blog.

There were actually several page hits last month.... curious why people are looking at this gibberish and if any of it has ever been useful to anyone else.   Hmmm.

Maybe next post I'll have some of the python code checked in and some more soldering done... next soldering session I'd like to finish all the connections to and from the duino.

Trying not to let this project die...'cause I'm not letting myself build a theremin until I get this to work, and you know how much I want to build a theremin.