S7ripClock - Basic Edition

21,838

109

68

Introduction: S7ripClock - Basic Edition

Another redesign (stopped counting them) of something I did before. So welcome to the latest iteration of "S7ripClock", a modular 7 segment clock built using led strips. The modules (2 digits) only use a single piece of led strip and can be used for other projects. Or simply build the clock as it can be seen in the pictures/video.

This is my first creation on Instructables, so hopefully I haven't forgotten something important. If you think there's something missing, leave a comment.

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-...

Update - 2020/06/01

- Added a draft of sketch v6 which supports being compiled for nodeMCU/ESP8266, see Step 11 for details

Update - 2020/03/14

- Added some more tolerances to some parts (AB_LED_Frame, Diffusers)
- Added single STL (BE_Test_Parts.STL) to check fitting accuracy (have a look at "Test Parts")

Step 1: Overview and Notes

Here's some pictures to give you an idea of how this thing works. The basic idea is the same, only using 3 strips of leds. I wanted to keep the electronics case size low by using a "DS3231 for Pi" RTC module. You will notice I've connected one to the center strip (power) and put it inside the center module. While that does work, I don't recommend it. From the 10pcs "DS3231 for Pi" I've bought 4 turned out to be rubbish/broken/useless(or M-models). So I went back to the very common ZS-042 RTC module and designed a case for that also. Shame it's so bulky. ^^
The "DS3231 for Pi" does fit inside the smaller case without problems also, getting it inside the center module was just to see if it would work, not a recommended thing to do...

When building this I recommend getting all the parts for a module done first, insert the led strip then and do the soldering afterwards. I tried to save some time by doing this first, but it is quite tedious to put everything inside once the 3 pieces of led strips are connected....

Dimensions (without feet):
275.2mm (w) x 112.8mm (h) x 33.5mm (d)

Step 2: 3D Printed Parts / Printing Instructions

To build the clock as shown you will need the following parts. I suggest printing the diffusers using clear PLA and everything else using black PLA. Hopefully there's an animated GIF showing up to give you an idea of how the parts fit together. The biggest part (x/y) to print is 148.6mm x 112.8mm, so it should be printable on most printers.


1x Module_A_Case.STL
1x Module_B_Case.STL
2x Module_AB_LED_Frame.STL
2x Module_AB_LED_Cover.STL
1x Module_B_Dots_LED_Frame.STL
1x Module_B_Dots_LED_Cover.STL
1x Feet_5_Deg.STL

1x Module_A_Diffusers.STL
1x Module_B_Diffusers.STL (includes the two dot-diffusers)

According to your choice of electronics you can choose between two sizes for the electronics case.

Cable covers and back parts must be used accordingly:

1x Back_Parts_Big.STL
1x Cable_Covers_A_Big.STL
1x Elec_Case_Big.STL
_OR_
1x Back_Parts_Small.STL
1x Cable_Covers_A_Small.STL
1x Elec_Case_Small.STL

Walls are multiples of 0.5mm, so I strongly recommend using an extrusion width/line width of 0.5mm for optimum results (print times/rigidity). I've used a layer height of 0.25mm. Parts are kept very simple to print, there's no steep overhangs or anything that should cause trouble. Just don't squish the first layer too much, otherwise you might have some trouble fitting the diffusers. All parts are chamfered on the first layer, so the first layer doesn't have to be perfect.

There's also a "Diffusers_All.STL" in case you want to fit them on the bed for a single print.

Step 3: Other Requirements

Other parts you'll need to build the clock as shown are:

67pcs WS2812B LEDs, 60pcs/meter strips, 5V, each led individually addressable, 10mm wide
(IP65/67, coated/rubberized ones do not fit!)

1pc Arduino Nano or Pro Mini

1pc DS3231 RTC module (ZS-042, DS3231 for Pi or similar)

2pcs 6x6mm push buttons

Some wires (AWG 26 min.recommended)

A USB cable / USB Wall Charger

9pcs M3 screws (length 6mm - 10mm, doesn't really matter. 8mm recommended)

You need a working Arduino IDE to upload the sketch. Also you should know about the difference between compiling and uploading a sketch or installing the required libraries. If you're completely new to leds/arduino I recommend working through something like Adafruits Neopixel Guide first.


Notes:
The sketch is using the FastLED library. So other LEDs can be used but this instructable will not include such modifications. Same goes for using an ESP8266 without logic level shifters and WS2812B.
For RTC communications the DS3232 library by JChristensen is used. So other models are supported (DS1307), I just didn't come across one without massive drift yet... ^^

Step 4: The LED Strips

There's a strip of 32 leds inside each of the two modules. The center strip is using 3 leds. Before cutting the leds from the reel I suggest to look for solder joints on the strip which might interfere with bending the strip. I didn't want to bend that joint in the first picture so I simply cut off 2 leds and started all over again.

When doing this watch the orientation of the frame (notch indicates top) and start with data in on the left side.

There's a picture showing the led strips already connected and a DS3231 attached. It's up to you if you put the strips inside the frame before soldering or afterwards. And I don't recommending cramping the DS3231 inside the center module, I just wanted to know if it would fit...

Connection #1 will be the one connected to the Arduino later. Connection #2 connects Data Out from the first module to the center strip (Data In, top). And finally #3, connecting Data Out from the center strip to Data In from the second module. #4 is where power will be coming from, I've chosen a regular 2m USB wire. So technically we end up with 67 leds connected to an Arduino on the left side (while still looking at it from the back) and power from the right side. That's how the schematics represent this.

Step 5: Preparing the Modules

After talking about the led strips it's time to show some details of how the parts are put together.

Put the diffusers inside their corresponding holes. Make sure to watch orientation (center diffuser with it's opening to the top). Theres a small bar on top of the cases where the led frames notches will be. Put in the led frames and clip them in place by pressing evenly across the frame.

Module A to the left side, Module B (the one with the dots) to the right. Remember, it's up to you if you do the soldering before or after doing this step. The cables from the bottom side of the center strip will be routed to the top, so make sure you don't cut them too short. :)

Ignore the gray/white wires in the pictures if you're not trying to fit a small DS3231 inside the center module.

Now it's a good time to add the USB/power cable to the right side/Data Out of module B. Put on the covers afterwards and route the cables accordingly.

Step 6: Putting Everything Together

Put on the electronics cover. Make sure you don't pinch any of the wires coming out of the modules. When soldering the buttons make sure to not accidentally connect them wrong. The feet are held in place by the bars left/right, I suggest moving the clock slightly off the work surface to keep it level when putting in the screws.

Route the USB/power wire as shown. When putting on the cable covers watch for the little square holes. They should point upwards. Upload the sketch and finish everything up.

Step 7: Electronics / Schematics

Here's how everything is connected:

ButtonA -> Arduino D3 + GND (yellow/black)
ButtonB -> Arduino D4 + GND (purple/black)
RTC SDA -> Arduino A4 (gray)
RTC SCL -> Arduino A5 (white)
LED Data -> Arduino D6 (green)

Power goes to the strip and is then used to power the Arduino and RTC using +5V.

It just takes slight modifications to use 12v led strips. Simply don't power the Arduino from +5V then, just keep the RTC there. The Arduino can take 7-12v on it's VIN pin, so this would be the only connection having to be modified. Just avoid powering the Arduino by USB and feeding the leds from +5V using the onboard VRM.

Step 8: Other

By now you should be done building the clock. If you're having problems try to isolate what's causing them. The clock will tell you on the serial console (74880 baud) what's going on, so check if maybe it's just "Entering setup" because both of the buttons might be shorted... ^^

For more information I recommend having a look at one of my older clocks and it's remixes. I wrote a lot there about different aspects: https://www.thingiverse.com/thing:3014572

Step 9: Arduino Sketch

The software sketch is at version 5. This is because it is very close to the one I've been using for some of my other projects, so I didn't want to confuse this because of the redesigned "hardware" around it...

Basic usage:

Button A: Select brightness
Button A (long press): Switch color mode (per digit/per led)

Button B: Select color palette
Button B (long press): Switch 12h / 24h mode

Button A + B: Enter setup
While in Setup: ButtonB -> Increase +1, ButtonA -> Accept/Next

Step 10: Test Parts

There's a single STL to test how good parts will fit. They're using the same tolerances as the main model files, it's just cut down to test how well diffusers/led frames will fit.

I've printed the test parts a bit too low on purpose. First layer is printed with rectangular infill @50%, you can clearly see how infill is too thick and how the first signs of "elephant foot" show up.

Step 11: Sketch Update V6 - NodeMCU/ESP8266 (experimental)

Here's a current draft from v6 of the software sketch. This adds support for compiling it on a nodeMCU/ESP8266 instead of an Arduino Pro Mini / Nano.

Uncomment "//#define nodeMCU" and select correct board type within the Arduino IDE to compile this for nodeMCU + RTC. If you don't want to use a RTC, uncomment "//#define useWiFi" and use ntp.

When using ntp make sure to choose an appropiate ntp pool adress and set your timezone offset, ntp will always deliver UTC time.

When running (on nodeMCU) the clock will sync it's internal clock to either the RTC or ntp every 6 hours:

  • 03:03:00 (hh:mm:ss)
  • 09:03:00
  • 15:03:00
  • 21:03:00

On Arduino the internal clock will sync to the RTC every 15 seconds when now(); is called (setSyncProvider).

If you're using v5 on an Arduino there is no need to upgrade to this one.

Important notes:

For a simple clock I don't prefer the nodeMCU for various reasons. Here's a few of them:

WS2812B leds use a 5v logic level. nodeMCU/ESP8266 don't, they're using 3.3v. While this does work very often right away depending on your combination of led strips/nodemcu a logic level shifter might be required.

Without an RTC the clock is useless when there's no wifi connection. Most nodeMCUs drift quite a lot and personally I wouldn't accept clocks running up to a few minutes off each 1-3 months...

The advantage is: nodeMCUs can be powered by 5v, just like an Arduino. So if using WiFi/ntp and setting up colors/brightness once, you theoretically don't need the buttons. Omitting the RTC this leaves just the power connections and a single data line for the whole clock in the same way as before.

I've attached some schematics:

  • nodeMCU + buttons + RTC
  • nodeMCU + buttons
  • nodeMCU + level shifter
  • nodeMCU all alone

As there's half a gazillion different versions of nodeMCU/ESP boards out there: I've only been using this on a nodeMCU v3 which, judging by pictures, is using the nodeMCU pinout mapping. So if you're using a Wemos D1 Mini or something else you might have to adjust the pin mappings inside the sketch.

When compiling for ESP/nodeMCU the DS3232RTC library is replaced by Rtc by Makuna.

6 People Made This Project!

Recommendations

  • Summer Fun: Student Design Challenge

    Summer Fun: Student Design Challenge
  • Metal Contest

    Metal Contest
  • Maps Challenge

    Maps Challenge

68 Comments

0
tcthim
tcthim

Question 19 days ago

hi i have a question can i use 30 led instead of 67 led ? means 1 led for each segment in the 7 segment of the led ....if yes what should what should i change in the program by the why I'm new to this... thank you

0
1084861936
1084861936

2 months ago on Step 11

Hello,I have a problem.I used ide to compile V6 code when there was an error, how to solve it, thank you.
Arduino:1.8.13 (Windows 7), 开发板:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled, 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
警告: DS3232RTC 库要求运行在 avr 架构(),可能与你现在运行在 esp8266 架构上的开发板()不兼容。
In file included from C:\Users\Administrator\Desktop\S7ripClock_BE_v6-pre\S7ripClock_BE_v6-pre.ino:24:0:
C:\Users\Administrator\Documents\Arduino\libraries\FastLED\src/FastLED.h:14:21: note: #pragma message: FastLED version 3.004.000
# pragma message "FastLED version 3.004.000"
^
In file included from C:\Users\Administrator\Documents\Arduino\libraries\FastLED\src/FastLED.h:65:0,
from C:\Users\Administrator\Desktop\S7ripClock_BE_v6-pre\S7ripClock_BE_v6-pre.ino:24:
C:\Users\Administrator\Documents\Arduino\libraries\FastLED\src/fastspi.h:135:23: note: #pragma message: No hardware SPI pins defined. All SPI access will default to bitbanged output
# pragma message "No hardware SPI pins defined. All SPI access will default to bitbanged output"
^
C:\Users\Administrator\Desktop\S7ripClock_BE_v6-pre\S7ripClock_BE_v6-pre.ino: In function 'void setup()':
S7ripClock_BE_v6-pre:192:21: error: 'RTC' was not declared in this scope
setSyncProvider(RTC.get);
^
C:\Users\Administrator\Desktop\S7ripClock_BE_v6-pre\S7ripClock_BE_v6-pre.ino: In function 'void setupClock()':
S7ripClock_BE_v6-pre:537:5: error: 'RTC' was not declared in this scope
RTC.write(setupTime); // write setupTime to RTC
^
exit status 1
'RTC' was not declared in this scope
在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。

0
parallyze
parallyze

Reply 2 months ago

'RTC' was not declared in this scope

This looks like you're compiling for nodeMCU but did not uncomment "#define nodeMCU" on top of the sketch....

0
1084861936
1084861936

Reply 2 months ago

Thank you very much. I canceled the comments as you said, but there was a new error. I couldn't find the rtcds3231 library. I'm a novice, I can't write code, and I've been studying it for a long time, so I'm ready to give up, but thank you very much for your work.

0
parallyze
parallyze

Reply 8 weeks ago

I canceled the comments as you said, but there was a new error. I couldn't find the rtcds3231 library.

As the instructions cleary state:

"When compiling for ESP/nodeMCU the DS3232RTC library is replaced by Rtc by Makuna."

Install "Rtc by Makuna" using the Arduino Library Manager. The only thing one has to change if compiling for nodeMCU instead of Arduino when using a DS3231 rtc module is the two slashes in front of "#define nodeMCU". All used libraries are listed in the instructions and all of them can be found using the Library Manager inside the Arduino IDE.

0
ChrisFHH
ChrisFHH

Question 3 months ago

Hello,
I'm building this beautiful clock a second time now and I'm having an issue with it. The first build used a D1 Mini with WiFi, now I'm using an Arduino Nano with RTC. The sketch is RE_v6. After soldering the cables to the correct pads, I only see one segment lighting up after I connect the power. On the serial monitor I can see the debug options and I can also enter the setup of the clock, but nothing changes on the clock itself. Do you have an idea what might be wrong?

0
ChrisFHH
ChrisFHH

Answer 3 months ago

Never mind, there were some bad solder connections. After fixing them the clock works as intended.

0
parallyze
parallyze

Reply 2 months ago

Hey, thanks for posting the update and glad you got it working!

0
AshimG1
AshimG1

2 months ago

In these project 7 segment per segment two led is showing here but i need per segment 3 or 4 and whow to edit it please say, i have made ws 2811 pixel led for these i need to edit these

0
parallyze
parallyze

Reply 2 months ago

I've published 7 segment modules/clocks with 1, 2, 3, 4, 4 + 6 and 8 leds per segment. Using 30 leds/m and 60 leds/m. All of them are documented, all of them are using the same sketch.

So unless you can come up with a specific question I don't see any reason to repeat myself all over again.

0
pistib
pistib

3 months ago

schematics :where is the resistor?

0
parallyze
parallyze

Reply 2 months ago

There's no resistor inside the schematics because I'm not using a resistor in this clock. So why would you expect on in the schematics?
To my experience it's not required with WS2812 and short data lines - but I wrote about this on some of my other things. The 7 segment clock on thingiverse was built using a resistor and therefore it's schematics represent this...

0
AshimG1
AshimG1

2 months ago

I have such a project. I want to have three LEDs in each segment

0
antruong01997
antruong01997

4 months ago

Hi.
I have a problem.
I'm building it, but my led display only minutes not display hour, how can I fix it, pls help

0
parallyze
parallyze

Reply 4 months ago

If it's not working from the dots or right after the dots please double check the led strip connections. If the sketch wasn't changed and minutes display properly it's very likely there's something wrong with the data connection - maybe the center strip was accidentally put in in reverse, switching data in/out direction?
Otherwise please post a few pictures showing the connections (data and power lines), this might be helpful.

0
antruong01997
antruong01997

Reply 4 months ago

it's ok now.
thank you so much.

0
andi.lochb
andi.lochb

4 months ago

hi,
You use a normal usb charger with 1A, am I right?
Isn´t it too less, because with 67 led´s the amperage would be around 4A.
I´m a bit scared if the gets destroyed.
You didnt´t destroy your USB charger, did you.
I´m looking forward getting a response!
Magnificent projekt by the way!

0
parallyze
parallyze

Reply 4 months ago

4A would be the theoretical maximum WS2812 LEDs could draw, yes. But the sketch is limited to 650mA, so a 1A power source is plenty. Average power consumption of my things here/on thingiverse is usually about 350-500mA, depending on brightness settings. Things that are meant to be run while powered over USB are limited some more (test sketch for lazy7/one for example, 500mA max.).

0
sbeerda
sbeerda

4 months ago

I used your code on my nodemcu and its been working awesome until Daylight Saving Time last weekend.

Any idea why it might not be working?

0
parallyze
parallyze

Reply 4 months ago

Why do you think the clock would do this automatically?

NTP will always return UTC time. Have a look at the comment from mondellinifabio on Lazy 7 / One (not the one below in italian), I've added an edited sketch there which can be used to switch dst automatically.