Things used in this project
|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.
1. Solder the display to its backpack -- 1 minute, 56 seconds
Align the display to the backpack PCB and solder the 5 pins per the instructions at Adafruit.
2. Breadboard everything -- 49 seconds
(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.
3. Claim your Photon -- 51 seconds
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.
4. The code -- 28 seconds
- 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
5. Mount the breadboard - 12 seconds
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!
Did you replicate this project? Share it!I made one
Love this project? Think it could be improved? Tell us what you think!