Emily Charles
  • Home
  • Work
  • About
  • Resume/CV
  • Contact

Flash Incident Alert Button

What is it?

It's a workplace health and safety monitoring tool, of course! As anyone in the interactive media development world is aware, Flash (er, "Animate") has some bugs. Occasionally, a developer will spend upwards of half a day trying to figure out why some piece of code isn't working, only to discover that there is a quirk (or worse, an actual bug) in the Flash/AIR platform that prevents the expected behavior from occurring. This is known as a "Flash incident". This alert button helps developers keep a record of Flash incidents in the workplace. 
What does it do?

When you strip away all the snark, it's a pretty simple timekeeping app. A readout displays the number of hours since the button was pressed last. Pressing the button resets the display to zero. A long press on the button displays the maximum duration recorded by the system since it was powered on. 

That's it! Simple and effective.
Picture
The whole setup in situ! The skeleton is just part of the general office decor.

Materials

Electronics

As usual, I get my electronics from Adafruit. Not affiliated with them in any way, I just like what they do, so I support them.
​
  • Arduino Trinket Pro 5V
  • 1.2" 7-segment 4-digit display backpack
  • 100mm lit LED button (red)
  • USB A to micro USB cable (3 ft)
  • USB wall adapter
Tools

Links are just for reference. Use what you've got or what you can find easily.
​
  • Soldering iron​​
  • Solder, of course
  • Wire strippers
  • Wire snips
  • Helping hand for soldering
  • X-acto knife
  • Hand drill
Fabrication

These components are very much up to you and your creativity.
​
  • Sturdy craft board/poster board
  • Markers, for decoration
  • Plain wooden craft box
  • Silver twist ties
  • String/wire, for hanging

Dev Environment Setup

The Trinket Pro 5V requires that you jump through a few hoops to set it up. Luckily, Adafruit has already done a great job of documenting that, so I will direct you here for those instructions: ​https://learn.adafruit.com/adafruit-arduino-ide-setup/arduino-1-dot-6-x-ide

I used four external libraries for this project:
Name
Source
Purpose
Adafruit LED backpack
https://github.com/adafruit/Adafruit_LED_Backpack
Controls communication with the time display
Adafruit GFX
https://github.com/adafruit/Adafruit-GFX-Library
Required by LED backpack library
Metro
https://github.com/thomasfredericks/Metro-Arduino-Wiring
Simple timer to trigger events
Time
https://github.com/PaulStoffregen/Time
Includes real-time utililities
One weird quirk that I ran into in programming the Trinket is that some USB ports and even some USB cables did not allow my PC to see the device. I don't know enough about USB technology to explain it, but if you are having trouble with the Trinket not being recognized, try swapping ports and cables before you tear your hair out.

Wiring

​The wiring doesn't deviate at all from Adafruit's tutorials on how to use the button and the LED backpack, here and here respectively. The choice of which pin to use for the button input is up to you; to get the sketch below to work, use digital pin 12.

​Here's a quick diagram of the setup:
Picture
Note that the physical placement of the pads is only for clarity in the diagram. The real pads are placed differently, so reference a pinout diagram before you solder anything.

Fabrication

​The only real fabrication to this is prepping the box that the button is mounted on. There are two holes that have to be created, one for the button assembly and one for the micro USB cable. 

To drill the hole for the button, I used a regular old hand drill. I marked the center of the box lid, clamped the box to a table, and just drilled straight through. My box was made out of balsa wood, so this turned out to be a little messy. I ended up having to use the edge of the drill bit like a router to clean up and enlarge the hole. No one will ever see it in the finished piece, so that's all right.
Picture
Messy hole for the button assembly
Picture
Part of the button ready to be attached to the box
Picture
Button collar securing button assembly to the box. The last step is to attach the LED to the button assembly (not pictured)
The next step is just to cut two small holes at the back of the box to allow the USB cable and backpack wires to pass through. I just used the drill again and an X-acto knife to clean up the edges. 
Picture
And that's pretty much it for the box. For the actual sign, I took a piece of heavy craft board and cut a slot in it to fit the 7-segment digital display. I used packing tape to tape the display in place. Then I printed out my sign, glued it to the front of the board, attached a string to the back, and hung it up!

Code

Pretty simple, and hopefully self-documenting. If you have questions, feel free to send me a message on my contact page.

    
Thanks for reading! If you build something similar, I'd love to see it!
Proudly powered by Weebly