THIS BLOG HAS MOVED. PLEASE UPDATE ANY BOOKMARKS TO GO DIRECTLY TO WWW.RAISINGGEEKS.COM
Showing posts with label WaveShield. Show all posts
Showing posts with label WaveShield. Show all posts

Sunday, August 15, 2010

August 15th: Hockey Season!

My good friend Luis is a bit of a Hockey nut. He not only watches hockey (He's a Rangers fan...), he pre-plays the games for the Rangers on his xbox with his brother. He also has an "original 6" table hockey game with a custom cover made by his family.

I don't think that is the exact model, but you get the idea :)

A few years ago, I was scrapping an old air hockey table and Luis took  the scoring system and modified his table hockey game to use the scoring mechanism.

He cut out the goal area so the puck could go down into custom lexan fixtures that hold the air hockey table scoring switches.




These velcro to the bottom of the table hockey game. They are removable so the table can be transported and still lay flat.

Last year when I got into messing with arduinos, we were kicking around the idea of making a custom scoreboard for the table that would use the Adafruit WaveShield to play hockey arena sounds & music.

At the time I wrote out some basic plans, but focused on finishing my son's "control panel" and finishing my MBA.

A month or so ago, I found the NCR VFDs at Skycraft and this triggered the scoreboard idea again. I made a shopping list for Luis, he ordered the parts and off we went.

The project has come together quickly. We had an afternoon where we soldered up the WaveShield and modded his VFD for TTL serial. I have worked on the code a few hours here & there, and Luis has been working on getting the components mounted. Since I didn't have my shiny new welder this week (thanks UPS - once again you screw with my happiness!) I decided to really get moving on this project. I wrote most of the code logic yesterday and today we got the prototype case finished up. 


Here is the VFD mounted in the case. We had a little mix-up on the VFD dimensions, so the prototype has a little extra view of the VFD :)



Side view showing the lighted power button and power jack




A shot of the inside wiring - Arduino and WaveShield on the bottom right, VFD is the big board, buttons up top. We've since added an RJ45 "magic jack" with a SparkFun breakout board at the bottom. It will be the connection to the table switches and LEDs. The green wire coming up the middle of the VFD board is the TTL mod. 



  

.  So, how will this thing look in action?? Here it is next to the table. The wires on the side of the table are where the scoring / intermission LEDs will be placed.



And more action shots...


Intro screen...music will be playing...


Select the home team. The middle button is "next" and the right button is "ok" in this mode.




We are making the periods 20 mins like "real" hockey, but then making the clock run down faster. Not sure it will stay this way, but makes life much easier for testing because I can set the scale at a crazy high number and get periods that are a few seconds long :)


In game shot... (scoring switches not connected yet...) During the game, the right button is "play / pause". After a goal, the timer automatically pauses and then a button is hit to resume gameplay (after a short timer to allow the person hitting the button to "ready" themselves...)



I'm really excited to get the sound / music code integrated and get this thing connected to the table. I might even have to learn how to play!

Sunday, January 24, 2010

All Hardware Functional!













The Joystick has sound effects (Star Wars & Star Trek sound files on the Waveshield) mapped to the directional axis and some of the buttons. The red button with the flip up cover fires the thrusters (same functionality as the big green button in prior versions) which increases engine temp (as seen on the Engine Degrees gauge) and will cause an overheat alarm if it the temp goes too high.

The Apache Helicopter Data Entry Keyboard now works...the bottom line is for data entry. You get a blinking underline cursor, and the keyboard supports numbers and letters, backspace and enter.

In the future, I'll make it a functional navigation system between Star Wars planets. For now, a little imagination is needed. The three new buttons next to the display are wired, but not mapped to any functionality. I was thinking they would be to select options, with the two black being up & down and the red being enter. Now that the data entry keyboard is functional, I'm not sure what they will be for - but they will find a use!






I seriously underestimated how much wire would be coming into this box. There is a Cat5 cable from the Joystick, two from the Data Entry Keyboard, one from the Left Panel, one from the Center Panel, one from the lid buttons and one from the Liquid crystal. Making the final connections on the Arduino Mega was quite challenging...a much larger box and a Mega screw shield would be much easier...





I also built a 6 volt regulator for the Arduino, which kept all the 12v wiring out of the box. All 12v wiring for the button lamps, siren, and strobe is hidden behind the removable panels.

For the Arduino folks in the crowd...check out this list of pin declarations...I think I used EVERY digital I/O pin on the MEGA - I still have some PWM outputs and some analog inputs remaining...


//WaveShield Pins
//....................2
//....................3
//....................4
//....................5


//analog outputs on PWM pins
#define GAUGE_ED      8
#define GAUGE_LR      9


//Analog Inputs
#define SWITCH_KEYPAD 0
#define JOY_UD_POT    8  //WHITE-BLUE
#define JOY_LR_POT    9  //WHITE-GREEN


//DO NOT USE - Reserved for future I2C or interrputs
//
//....................20
//....................21


//digital inputs
#define BUTTON_RED    22 //WHITE-BROWN
#define BUTTON_YELLOW 24 //GREEN
#define BUTTON_GREEN  26 //WHITE-GREEN
#define BUTTON_UP     28 //WHITE-BROWN
#define BUTTON_DOWN   30 //BLUE
#define BUTTON_ENTER  32 //WHITE-BLUE




//digital outputs
#define LAMP_RED      23 //ORANGE
#define LAMP_YELLOW   25 //WHITE-ORANGE
#define LAMP_GREEN    27 //BLUE


#define SIREN         29 //BROWN
#define STROBE        31 //WHITE-BLUE




//Keypad Col Pins
//....................34 //WHITE-ORANGE
//....................36 //ORANGE
//....................38 //WHITE-GREEN


//Keypad Row Pins
//....................33 //WHITE-BROWN
//....................35 //BROWN
//....................37 //WHITE-BLUE
//....................39 //GREEN
//....................41 //BLUE


//shift.in from joystick
#define SHIFT_CLOCK   40  //ORANGE
#define SHIFT_LATCH   42  //GREEN
#define SHIFT_DATA    43  //BLUE


//LCD pins
//....................44
//....................45
//....................46
//....................47
//....................48
//....................49




//WaveShield SPI pins
//....................50
//....................51
//....................52
//....................53









Sunday, January 17, 2010

WaveShield

The WaveShield arrived from AdaFruit and I promptly assembled it. It was an easy assembly, especially since I've been getting lots of soldering practice.

I had some trouble getting it working, but it wasn't my soldering, it was the SD Card that I scrounged out of my desk. It was a minisd card out of an old cell phone, but apparently minisd and microsd aren't required to implement the electrical interface used by the WaveShield. One I stole a microsd out of an older camera, everything worked great.

My son wanted his Control Panel to make sounds like the ships in Star Wars Clone Wars. I got some major amazement looks when I showed him how I could rip sound off a DVD. We picked a few and I made them play with button presses on the Lab breadboard setup.

I'd already read that the WaveShield needs to be modified to run with the Arduino Mega, so I quickly set out to make that modification. The modifications are simple and documented here.

I received the WaveShield with a broken audio volume pot I didn't realize it until it was installed and I tried to use it. I emailed AdaFruit that night - They replied quickly and immediately put another one in the mail. It was a big of work to remove / resolder, but an easy fix overall.