Introduction: 7 Segment Clock - Small Printers Edition
Update - 2021/07/15
Sketch v7 available. I also recommend having a look at the notes about electronics when building one of my things! https://www.instructables.com/ClockSketch-V7-Part-...
--
Yet another 7 Segment Clock. xD
Although I have to say it doesn't look that crazy when watching my Instructables profile. It probably get's more irritating the moment you have a look at my thingiverse profile.
So why did I even bother to do another one? Actually the answer is pretty simple...
While playing around with another project I came up with another way to route the led strip inside the modules. To "test my theory" I just had to build one to make sure it works out as expected.
Another major aspect while designing this was people with very small printers. My other things usually are printable on replicator-style printers and i3-style printers with common bed sizes - this one here requires a maximum of 107mm x 89mm x 23mm, so it is printable on printers like the Wanhao i3 Mini (100x120).
Also this is the first of my 7 segment clocks using led strips with 30 leds/m. The other ones are using 60 leds/m, so this is a bit different.
Each segment is lit by 2 leds, so there's 28 leds inside the double digit-modules and another 4 inside the dots-module. Total 60 leds, no "wasted ones" in between (+32 leds if building the 6 digit version).
The finished clock is 234mm x 93mm x 38mm. (360mm wide for 6 digits version).
Step 1: Notes
This documentation will miss quite a few details, like schematics, power limits and so on. Basically it is exactly the same as my other clocks, like S7ripClock here on Instructables. Please have a look at that one for details, this is using the same electronics and the sketch is based on the same source. Requirements are the same with some differences:
Instead of 9x M3 6-10mm screws you'll need:
12x M3 (8-12mm, I've used 8mm) (20 pcs if building the 6 digit version)
2x M3 (12-16mm, I've used 14mm)
Instead of LED strips with 60 leds/m you'll need:
60x WS2812B leds, 30 leds/m (other things like non-coated etc. apply, read S7ripClock instructions!)
Everything else is identical. Arduino/ESP (experimental) support, schematics, buttons, usage instructions.
Usage instructions/Features on YouTube
Update - 22.12.2020
In case you'd like to build this and do own a printer with a bigger build plate (object: 231.4mm x 85.2mm) have a look at Step 9 before starting to print parts...
Step 2: 3D Printed Parts / Software Sketch
To build the clock as shown you will need:
2x Frame_LR.STL
2x Cover_LR.STL
1x Frame_Dots.STL
1x Cover_Dots.STL
1x Diffusers_Dots.STL
2x Diffusers_LR.STL
1x Bracket_A.STL
1x Elec_Case.STL (includes spacer-part, case lid and two "hold buttons in place"-things)
1x Feet.STL
1x Cable_Covers_A.STL
Additional parts If building the 6 digit version:
1x Frame_X.STL
1x Cover_X.STL
1x Frame_Dots.STL
1x Cover_Dots.STL
1x Diffusers_LR.STL
1x Diffusers_Dots.STL
1x Bracket_B.STL
1x Cable_Covers_B.STL
Wall widths are always multiples of 0.5mm, so I recommend printing this using an extrusion width/line width of 0.5mm. Using medium print speeds the total print times are roughly 9.5 hours for all the black parts, 3 hours for the diffusers.
No supports needed, no overhangs > 45° and no bridging or anything that might make this a difficult print. Just avoid "the elephant's foot" ;)
Previews shown are at 60mm/s infill, 36mm/s outer perimeters and 42mm/s for solid infill at 0.25mm layer height using 2 perimeters/outlines/shells.
I recommend using a layer height of 0.25mm on this. When the clock is finished you'll be looking at the first layer at the front, so printing this at 0.20mm or finer isn't really necessary.
Also I recommend using black and transparent PLA for this. PETG will be quite wobbly with thin walls like this.
--
The sketch is also attached to this step. If you want to you can connect the led strip to an Arduino at the end of Step 5 and test everything. The sketch will run when there's no RTC and/or buttons connected and it will output messages to the serial port. Also you can use the serial console to send keypresses (A, B, A+B -> num pad 7/8/9) to test everything.
Attachments
7SC_SPE-Bracket_A.stl
7SC_SPE-Bracket_B.stl
7SC_SPE-Cable_Covers_A.stl
7SC_SPE-Cable_Covers_B.stl
7SC_SPE-Cover_Dots.stl
7SC_SPE-Cover_LR.stl
7SC_SPE-Cover_X.stl
7SC_SPE-Diffusers_Dots.stl
7SC_SPE-Diffusers_LR.stl
7SC_SPE-Elec_Case.stl
7SC_SPE-Feet.stl
7SC_SPE-Frame_Dots.stl
7SC_SPE-Frame_LR.stl
7SC_SPE-Frame_X.stl
7SC_SPE-Shield-Digits.stl
7SC_SPE-Shield-Dots.stl
Step 3: LED Strips, Part I
Here's some pictures to give you an idea of what's going on inside the modules. When building this it is important to watch the orientation of the parts. The double digits-module (Frame_LR) is the same, just rotated by 180° after printing. So you end up with one module showing "L" at the top, the other one "R".
The dots-module doesn't care if it's rotated, holes will always be at the top left/bottom right.
There's 3 pieces of led strip inside the clock. It is extremely important you put in the strips inside the double digit-modules the same way. So do not rotate them _AFTER_ installing the led strip!
One image shows how the leds are adressed later on inside the sketch (starting at #0).
If building the 6 digit-version an additional part is used (Frame_X). Please have a look at the step below about the 6 digits extension.
Step 4: LED Strips, Part II
Here's a more detailed gallery of how the strip is put inside the double digit-modules (Frame_LR, Frame_X).
You can put in the led strip into the dots-frame (Frame_Dots) in two ways, both do start with Data In at the top of the module. But it will affect connection order, so be careful when soldering the strips together and make sure you're connecting GND-GND, +5V-+5V and DI-DO accordingly.
The last picture is showing two dots-modules. Notice how the strip is routed/flipped and one of them has GND on top, the other one +5V. As long as Data In is still on the top it doesn't matter which way you end up putting them in.
Note:
There's some soldering on these led strips every 50cm. If you want to make things a bit easier use strips with 28 leds where the solder joint is between leds #14 and #15.
Step 5: LED Strips, Part III
Here's a few pictures of the connections between the three led strips.
1. Left module data out is connected to dots module data in
2. Dots module data out to right module data in
3. Wires to connect to the microcontroller later on
4. Power wire
Note:
If using a USB wire like I did you need to route it through the cover before soldering!
At this point this clock looks almost exactly like S7ripClock from the back.
So for schematics, details about buttons/electronics, please look here: S7ripClock
--
Please refer to the v7 Instructable for schematics and other important information.
Step 6: Electronics / Case Parts
1. Bracket_A in place (symmetrical, so rotating it by 180° doesn't matter)
2. Screws used. The two long ones needed hold the electronics case in place
3. Cable covers: Slide them onto the case
4. Cable covers: This "nose" needs to be pushed in/down a bit
5. Push slightly inwards using your thumb while pushing down with your index finger
6. "Nose"/Snap fit in place
7. Adding feet l/r
8. Done
--
Please refer to the v7 Instructable for schematics and other important information.
Step 7: Optional: Front "shields"
While the protruding diffusors do look quite interesting (especially when looking at the clock from an angle) this does hinder readability a bit. It's hard to describe and even harder to take according pictures. But you can add some "shield" parts to the digits/dots to get a cleaner look.
The first picture shows everything done according to the instructions so far. If you'd like to you can print 4x shields for the digits and 1x shield for the dots. Simply slide them on, they're a snug fit.
The last picture shows 2 digits with and 2 without the shields (outer/inner ones).
Step 8: Optional: Using 6 Digits Instead of 4
If you want to add two digits to the original clock, here's what you need:
1. Another 8 screws (M3x8mm-12mm, I've been using 8mm)
2. 1x Frame_Dots and Cover_Dots
3. 1x Frame_X and Cover_X
4. 1x Cable_Covers_B
5. 1x Bracket_B
6. 1x Diffusers_LR
7. 1x Diffusers_Dots
Some wires and 32x leds are required.
Disassemble everything so you can disconnect the left module from the dots module. Afterwards move the dots module and the right module to the right and insert the new dots module + frame_x. Connect everything like on the previous steps.
Slide on the new cable covers from the right side. Add the old ones as shown.
Upload the sketch after changing "#define LED_DIGITS" from 4 to 6 on top of the sketch. No more changes needed.
Frame_X can be used to build custom displays, there's holes on both sides to route the wires.
Step 9: Merged Frame/Cover for Bigger Printers
If you want to build this clock and your printer is able to handle somewhat bigger objects you might want to give these two parts a go. It's the three frame parts and the three cover parts merged to single parts. All the other parts are the same.
So instead of 6 parts (3x frame, 3x cover) you end up with 2.
There's also two cutouts in the center walls so you don't have to route the wires through the small holes before soldering (usb/power still has to be routed through the cover, though).
Note:
I cut away 1mm from the left/right side on this one to reduce size as much as possible. Using the merged parts the clock can not be extended to 6 digits later!

Runner Up in the
Plastic Contest
7 People Made This Project!
- tolemarj made it!
- Niokeskub made it!
- pneuteboom made it!
- vladjsb made it!
See 3 More
27 Comments
Question 5 months ago
Hi! Very nice project +++++
Question: what scale to use? When download one of the frames I get a height of around 852mm is quite large. To be able to get LED strip installed I have to scale the 3D parts.
Thank you very much
Answer 5 months ago
Hi,
please check your slicers import/unit settings. STL files don't know about units like other formats.
The frame parts are 85.2mm in height, so your scaling is exactly 1000%... ^^
1 year ago
Hello there, nice project.
Did it and it looks really cool, but I'm having troubles with the accuracy of the Clock, it is 20 minutes too fast every 24 hours! Any ideas?
Reply 1 year ago
Hi,
20 minutes does sound more like running an Arduino without RTC... at least I can't remember RTC modules drifting that badly. o,O
I'd suggest using the RTC library examples to set time on the RTC, let it run from the battery a few hours and check again, what time it is reporting. Only in setup does my sketch write anything to the RTC, so there's nothing which could "speed things up" on the RTC.
Question 1 year ago
Hey Parallyze, I almost finished building this clock but when I plug it in, the leds stay lit for a full second, then turn off. If I press A+B buttons it lights up again and stays on until I press A and it turns off again... Any idea why?
Answer 1 year ago
Hi,
hmm... do all the leds light up or is it showing a "proper" time like 12:00?
Is there any output on the serial console? Maybe you've accidentally connected a button wrong (shorted) and it's switching palettes and/or entering setup because of this?
Reply 1 year ago
It shows the time and I can set it up using the 2 buttons, so I don't think it the problem is the buttons wiring (and I checked them a few times). Ill try to wire them differently anyway
Reply 1 year ago
I'm a bit confused. Initially you wrote the digits turned off after a second and only light up again after pressing A+B (which should enter setup and have the clock blinking at 12:00) - but pressing button A again turns everything off.
So how have you been able to set time if the leds turn off?
What's the output on the serial monitor?
Reply 1 year ago
I don't know how to use the serial monitor - a friend helped me for the code part
When I plug in the clock, it lights up and shows the time. After 1 sec, lights turn off.
If I quickly press A or B before it turns off, it changes either the color or the brightness during that quick second.
When lights are off, if I press A+B lights turn on - and stay on - in setup mode (clock blinking 12:00, both buttons do what they're supposed to do). And then when I confirm setup, lights fade and it's off again.
Reply 1 year ago
The code does work "out of the box" on Arduinos as it is, what was it that you required help with? Are you testing a modified sketch or is it the one from this instructable?
I remember you asking about setting colors according to times - if there's been modifications to the displayTime() function this might explain the strange behaviour you're seeing... or is there an optional LDR attached to the clock and autoBrightness enabled?
Serial Monitor:
Arduino IDE -> Tools -> Serial Monitor (CTRL+SHIFT+M)
Set the baud rate within the Serial Monitor to 74880 baud using the drop down box
Reply 1 year ago
OK... I changed the push buttons. It works now. Wow that was making me mad.
Thanks a lot for your time, and for sharing those nice projects
2 years ago
Hi parallyze, that clock looks really good!
Is there a way to make the colours change at a certain time? For example blue from 20:00 to 8:00 and yellow for the rest? My programming skills don't go further beyond "Hello world"...
I'd like to give this clock to my 4y/o niece so she can understand to stay in bed a little longer, and eventually stop waking her parents up at 5am!
Reply 2 years ago
Hi,
there's multiple ways to do something like this. You could be using different color palettes and switch them or do something like void colorOverlay() does.
Example:
https://pastebin.com/wXKbJbSW
You could place this at the end of void updateDisplay() or replace colorOverlay() with it. This way one could turn it on/off using the buttons (instead of selecting per digit/per led coloring).
Reply 2 years ago
That's great! Thanks! I'll try it soon
Your comments in the .ino file help a lot to understand your code btw
2 years ago
Hi, please help me with this!
I made your clock and put one of programs and get result like on picture...
7_Segment_Clock_SPE_pre-v6 and 7_S_clock_SPE_test_v6, one of those...
Later I made some changes (add more brightnessLevels, try to add LDR...) then i lost color palette like on picture...
I had to add #define FASTLED_INTERNAL abowe FastLED.h
I don't know if it that matter of libary FastLED 3.4.0 or anything else, i put again orginal programs from your instructables i didn't get same results :(
Printed with 0% infill
other thing, does 5V from led strip goes to 5V or Vin?
Love your work and your clock
I wait for you answer
bye Z
Reply 2 years ago
Hi,
I made your clock and put one of programs and get result like on picture...
What's wrong with that? Looks like rainbow palette with overlayMode enabled (color per segment instead per digit)...
Later I made some changes (add more brightnessLevels, try to add LDR...) then i lost color palette like on picture...
I can't tell what changes you made. But if you want to switch between per digit/per led coloring, press and hold buttonA for a few seconds: Instructions
I had to add #define FASTLED_INTERNAL abowe FastLED.h
Just curious, but why did you have to do that?
other thing, does 5V from led strip goes to 5V or Vin?
nodeMCU v3 doesn't have a 5v pin, VIN only. So if you're using something else, please check the datasheet of your esp8266 board.
Note:
Adding palettes requires increasing the counter (it's commented inside the function). Adding brightness levels also requires changes in different places (eeprom loading, value adjustments in main loop). Just curious, but why would one need more than 3 manual brightness settings?
Another note:
As with the logic level for ws2812 the same is true for using a LDR. So if connecting a LDR on a nodeMCU v3, connect it to +3v, not +5v/vin. The ADC only accepts +3.3v max. And while this is true for nodeMCU boards, this is not always true for other ESP8266 boards/the chip itself - the ADC can only handle 0-1v!
bye,
Daniel
Reply 2 years ago
Thanks on fast answer!
Now it works perfect! You really made my day!
I had to add #define FASTLED_INTERNAL because i got some sort of error and i found on some forum to try that. I posted it here for others if they got similar error.
i asked for Vin pin because i think you maybe made error on you schematics picture. i used arduino nano. I added your scheme. i still learning about electronics and i used few times fritzing. I am just curious! :D
I successfully added more brightness levels. I wanted to put that clock in my bedroom, but 100 brightness was too much for me, so I made, 10, 20, ... I found the perfect for dark room.it is 70.
I deleted case1 pallete and replace it with RainbowStripesColor_p, fading in and out in rainbow colors. Orange is too bright for me :D
Reply 2 years ago
Whoops. I've read your comment again - I must have mixed that nodeMCU/Arduino up with some other posts I was answering recently... :D
About the "some sort of error", I think I know what you mean. There's a very old "issue" with fastLED which results in a pragma message being displayed in red. But that's not really a problem, this has been discussed for ages and often confuses people: https://github.com/FastLED/FastLED/issues/363
Still this shouldn't prevent a succesful compilation, it's more an annoying optical thing...
VIN vs +5V on the Nano:
If using a +5V power source I recommend feeding the Arduino using +5V. VIN uses a drop down regulator and therefore should be fed using more than +5V, recommended range is 7v-12v on that pin.
Example:
A 12v LED strip. 12v power to the strip, from there to VIN on the Arduino. The Arduino will drop 12v down to what it needs and can power RTC/other components from the +5v/+3v pins.
Oh, and because this came up recently: If you are using a ZS-042 RTC module and did not check if the charging circuit is enabled (many of them do come with it enabled) you might want to connect it to +3.3v volts instead of +5v. If using a non-rechargable battery the charging otherwise might damage it.
I often forget about the Nano/3.3v workaround, using the Pro Mini myself very often. That one doesn't have a 3.3v regulator so I need to check the charging circuit on the RTC anyways.
Here's some more info on that issue:
https://www.onetransistor.eu/2019/07/zs042-ds3231-...
bye,
Daniel
Question 2 years ago
Hello.
Great project. I have already printed and built it but I have a Wifi problem with my NodeMcu board. WPS is not working and I did not found any possibility to insert my Wifi datas directly into the sketch.
Is it possible to make it possible or do you have other ideas how to establish the Wifi connection ?!
Thanks.
Reply 2 years ago
Hi,
you can simply use any example wifi sketch to connect to a wifi and upload the clock sketch afterwards. There's a link and a description in the comments of S7ripClock over here: https://www.instructables.com/S7ripClock-Basic-Edi...
(asked by 3dprinter_man).