Introduction: Tabletop LED Timer
After being crunched for time on more than a few occasions, I brought it upon myself to make something that I could set quickly and visually queue me the time remaining from afar. Based on LEDs that slowly fade out based on how much time is left (adjustable with a USB cable and computer) -- the Tabletop LED Timer can give quick feedback on how much time is left without being necessarily tied to a specific event.
Whether it be getting ready in the morning or running in the background as an unobtrusive way to see your pace during a speech, the ease of setting it up makes for a great timer. A smaller version is in the works for a mobile FLORA pack installation for runners and cyclists who want to make sure they are on pace on longer hauls.
Side: This project uses Adafruit's Pro Trinket 5V. Please make sure you have all drivers installed for either this device, or any other board you are using. It also assumes you have Arduino installed on your computer and a basic understanding of how to upload code to the trinket.
For more information on this product, please visit the following:
Also, the housing for the unit was cut on a laser cutter with 1/4" material. It's a very simple box though and can be done with hand tools or other materials.
Step 1: Collect All the Parts
I took advantage of neopixels that contain all the resistors and input/outputs necessary to assemble the device. Combined with Adafruit's Pro Trinket (or Arduino) I was able to install the code necessary for the timer to work.
I included the links for certain items to make this easier for you. Although some of these in the prototype were salvaged off other devices, all of the following parts will work.
What you will need:
- 1x Adafruit Pro Trinket (https://www.adafruit.com/product/2000)
- 1x Tactile Button (https://www.adafruit.com/products/1010)
- 6x RGB Smart Neopixels (https://www.adafruit.com/products/1312)
- 1x Toggle Switch (http://www.microcenter.com/product/422396/Subminia...)
- 1x Female DC Power Adapter (http://www.adafruit.com/products/368)
- 1x 5V Power Supply (http://www.adafruit.com/products/276)
- 1x PCB Board (http://www.adafruit.com/products/1135)
- 1x Micro USB Cable (http://www.adafruit.com/products/592)
- Hookup Wire (http://www.microcenter.com/product/328298/22_gauge...)
- Headers (http://www.microcenter.com/product/426789/10_01_40...)
Some things I assume you will have that are not specific to this project like a soldering iron. Also, the wiring does not need to be rated for 300V. I happened to have it off of another project I found in a junkyard and I wanted to list what I had used so there's no rating issues later.
Step 2: Soldering Headers
Solder the trinket and the neopixels to headers for easier installation. I did this on a spare breadboard I had for efficiency but it's not necessary.
Step 3: Wire the Protoboard
You do NOT need to include both a USB power supply and a wall power supply although I highly recommend it. The reason being if you ever want to change your timer, you will need access to the USB drive. But if you want to move this away from a computer to either an outlet or using a battery supply, then you will need another source of power. I have this rigged with the USB port and with a wall power supply but as mentioned, you can do one or the other.
The above image is designed to help show you the final wiring pattern.
Side: to make your life easier, only choose one side for ( - ) and one for ( + )
One last thing you may want to consider is also lining up where you put your neopixels, button, and trinket with where I put mine. The reason is the laser cut file is designed for the holes to match with the coordinates provided. The object will still work even if you do not, but you may need to recut some pieces later.
- BAT goes to ( + )
- G goes to ( - )
- 5V goes to ( + )
- PIN 3 goes to one side of the tactile button
- PIN 12 goes to IN of one of the neopixels
Place the trinket near the edge of the board as illustrated with the USB port sticking out of the back end. Use the side of the protoboard that is labeled with numbers and letters. The other side is designed for the Raspberry Pi. The side for the Raspberry Pi is where I glued down the female DC power adapter since it is not linked to the rest of the board.
- From the pin diagonal of the pin that you hooked to PIN 3 on the Trinket, wire this new pin to ( - )
- Using the same neopixel and same as the IN pin that was used to wire to the trinket, attach G to ( - ) and ( + ) on the neopixel to ( + ) on the protoboard
- From O on the current neopixel, wire this to IN on another neopixel. Go from G to ( - ) and ( + ) to ( + ) again.
Neopixels can be done in an array. I've tested up to 60 and it works but that's pushing it. This might be confusing so please refer to the photograph above to see how it was done.
DC Adapter and Power Switch:
- Use wire to go from ( + ) to one side of the on/off switch.
- From the other side of the switch, attach into red ( + )
- Attach the ( - ) on the adapter to the ( - ) on the board.
I superglued these to the protoboard near the Raspberry Pi connectors since I was not using them.
Step 4: Upload the Code
At this point, you will want to upload code I used. Plug in your trinket, download and unzip the file, and upload into the trinket.
I understand the code is clunky as I am no expert but it does work. Copying and pasting/eliminating chunks will allow you to add more neopixels if you choose. However, the biggest key element is on line 186.
time = time - 6;
This is the code that determines the speed of the countdown. The higher the number, the faster it runs. I chose 6 because it's a good amount of time to indicate whether the code is running correct or not. This can be altered to whatever timeframe you desire.
EDIT: In my quest to perfect this, I came up with some super scientificky (see: Trial and Error) code that makes this work a lot better. I made some code up that makes changing the timer preferences really easy.
Add Line 31: float secondcounter = 60;
Change (now) Line 187 from: time = time - 6;
time = time - (5.5 / secondcounter);
The point of this is now you can adjust the secondcounter code to however many seconds you want each neopixel to be and it will be pretty close. I used a stopwatch at 60 seconds and I was less than a second off. I'm sure there's a much more scientificky way of doing this but hey, I'm a novice like I said. I just thought I'd make this a bit easier for you.
Step 5: Laser Cutting
If you have access to a laser cutter, you should know how to use it or have someone trained helping you. I included a DWG file so all you have to do is upload and let it run. The file is designed to work with 1/4" material. Please note that sometimes the protoboards are not cut perfectly. There is not much tolerance in the file and you may have to sand down the edges of the protoboard.
The above image illustrates how the pieces are to be assembled together.
I made mine out of acrylic while binding it with acrylic glue and screws I custom made on a lathe. I screwed in the top pieces so I can remove them at a later date to make adjustments. The fit of the protoboard is snug enough that I didn't attached it to anything and it still stays in place.
CAUTION: The setup is not exactly symmetrical. The slot in the middle top piece for the LEDs is slightly off center. Also, the short sides have slots that are placed to match where I had attached my power supply, on/off switch, and input for my Pro Trinket. Do a dry setup to make sure all your pieces fit within the box. (I, myself, accidentally attached one of the sides backwards and had to pry it off and stick it back on.)
Also, I did not leave room to reset the Pro Trinket in case of changes to the timer later. It means I have to unplug and replug the Trinket in every time I want to make changes. If you do not want this hassle, please adjust your files accordingly.
Step 6: Plug in and Enjoy
If you followed the steps (closely enough) you should have a working timer. Test the timer along the way to make sure all the parts go together correctly.
In terms of operating the timer, hold down the tactile button to charge up the device. A neopixel will start getting darker and darker blue until it hits red. A red neopixel is fully charged and the device will move onto the next one. Release the button to begin the countdown. If it's glowing green, it means that the timer has finished its cycle. Pressing the button and releasing quickly will reset the timer back to 0.
Hope you enjoy and let me know if you have any problems!
We have a be nice policy.
Please be positive and constructive.