|Software apps and online services:|
I accidentally ordered the 1.2" 7-segment display with I2C backpack this week. It's entirely too big for my original purpose, so I decided to make a quick clock out of it. Although it took me about an hour to get it to where it is now, it could easily be built in 5 minutes from start to finish if you have the components in front of you and the code at the ready.
In order to complete this project in 5 minutes, there are a few liberties taken. Just like a recipe might say "cook for 30 minutes", there's usually at least a few minutes of prep time not factored into that. The prep-time liberties taken in this project are that you have removed all the devices from their packaging, already have a Particle account set up, have the Particle app installed on your phone, and are familiar with the Particle CLI. Oh, and pre-heat your soldering iron. Do some stretches to get loose and ready while the soldering iron heats up.
Align the display to the backpack PCB and solder the 5 pins per the instructions at Adafruit.
(To be totally fair, it would have taken MUCH less time if I didn't have a stubborn breadboard with incredibly tight pins.)
- Put the Photon on the breadboard
- Hook up jumper wires:
- - Photon "VIN" --> Display "IO"
- - Photon "VIN" --> Display "+"
- - Photon "GND" --> Display "-"
- - Photon "D0" --> Display "D"
- - Photon "D1" --> Display "I"
- Plug the Photon into a USB power source with a micro USB cable.
Use the Particle app on your phone to claim your Photon. Use the add device wizard and follow the on-screen instructions. If you need help, visit https://docs.particle.io/guide/getting-started/start/photon/#connect-your-photon for more detailed instructions.
- Download the code:
- Change variables to taste. There are 3 main
#definestatements at the top of
segment-clock.inothat you can tune.
TIMEZONEis your time zone offset in standard time (keep in mind that some places switch to daylight savings time in the fall/winter).
USE_DSTtoggles whether your local area observes daylight savings time.
TWENTYFOUR_HOURallows you to toggle between 12-hour (AM/PM) time or 24-hour (military?) time.
- Flash the code to your device:
particle flash YOUR_DEVICE_ID
Most of the tiny breadboards come with double-stick tape on the bottom. If your breadboard does, peel off the cover of the tape and stick the breadboard to the back of the display. I placed mine on the right center which allows it to sit at a slight angle for better readability on my desk.
If you made this clock in less than 5 minutes, spend the remaining time patting yourself on the back for a job well done. But, really, spend all the time you need here. You deserve it!
I also created a wooden box so this can be used as a real clock in a bedroom/office environment. SketchUp plans for a box similar to the one pictured below have been added to the project.
Another box! This time made out of bamboo.
MOAR BOXES! This time made out of purple heart.