Tuesday, November 25, 2014

Arduino-Powered Going Away Gift

    Recently, one of my coworkers departed the office.  He's one of those folks who rails against the Arduino -- in his opinion, Arduinos are overkill for almost everything, people just need to get back to op amps and 555 timers, dag nabit!  So of course when we learned he was leaving, the entire office agreed -- his going away gift had to include an Arduino and it had to be used in a way that seemed like as much overkill as is humanly possible.  Given that the normal going away gift for our office is a challenge coin, here's what I came up with:

Challenge coin replaced with silver dollar in this photo.

Its a challenge coin with a blinking light.   Flip the coin over and...

Behold the power of the Arduino Micro!

…an Arduino Micro!  At first glance, it's all of the majesty of an Arduino used, essentially, to alternate the voltage value on a pin between high and low, switching an LED on and off.  Of course, I couldn't let all of that horsepower go to waste, so read on to find out what easter eggs I managed to cram under the hood.

Sunday, November 2, 2014

Arduino Controlled Halloween Light/Sound/Smoke Effects

    As mentioned in the previous post, I had been working on some Halloween effects with the kids this year.  The last post discussed the digitally controlled smoke machine I created to make this project possible.  This post seeks to discuss the rest of what we put together.

Overview

    Using an Arduino, we were able to set up an IR beam to act as a motion detection trigger.  When the beam between the two is unbroken, the Arduino controls an AC socket, powering a friendly Jack-o-lantern and porch light.  Once the IR beam become broken, the Arduino:

  • kills power to the AC socket, extinguishing the lights,
  • starts the smoke machine, and
  • sends a message to my MacBook, causing the MacBook to start playing back spooky sound effects.

After a delay of 3 seconds, the Arduino:

  • turns on LED circuits 1 and 2, lighting up the eyes of an evil looking Jack-o-lantern.

After a delay of 27 seconds (total elapsed time is 30 seconds), the effect is considered over.  Correspondingly, the Arduino:

  • turns off LED circuits 1 and 2,
  • stops the smoke machine, and
  • turns power back on to the AC socket, lighting the friendly Jack-o-Lantern and porch light back up.
To whet your appetite,  I've included a clip of our first test in the basement of my house.  A discussion of how to build the system starts after the jump.


Monday, October 27, 2014

Smoke Machine Modified for Digital Control

This year, my kids and I are working on some motion-activated effects for the trick or treaters.  As part of that project, we have some desired effects we want to be able to remotely control.  Most of them (i.e., sound effects, lights) have been easy to create.  However, remote control of a smoke machine was more of a challenge.  This project details how I combined a Powerswitch Tail 2 DC Controlled Power Switch and 400W Fog Machine  to create a digitally (i.e., computer/Arduino)  controlled smoke machine.

Full details after the jump; here's a video of the smoke machine in action, connected to an Arduino using infrared motion detection as a trigger.




Wednesday, August 27, 2014

Baseball Scoreboard - Update to display Box Scores

Overview

In previous posts (1 2), I discussed having programmed all of the graphical hooks to support real time box scores but had been unable to implement due to a lack of freely available sports feeds.  By leveraging some resources Mike Metral uncovered in building his sports ticker, I was able to finally implement the functionality fully.  (More including video of the finished update after the jump)



Monday, August 18, 2014

Baseball Scoreboard - Start Here

   NOTE:  This is currently my 14th post on the subject of the baseball scoreboard.  Previous posts have covered each component of the scoreboard and what it took to create that part.  This post is intended to introduce the subject with references to the other 13 posts, depending on where your particular interests lie.


Background


    For  almost four years now, I’ve been scoring baseball games via GameChanger (https://www.gamechanger.com).   For those who don’t know, it’s a fantastic tool for scoring games.  The scorekeeper scores via an iOS/Android app that streams wirelessly to an internet server where fans who couldn’t make it out to the game can watch its progress.
    Last year at one of our games, I was put in the position of having to score via GameChanger while also operating the scoreboard at the game.  While I was able to pawn off scoreboard duties to an eager kid, in the back of my head I got this idea that it would be great if the GameChanger app could also update the team scoreboard.  At this beginning of this season, I decided to give scoreboard building a try (see results after the jump).

Baseball Scoreboard - Bill of Materials

    All said and done, the whole project cost a little under $400.  About twice what I was expecting to spend but still not unreasonable, all things considered.  For those interested in what went into the scoreboard, the bill of materials is included after the jump.

Baseball Scoreboard - Using the Scoreboard

    As I got to the all-in-one quick start, I quickly realize that I hadn't written anything about how to actually use the scoreboard.  This post will give a real quick introduction on using the scoreboard.

Baseball Scoreboard - All-in-One Quick Start Guide

    For those who don't want to dig through 9 different posts in order to figure out how to construct your own scoreboard, I put this all-in-one quick start guide together.  If you follow this from start to finish, you should be able to set up your own scoreboard in a minimum amount of time (Guide starts after the jump).

Sunday, August 17, 2014

Baseball Scoreboard - Things I'd Like to Improve

    While quite a bit of development has gone into this project thus far, there are still some things I see as shortcoming.  After the jump, I'll go through the things that I see as needed improvements.  If you see anything I may have missed, please feel free to chime in in the comments below.

Saturday, August 9, 2014

Baseball Scoreboard - The Web Server

    If you have followed along with the blog posts thus far, your scoreboard now is functional, but there may be some things you wish you could do above and beyond the basics (at least that was the case for me).  To provide a venue for accomplishing those routine tasks, I stood up a web server.  Quick start guide starts after the jump.

Friday, August 8, 2014

Baseball Scoreboard - The Parser

    While I'm presenting the parser near the end of this development, the initial work on this portion of the scoreboard occurred more than a year ago at the conclusion of last season when I was still toying with the idea of the project.  After initialization, the parser steps through the following loop:

  1. Wait for a file containing POST data,
  2. Unzip the gzipped POST data,
  3. Parse the resulting JSON to recover the game state (score/inning, etc),
  4. Send the appropriate serial command to the scoreboard,
  5. Parse the serial response until the ready prompt is received,
  6. Move the POST data file to the output directory

Before we step through how each part works, the quick start guide (starts after the jump):

Thursday, August 7, 2014

Baseball Scoreboard - The Transparent Proxy

    If you'd asked me at the start of this project how long I thought this portion would have taken me, I probably would have said a day or two.  Reality didn't work out that way for me.  Instead, I spent more than a month iterating through failures and then making the modifications to get tinyproxy (the transparent proxy of choice) to do what I needed it to.  But before we get to a recap of what I did, a quick start guide (after the jump).

Wednesday, August 6, 2014

Baseball Scoreboard - Network Configuration within the Control Box

    In this blog post, I'll discuss how to set up the networking for the control box.  If you do this correctly, by the end, you'll be able to join the WiFi access point (AP) in the control box and surf the internet via 4G (yes, I'm aware that the 4G hotspot does that on its own, but we're building to something here).  This post will cover the easy stuff first (selection and configuration of WiFi and 4G) and move onto the more complex (configuration of the Raspberry Pi).  But first, for those who are impatient, the quick start guide starts after the jump.

Friday, August 1, 2014

Baseball Scoreboard - Control Box Overview

   While the scoreboard gets all of the attention, all of the heavy lifting happens within the control box.  The control box is responsible for providing internet to the scorer while passively listening in on the GameChanger communications and relaying the score to the scoreboard.  Here's an overview of how data flows through the control box:

(More after the jump…)

Thursday, July 31, 2014

Baseball Scoreboard - Programming the Scoreboard

    For those who are interested in playing with code rather than reading about code, here are the instructions to get up and running in a minimum amount of time:

  1. If you haven't already, download the Arduino IDE and install (http://arduino.cc/en/Main/Software).
  2. The github repository for my code can be found here.  Check it out into your Arduino working directory (i.e., git clone https://github.com/ScratchesTheItch/ScoreboardArduinoCode.git).
  3. Fire up the Arduino IDE, open the GC_Scoreboard sketch file.
  4. Upload the sketch to the Arduino.
  5. Once loaded, select the Serial Monitor to begin interacting with the scoreboard. (I'd suggest starting with a "help" command to get the compact usage statement or "test" to see what the scoreboard can do).
If you're playing with the code at this point, I'll admit that the help statement is a bit terse.  Due to an issue that I was never able to resolve, the full help message is too long to be output via serial.  As a result, I commented out most of the explanation for the commands in the compiled code -- if you want to read the full text, scroll down to line 54 in the sketch file.

Wednesday, July 30, 2014

Baseball Scoreboard - Constructing the Scoreboard

    This post covers the physical construction of the scoreboard; programming of the scoreboard is covered in the next topic.  While this presented first in the development process, in reality, the physical construction actually did not occur until after the initial field tests.  For most the development cycle, the scoreboard was actually a cardboard box with holes cut out for the displays, a temporary solution that I used while ironing out the more difficult development issues (also covered in future posts).

Design Goals


    My design goals for this portion of the project were simple:  provide a solid mount for the electronic components of the project that wouldn't break the budget and whose aesthetics wouldn't make people wretch (as I heard copious complaints about the cardboard box form factor).  After walking around the craft store for a bit, I settled on a cork board as the base to build the scoreboard around.

Monday, July 28, 2014

Baseball Scoreboard - In Action

    As I explain the scoreboard I've been working on to others, a live demo always seems to be necessary to showcase what I've developed.  As I can't visit you personally, here's a video that I hope adequately conveys the entirety of what I've built:





Saturday, July 26, 2014

Baseball Scoreboard - Initial Post

   NOTE:  This is currently my 14th post on the subject of the baseball scoreboard.  Previous posts have covered each component of the scoreboard and what it took to create that part.  This post is intended to introduce the subject with references to the other 13 posts, depending on where your particular interests lie.

Background


    For  almost four years now, I’ve been scoring baseball games via GameChanger (https://www.gamechanger.com).   For those who don’t know, it’s a fantastic tool for scoring games.  The scorekeeper scores via an iOS/Android app that streams wirelessly to an internet server where fans who couldn’t make it out to the game can watch its progress.
    Last year at one of our games, I was put in the position of having to score via GameChanger while also operating the scoreboard at the game.  While I was able to pawn off scoreboard duties to an eager kid, in the back of my head I got this idea that it would be great if the GameChanger app could also update the team scoreboard.  At this beginning of this season, I decided to give scoreboard building a try (see results after the jump).

About this Blog

About this Blog

    The title of this blog is  it a reference to  Eric S. Raymond's first lesson regarding software development:

"1. Every good work of software starts by scratching a developer's personal itch."(The Cathedral and the Bazaar, 1999)

Along those lines, this blog is a venue for posting those projects that I've been working on that scratch a personal itch.  In these projects, I have greatly benefited from the efforts of countless open sources tools and the programmers that support them.  I hope the this can be a means to share with others what little I've done in advancing the ball forward on the things I care about.