Here's a rework of something I did a while back. This time it's not only the display modules, it's the complete clock as can be seen in the pictures.
Updated software sketch v5
Massive cleanups, improved color handling and ldr support, read sketches section for details
Even bigger with 4 leds per segment: https://www.thingiverse.com/thing:3136688
SE (Small Edition)
The SE also features a complete build video.
This version is using continuous led strips as much as possible - when building this there's less than 20 wires to solder!
Updated software version - v4
Besides more comments v4 adds automatic brightness correction by using a photoresistor.
Updated software version!
I've uploaded sketch v3 which adds some features. Also I've added a details section about the sketch where I'll put the changelog/usage instructions.
Update for smaller build volumes!
I've uploaded two parts (base_frame-noborders and center_frame-noborders) which don't have the upper and lower borders. This reduces the biggest part to print from 178,31mm x 152,85mm to 178,31mm x 147,27mm. So it should be printable on many printers which are limited to 150mm along the y-axis (various makerbot clones for example).
Use the NoBorders-files only if you're limited by build volume.
Update for a 3rd module displaying seconds
If you have this thing up and running you might want to add another module to display seconds: https://www.thingiverse.com/thing:3016537
Width: 400mm (15.8")
Height: 153mm (6.0")
Depth: 30mm (1.2") (not including optional feet)
It may look confusing at times but I think it's hard to build a clock like this easier and faster.
I've used M3x10mm screws (didn't have any other length at home) but anything between 6mm and 10mm should work just fine.
Usage instructions can be found at the bottom
- Walls are multiples of 0.6mm, so I suggest printing these using a extrusion width/wall width of 0.6mm/1.2mm. 0.5mm/1.0mm or smaller will increase print times and give you weaker parts.
- Before printing all the diffusers I suggest printing the single one and test if it fits nicely. Don't squish the first layer too much on the frame or diffuser files!
- After wiring the led strips I strongly suggest running the test-INO before completing everything (rtc, arduino, case, power wiring and so on).
- Of course you can use other led strips as long as they aren't much thicker, 10mm wide and you know how to program them
- The case will fit an Arduino Pro Mini OR Arduino Nano. No usb breakout as I'm only using pro minis for stuff like this...
1 Arduino (Nano or Pro Mini)
1 RTC module (DS3231)
99 WS2812 LEDs, 60 leds/meter, 2x 47pcs, 1x 5pcs
2 button switches, 6mm
1 resistor (300-500ohms)
24 screws (M3, 6-10mm)
lots of wires
Working Arduino IDE
Basic knowledge of what you're doing
Willingness to read this and look at the pictures closely
Remember: You can open the pictures in a new browser tab to see them full size!
Added some pictures to a new section about the print settings I've used. Have a look at the pictures there if you wonder why I recommend 0.6mm.
I printed the diffusers at 0,25mm layer height with 7 solid bottom layers, no infill and no top layers. Might be worth experimenting here to achieve better results for light diffusion.
Base/center frames can be printed with a single perimeter/outer shell and at 60mm/s shouldn't take much longer than 90-110 minutes.
Do not squish the first layer into the bed too much or you might have problems fitting the diffusers inside the frames!
Step 1: Gathering parts
Print these parts:
Get a led strip and pre-bend it slightly. Make sure it fits without bending on any solder joints!
There's more details at the end of the page (Electronics / Schematics) that you might want to check out.
The parts to start with for module #1
Step 2: Fitting everything inside the frame ("I know the pieces fit...")
A picture is worth a thousand words. So here's a few thousand words for you.
Double check the diffusers fit nicely
Avoid "elephant foot" (first layer squish) on the diffusers and frames or you may have to scale down the diffusers to make them fit.
IMPORTANT: Watch orientation of the frame (center-holes towards you) _AND_ data signal-direction!
Yellow to DataIn - this will later be connected to the Arduino (D6). Adding a resistor is recommended (I've used 330ohms). Only this connection will get a resistor, none of the following.
Orange wire connected to the end of the strip (DataOut). This will go to DataIn on the center led strip, see later steps.
This is where we will connect some power wires to the led strip.
Everything cleaned up and done for module #1.
Covers put on to prevent me from accidentally taking it apart while building the other parts...
Double check you have everything in place as shown on the pictures. Putting in the led strips in the wrong direction won't work. Working with the frame upside down (center-holes away from you) won't work.
This one is pretty easy. Do the same as for module #1 but only connect a single wire to DataIn. No resistor, no wire to DataOut. Power wires are connected in the same way as seen in module #1.
Module #2. Only one wire to DataIn which will connect to DataOut of the center strip, see later steps.
This one looks so easy. And it is. But there will be a lot of connections to this led strip, so double check everything!
The parts to start with
Watch the orientation of the center part. The led strip is put in on the left side, starting with DataIn from the top.
Cables coming from module #1 and connected to the center led strip. Module #1 DataOut (orange) is connected to DataIn, power connected to the same side.
Remember the connections:
Yellow: Module #1, DataIn, Arduino D6
Orange: Module #1, DataOut, Center DataIn
Black is always ground, red always +5V
After doing these connections connect Module #2 DataIn (orange) to DataOut of the center strip. You also need some wires for the power connections here:
Power from module #1 goes to upper side of center strip. Power from module #2 is connected to the lower end, together with a USB wire for powering the device later and a pair of ground/+5v (middle ones in the picture) which will be used for powering the arduino and rtc.
This is what you need to end up with. Only three wires left: DataIn from module #1 (yellow) and +5v/ground for the electronics. Be careful not pulling the usb wire (black wire at the bottom).
I recommend testing everything at this point. All you need is an Arduino, connect +5v/gnd to it, yellow wire to D6 and run the Test-INO (thing files).
It'll display 0-9 on all 4 digits and fill all leds starting from 0. If this doesn't look like in the video you might want to check your connections before proceeding.
Put on the case/frame-part and route wires as shown
Connect two Button switches to some wires. One of them will connect D3 to ground, the other one D4.
Button A: D3 + GND, Button B: D4 + GND
I broke off the unused pins. Slightly bend the wires back so you can hold the button in place and put in the little bar holding it.
Now you can do the following connections:
DataIn (yellow) from module #1 -> Arduino D6
+5V -> VCC -> Add cable for RTC!
GND -> GND -> Add cable for RTC!
SDA -> A4 (gray)
SCL -> A5 (white)
What it looks like after the cabling has been done. Route the usb wire as shown so accidentally pulling it won't rip it from the center led strip!
Cable covers and (optional) feet mounted
The provided sketch limits power usage to 5v/1.5A (2 modules, 750mA per module).
Note: v5 sets 750mA for the whole clock, adjust to your needs/wirings/power supply.
As long as you don't change anything and are using a wire gauge between AWG24-AWG20 and common usb cables that's absolutely fine. Wires in the pictures are AWG22 (0,33mm²).
But if you intend to remove the limitation be aware of possible modifications you might have to make!
This should be plenty of power to get some bright leds for anything but extreme daylight/sunlight situations. If you're going to increase the brightness be aware of the power drawn by those tiny leds!
42 (5 unused, 21 per digit) leds equals up to 5v/2.5A. That's maximum of what I'd use AWG 24 for. But remember the power connection and make sure you're using some really thick wires if using two or three modules at full brightness/white.
The XT version has 3 modules. If I didn't just count wrong that means:
12:08:08 (in am/pm) would be the time showing the most segments. Including the dots of two center modules (2x 4) this would be 107 leds lit. At full brightness you're facing a power consumption of up to 6.4A! At 5 volts that's about the power it takes your 3d printer to melt plastic. That's where I would start using something like AWG 20/AWG18...
29.09.2019 - Update to v5
Wow, it's been almost a year... o,O
v5 is now the same code base for all my 7 segment clocks here. This one from now on being RE - Regular Edition. Configuration like 4/6 digits, brightness and so on can all be modified by using the variables on top, there shouldn't be the need to dive down into the code anymore. (Tested and verified on SE, TE, RE, RE/XT and XL/XT). Of course you will still need to download the appropiate sketch because of the predefined led arrays.
Removed(!) periodic palette cycling
I don't know if anyone used it at all. But I think this should be tied to a certain time to swap colors each hour or so. I couldn't care less so I removed it. And removing is a great feature, isn't it?
Many, many cleanups
Setup routine and so on have been changed quite a lot. Added some comments here and there.
Brightness is now stored within an array (min/med/max) and eeprom reading/setting has been improved.
Memory usage has been reduced, especially when setting dbg=false.
improved LDR support
There's some new variables on top of the sketch which allow you to adjust your LDR readout more easily. Additionally you can define upper/lower limits to turn it dark/bright exactly when you like.
Greatly improved color handling
Some palettes got some minor changes. All in all they're close to the old ones but I tried to get rid of some color flickering because of non ideal color combinations at start/end of palettes.
Also color flickering/steps on low brightness settings have been greatly improved.
Added some default color corrections/color temperature settings (great improvement on blue tones using ws2812b).
Added some palettes using "HTMLColorCodes", which should make it easy to create own gradients without caring about R/G/B values.
- Some kind of debug interface
Using the serial console and having dbg=true; you can use your number pad to send buttons and/or change different variables. This makes creating own palettes and especially testing much more comfortable :D
Power limit is set to 750mA on all of them and one of the first parameters inside the sketch. Adjust this according to the model you're using and how much your wiring/power supply can handle.
13.09.2018 - Update to v4
- Added more comments to the sketch
- Added support for a photoresistor/auto brightness
Photoresistor / Automatic brightness corrections
Setting variable "brightnessAuto" to "1" will enable corrections by reading a photoresistor connected to A1.
Example for using a photoresistor: https://playground.arduino.cc/Learning/PhotoResistor
I was using a GL5516 so you might have to change the values inside readLDR(); accordingly to the one you're using.
26.07.2018 - Update to v3
Now only a single sketch for this and the XT-version with 3 modules
Switch between 12/24h format
Toggle color modes per digit/per single led
Selected brightness, 12/24 format, colors and color mode are now saved to EEPROM
As before basic usage is:
Button A: Toggle brightness
Button B: Toggle colors (5 different palettes pre-configured)
Button A + B : Enter setup
While in setup:
Button A: Increase hour/minute
Button B: Proceed to next value/end setup
(in 12h mode the upper center dot will light when it's am, both will light if it's pm)
New in v3:
Button A: Keep pressed to switch between coloring single digits/single leds.
Button B: Keep pressed to switch between 12h/24h format
Single version for basic/XT:
When using this with 3 modules just change "#DEFINE MODULES" in the sketch accordingly. Total led count will be calculated, just change modules from 2 to 3.
If you'd like to add own colors I've commented in the sketch how to set a custom color and put in an example (void colorOverlay) which shows how to modify the already drawn pixels without having to mess with other parts of the code.
24h mode and per pixel/led coloring enabled (XT, 3 modules)
Example of an GL5516 LDR. Red: +5V, Orange: A1, 10k resistor, Black: Ground
As mentioned earlier I strongly suggest printing these parts with an extrusion width of 0.6mm. To give you an example of why I suggest this, have a look at these pictures.
Basic slicer settings (Simplify3D). Extrusion width set to 0.60mm
Speed at 65mm/s, outlines and solid infill at 100%
Other settings were:
- no infill (just print the bottom 3-5 layers solid, the frame walls don't need support/infill.
- 1 outline/perimeter
- Layer height: 0.30mm
Your slicer may use different names for some of these options, maybe "line width" instead of "extrusion width".
You can open the pictures in a new tab to see them full size
Using these settings I get this result:
Estimated print time: 01:18
Due to different reasons (acceleration settings and so on) that's usually a rough estimation of the print time. Using an Prusa MK2S at this settings with acceleration set between 1500-2000 the real print time is about 90 minutes.
0.3 layers + 0.6 extrusion width + 65mm/s are pretty demanding to the extruder. So I don't recommend starting with these settings, maybe use a layer height of 0.25 first or lower speed to 50mm/s to see how your printer keeps up.
The point is this: If you're using a extrusion width of 0.4mm and common print settings with maybe a bit of infill, this may happen:
Same slicer settings with the exception of extrusion width set to 0.4mm and some infill
Estimated print time increased from 01:18 to 02:01. That's quite a lot. If you have a closer look at the picture you will notice there's infill between all those walls. This takes much time while printing. Because if you had this printed at 0.6mm the printer only had to do the walls. They would have touched each other and done.
Additionally these 0.4mm walls with little infill are much weaker than solid 1.2mm walls printed from 2x 0.6mm lines, especially in PLA.
As far as I can tell nozzles with a diameter of 0.4mm are very common. Remember that you can use these with an extrusion width between 0.4mm - 0.6mm without problems.
Especially solid infill layers can be printed much faster:
Slicer told to stop at 1mm print height, extrusion width 0.4mm, 36 minutes estimated
Same settings, extrusion width 0.6mm, 24 minutes estimated
While I know a slicers settings window can be pretty overwhelming at times, especially if you're new to 3d printing, I encourage you to find out what all those things do mean. Using optimal settings for each print might sound tedious, but it can save you a lot of time.
This thing for example can be printed completely in about 7-9 hours on a Prusa MK2S at moderate settings of 60-65mm/s. Including time to swap material for the diffusers. ;)
Example of all this in Cura from one of my other things:
As the wiring can be a bit confusing at times I'll try to help here somewhat. Never been using Fritzing before, but uploaded a file. This is what it looks like:
(Open in new tab for full resolution)
Wire colors are the same as in the pictures.
The led signal goes like this:
Yellow: Arduino D6 -> Resistor -> Module #1 Data In
Orange(1): Module #1 Data Out -> Center Module Data In
Orange(2): Center Module Data Out -> Module #2 Data In
Gray: SDA/Data -> Arduino A4
White: SCL/Clock -> Arduino A5
Brown: ButtonA -> Arduino D3
Purple: ButtonB -> Arduino D4
Here's the way the led strips go (blue) and how they are connected to each other (green):
Remember: You can open these pictures in a new tab for higher resolution
Here's two more pictures. The first one shows the led data lines only and how they run through all modules:
And this is how I added power to everything:
Power comes in from +5v/gnd (power source/usb wall plug) and connects to the lower end of the led strip inside the center module. Module #2 is powered from the same connections on the led strip.
From the top of the led strip there's one pair +5v/gnd powering Module #1 and another one for the Arduino/RTC.
When using a stable +5v power supply you can power the Arduino using the +5v pin. Using the vin/raw is meant for 7-12v and will use the onboard power regulator. But connecting the leds to the +5v pin then may draw more power than the onboard regulator can deliver. So I suggest using a good +5v supply and just feed the Arduino from that.... :)