• Models
  • Contests
  • Slicer
  • Login
  • Start Here
    thingiverse-iconprintables-iconcults3d-iconmakerworld-iconmyminifactory-icon

    3D GO

    3D ModelsContestsCollectionsSaved ModelsOn a mobile device?

3D GO

Privacy Policy
LED clock 7 segments  3D Printer File Image 1
LED clock 7 segments  3D Printer File Image 2
LED clock 7 segments  3D Printer File Image 3
LED clock 7 segments  3D Printer File Image 4
LED clock 7 segments  3D Printer File Image 5
LED clock 7 segments  3D Printer File Image 6
LED clock 7 segments  3D Printer File Image 7
LED clock 7 segments  3D Printer File Image 8
LED clock 7 segments  3D Printer File Image 9
LED clock 7 segments  3D Printer File Image 10
LED clock 7 segments  3D Printer File Image 11
LED clock 7 segments  3D Printer File Image 12
LED clock 7 segments  3D Printer File Image 13
LED clock 7 segments  3D Printer File Image 14
LED clock 7 segments  3D Printer File Image 15
LED clock 7 segments  3D Printer File Image 16
LED clock 7 segments  3D Printer File Image 17
LED clock 7 segments  3D Printer File Image 18
LED clock 7 segments  3D Printer File Image 19
LED clock 7 segments  3D Printer File Image 20
LED clock 7 segments  3D Printer File Image 21
LED clock 7 segments  3D Printer File Thumbnail 1
LED clock 7 segments  3D Printer File Thumbnail 2
LED clock 7 segments  3D Printer File Thumbnail 3
LED clock 7 segments  3D Printer File Thumbnail 4
LED clock 7 segments  3D Printer File Thumbnail 5
LED clock 7 segments  3D Printer File Thumbnail 6
LED clock 7 segments  3D Printer File Thumbnail 7
LED clock 7 segments  3D Printer File Thumbnail 8
LED clock 7 segments  3D Printer File Thumbnail 9
LED clock 7 segments  3D Printer File Thumbnail 10
LED clock 7 segments  3D Printer File Thumbnail 11
LED clock 7 segments  3D Printer File Thumbnail 12
LED clock 7 segments  3D Printer File Thumbnail 13
LED clock 7 segments  3D Printer File Thumbnail 14
LED clock 7 segments  3D Printer File Thumbnail 15
LED clock 7 segments  3D Printer File Thumbnail 16
LED clock 7 segments  3D Printer File Thumbnail 17
LED clock 7 segments  3D Printer File Thumbnail 18
LED clock 7 segments  3D Printer File Thumbnail 19
LED clock 7 segments  3D Printer File Thumbnail 20
LED clock 7 segments  3D Printer File Thumbnail 21

LED clock 7 segments

thestovedoc avatarthestovedoc

August 21, 2021

thingiverse-icon
DescriptionCommentsTags

Description

#5 volt WS2812 LED, 7 segment clock programed with ESPHOME and home assistant. This a a remix using STL files for clock of random1101 https://www.thingiverse.com/thing:3437127 Used and modified ESPHOME CODE for D1 mini from Alex18881 https://www.thingiverse.com/thing:4689116 Please read info they provide about 3d printing files. there are added files for 6 numbers if you want to use seconds. (esp code will need to be changed.) I used 2 base for 4 digit ( front and back base_hh and base_ss) and base for dot front and back Used white PLA+ for number face and PLA black for back cover, base and back base cover. #ESPHOME CODE: ( edit your passwords and network info and esphome generated fallback info for your esphome setup device. what GPIO pin you want to use. I used D2) code below.


# Enable Home Assistant API
api:

# edit your generated password, fallback info  and wifi info below 

ota: 
  password: "ESPHOME GENERATED "

wifi:
  ssid: "smarthome1"
  password: "wireless"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Led-Clock Fallback Hotspot"
    password: "esphome generated "


# below use your device-name in substitutions and name of ESPHOME name. #

substitutions:
  device_name: led-clock

esphome:
  name: led-clock
  platform: ESP8266
  board: d1_mini

#### only changes from hear down needed is 
# your    timezone in the TIME section 
# GPIO  pin and LED type in the  #--------- LED strip ---------------- section towards the bottom ####

  on_boot:
    - light.turn_on:
        id: led_strip
        brightness: 100%
        red: 0
        green: 0
        blue: 0
        effect: "${device_name} Time effect"

logger:
  level: DEBUG


globals:
  - id: hours_red_value
    type: int
    restore_value: yes
    initial_value: '0'

  - id: hours_green_value
    type: int
    restore_value: yes
    initial_value: '0'

  - id: hours_blue_value
    type: int
    restore_value: yes
    initial_value: '0'

  - id: minutes_red_value
    type: int
    restore_value: yes
    initial_value: '0'

  - id: minutes_green_value
    type: int
    restore_value: yes
    initial_value: '0'

  - id: minutes_blue_value
    type: int
    restore_value: yes
    initial_value: '0'

  - id: dots_red_value
    type: int
    restore_value: yes
    initial_value: '0'

  - id: dots_green_value
    type: int
    restore_value: yes
    initial_value: '0'

  - id: dots_blue_value
    type: int
    restore_value: yes
    initial_value: '0'

output:
  #======== Hours ============
  - platform: template
    id: hours_red_output
    type: float
    write_action:
      lambda: |-
        id(hours_red_value) = 255.0 * state;

  - platform: template
    id: hours_green_output
    type: float
    write_action:
      - lambda: |-
          id(hours_green_value) = 255.0 * state;

  - platform: template
    id: hours_blue_output
    type: float
    write_action:
      lambda: |-
        id(hours_blue_value) = 255.0 * state;

  #========= Minutes ===========
  - platform: template
    id: minutes_red_output
    type: float
    write_action:
      lambda: |-
        id(minutes_red_value) = 255.0 * state;

  - platform: template
    id: minutes_green_output
    type: float
    write_action:
      lambda: |-
        id(minutes_green_value) = 255.0 * state;

  - platform: template
    id: minutes_blue_output
    type: float
    write_action:
      lambda: |-
        id(minutes_blue_value) = 255.0 * state;

  #========= dots ===========
  - platform: template
    id: dots_red_output
    type: float
    write_action:
      lambda: |-
        id(dots_red_value) = 255.0 * state;

  - platform: template
    id: dots_green_output
    type: float
    write_action:
      lambda: |-
        id(dots_green_value) = 255.0 * state;

  - platform: template
    id: dots_blue_output
    type: float
    write_action:
      lambda: |-
        id(dots_blue_value) = 255.0 * state;

##### edit your time zone ###

time:
  - platform: sntp
    id: sntp_time
    timezone: "US/Pacific"
    servers:
      - 0.pool.ntp.org
      - 1.pool.ntp.org
      - 2.pool.ntp.org     

light:
  - platform: rgb
    name: "${device_name} hours lights"
    id: 'hours_lights'
    red: hours_red_output
    green: hours_green_output
    blue: hours_blue_output

  - platform: rgb
    name: "${device_name} minutes lights"
    id: 'minutes_lights'
    red: minutes_red_output
    green: minutes_green_output
    blue: minutes_blue_output

  - platform: rgb
    name: "${device_name} dots lights"
    id: 'dots_lights'
    red: dots_red_output
    green: dots_green_output
    blue: dots_blue_output

####### edit your pin a and chipset  below ##################

  #--------- LED strip ----------------
  - platform: fastled_clockless
    id: led_strip
    name: "Led strip"
    internal: True
    pin: D2
    num_leds: 30
    chipset: WS2812B
    rgb_order: GRB

    effects:

    - addressable_lambda:
        name: "${device_name} Time effect"
        update_interval: 200ms
        lambda: |-
          const int ledsInDigitCount = 7;
          const int digitsCount = 4;

          int digitsLeds[10][ledsInDigitCount] = {
            {1,1,0,1,1,1,1},
            {0,0,0,1,0,0,1},
            {1,1,1,1,1,0,0},
            {1,0,1,1,1,0,1},
            {0,0,1,1,0,1,1},
            {1,0,1,0,1,1,1},
            {1,1,1,0,1,1,1},
            {0,0,0,1,1,0,1},
            {1,1,1,1,1,1,1},
            {1,0,1,1,1,1,1}
          };

          int ledOffsets[digitsCount] = {23 , 16, 7, 0};

          auto time = id(sntp_time).now();
          int colors[4][3] = {
            {id(hours_red_value), id(hours_green_value), id(hours_blue_value)},
            {id(hours_red_value), id(hours_green_value), id(hours_blue_value)},
            {id(minutes_red_value), id(minutes_green_value), id(minutes_blue_value)},
            {id(minutes_red_value), id(minutes_green_value), id(minutes_blue_value)}
          };

          int values[digitsCount] = {};
          values[0] = time.hour / 10;
          values[1] = time.hour % 10;
          values[2] = time.minute / 10;
          values[3] = time.minute % 10;

          it.all() = Color(0,0,0);

          if ((time.second % 2) > 0) {
            it[14] = Color(id(dots_red_value), id(dots_green_value), id(dots_blue_value));
            it[15] = Color(id(dots_red_value), id(dots_green_value), id(dots_blue_value));
          }

          for (int valueI = 0; valueI < digitsCount; valueI++) {
            int ledsOffset = ledOffsets[valueI];
            int timeValue = values[valueI];
            int *color = colors[valueI];
            int *leds = digitsLeds[timeValue];

            for (int ledI = 0; ledI < ledsInDigitCount; ledI++) {
              if(leds[ledI] > 0) {
                int ledIndex = ledI + ledsOffset;
                it[ledIndex] = Color(color[0], color[1], color[2]);
              }
            }
          }
End of code. I'm a beginner at ESPHOME and ESP code so I don't know much about it. when I ran my bench test with my bench d1mi using WLED program code to check my lights and wires everything works great full brightness and lower brightness. BUT... with the ESPHOME code you have to turn on the clock with homeassistant when powering up. and then when playing with it and setting up DIMMING and color automations for the clock brightness if i set the brightness level to less that 60% the lights flicker and less than 50% no lights at all. I believe its the way the clock program makes the numbers by reducing the brightness to make numbers and when you mess with the brightness for all the numbers is causes issues. Stuff a epsphome programed D1 mini and wires in base. connected to just a usb and power brick draws under 1amp. LED data is daisy chained from each number and dot flows from the last minute to first hour from your right to left. Wires between each numbers LED nodes 1 to 6 are about 32mm long and node 6 to 7 are about 84mm long. 5 volt, ground, data IN then data OUT to next number or dot. Low amp so recycled cat5 24g wire works great keep data lines as short as possible. Glue the front of numbers to back. I used hot glue to make it easy to take apart if needed. short 5mm M3 bolts or equivalent to secure the back cover of base.

License:

Creative Commons - Attribution

Related Models

Digital Sundial preview image

Digital Sundial

Mojoptix profile image

Mojoptix

67,472

Mechanical wall clock preview image

Mechanical wall clock

Harald Andersson profile image

Harald Andersson

6,979

Rolex GMT-Master II – Wall Clock preview image

Rolex GMT-Master II – Wall Clock

Sparco profile image

Sparco

1,692

The 3D Printed Marble Machine #3 preview image

The 3D Printed Marble Machine #3

Tulio profile image

Tulio

42,885

Improved Wandering Hour Clock preview image

Improved Wandering Hour Clock

David Kingsman profile image

David Kingsman

6,388

fully functional mechanical clock! preview image

fully functional mechanical clock!

Novera profile image

Novera

4,580

3D Printable Jet Engine preview image

3D Printable Jet Engine

Catiav5ftw profile image

Catiav5ftw

39,806

Death Star Clock preview image

Death Star Clock

Nils Kal profile image

Nils Kal

1,841