Introduction: Light Up Clock 2.0
几年前，我发表了我的第一个版本Light Up Clock for Kids。At the time we were going crazy with our young kids（2到4岁之间）谁无法理解如何在时钟中“等待7”，然后在早上醒来。现在最年轻（第四个，希望最后一个）is 3 years old and I reflect on how amazingly efficient and life-saving this clock has been the last few years! The light up clock concept, which has been enhanced over the years, has provided a HUGE solution to our "child-waking-us-up-at-insane-hours-of-the-morning" problem!!!
- arduino.Nano (Amazon/aliexpress.）
- Nano Expansion Board (Amazon/aliexpress.）
- DS1307 RTC (Amazon/aliexpress.）
- CR2032 Battery for RTC (Amazon/aliexpress.）
- TM1637 4位数显示屏（aliexpress.）
- 10mm RGB Common Cathode Diffused LED (Amazon/aliexpress.）
- Color Tactile Push Buttons (aliexpress.）
- 3 x 270-330欧姆电阻（aliexpress.）
- M2 x 4mm螺钉（aliexpress.）
- M2 x 8mm螺钉（aliexpress.）
- USB Wall Plug (Amazon）
- USB 2.0 Cable 5-Pin Mini-B 6ft (Amazon）
- Soldering Iron and Solder (if building components from scratch)
- Small Screwdriver
- 3.D printer
For the globe top there are two options: customize an existing design or design your own. I first started by using some designs I found and liked on Thingiverse. I took the downloaded STL from Thingiverse and imported into TinkerCad, then modified to add a sufficient base, resize, and even add wording as needed. As I became more confident in TinkerCad, I designed some of my own globe tops. The main consideration for designing or picking a design is that the outside structure of the design needs to support the entire globe. To allow the whole globe top to shine, we make it hollow by printing with zero infill and only outside perimeters.
- TinkerCad Files:星星那独角兽那尤达那Vader那玩具熊那Cloud那神秘机器那篮球那Temple那BB8
- Thingiverse Files:Light Up Clock
- 全球顶级Slicer Settings:
- Layer height: 0.16mm
- 没有支持unless needed
- Infill: 0%
Note: The Unicorn, Teddy Bear, Cloud, and Temple ones I designed from scratch. Please see the TinkerCad description or Thingiverse details for links to original designs and credit for the Star, Yoda, Vader, Mystery Machine, Basketball, and BB8.
The box case is custom designed for fitting all the electronic components. The box includes a separate bottom section and top section that are eventually screwed together. The clock display, buttons, and power connections are accessible on the outside of the box. There is also a small screw tab to 3D print for holding the switch inside the box. Then on top of the box sits whatever globe top you choose. Because the globe tops are of varying sizes, the box top may have a single customization needed to align the screw holes that hold down the globe to the box top.
最容易想到6个不同的部分或模块中的电子元件。每个模块中使用的跳线电线为10cm，另一端将连接到扩展板上的销钉。其中很少使用PCB板从头开始构建。该设计还使用两个4x6cm pcb板 - 一个沿着4cm侧切割*到5个孔，为LED模块，另一个沿着6cm侧切成4个孔，以便按钮模块。
- 这是时钟的大脑。Arduino Nano位于扩展板上的插座上，允许各种引脚通过跳线到其他5个模块暴露。
- The LED module includes the 10mm RGB LED, the 4cm section of PCB Board, along with 3 resistors (between 270 ohm and 330 ohm) and 4 jumper wires. This module is created by soldering the LED to the PCB board, with resistors soldered to each of the R, G, B leads. Then the 3 resistors and GND are soldered each to one end of 10cm jumper wires.
- RTC Module
- RTC模块包括DS1307 RTC，其中CR2032电池和焊接到SCL，SCA，VCC和GND的4个跳线电线。
- The button module includes 3 tactile push buttons, the 6cm section of PCB Board, and 4 jumper wires. The push buttons must be appropriately spaced according to the pictures/video to fit correctly in the 3D printed box. Each lead of the buttons should be soldered to the PCB board to prevent the buttons from moving around. Then the ends of 3 jumper wires are connected to each of the 3 buttons, and the fourth to GND for all 3 buttons.
- Clock Display Module
- 时钟显示器包括TM1637 4位显示器和焊接到CLK，DIO，VCC和GND的4个跳线电线。
- Switch Module
- The Switch Module is just the square self-locking switch with just the two pins identified in the pictures/video soldered to 2 jumper wires. (For ease of working with these wires in assembly, I typically shorten just these two to about 6cm each. Also, a few of the leads of the switch are removed according to the video to better allow certain connections on the expansion board.)
*笔记：For cutting PCB board using a dremel or saw or tile cutter, please be sure to follow safety precautions as PCB dust is not something you want to breathe.
Screwing in each Module
Once all the electronic modules are prepped and the box case is 3D printed, the clock is ready to assemble. Following the order below (and in the video) position each of the 6 electronic modules into their proper position in either the top lid of the box, or the box bottom. Each module is screwed in place to the box using the appropriate screws.(It is easiest to position all the modules first before connecting the component wires to the expansion board.)
- Arduino纳米和膨胀/突破板 - 这将其固定在盒子底部，其中两个4毫米螺钉在对角。
- LED模块 - 首先将LED放在盒子的顶盖，然后用两个4mm螺钉将PCB固定到盖子的下侧。
- 全球顶级- using two of the 4mm screws, secure the white globe top on the top lid of the box using the guide holes on either side of the LED module.
- RTC Module - secure to the top lid of the box using two of the 4mm screws.
- 按钮模块 - 用两个4毫米螺钉固定到盒子底部的右侧。
- 时钟显示模块 - 用两个4毫米螺钉固定到盒子的前侧。
- Switch Module - the switch slides into the square slot on the back left side of the box bottom, then is held in place with the 3D printed screw tab using one of the 8mm screws.
Blacking out the Built-in LEDS
The Arduino Nano comes with 4 built-in LEDS on the board that can often shine through the box bottom. To prevent this, simply cover the LEDS on the board with a small piece of electrical tape.
Wiring the Modules
First wire the modules in the bottom of the box by connecting the female jumper wires as follows:
- CLK - D13
- DIO - D12.
- GND - GND
- VCC - 5V.
- 右按钮（“菜单”） - D6
- 中间按钮（“+”） - D7
- 左按钮（“ - ”） - D8
- GND - GND
- Switch Module
- 连带 - D5
- 其他领导 - GND
- RED (to the single lead side of GND) - D11
- GREEN (immediate next to GND on to two lead side)- D10
- 蓝色（来自两个领先领域的GND最远） - D9
- GND - GND
- RTC Module
- SCL - A5
- SDA - A4
- VCC- 5V or 3.3V
- GND - GND
Closing the Box
注:最好的程序和测试时钟fore screwing the lid shut in case you need to troubleshoot or change any connections. Also, it is easiest to put the bottom 3 screws in their slots on the underside of the box, screw them in partway until you can just see them coming through the hole, then close and screw the rest of the way.
Step 4: Programming the Arduino
Next, connect the Light Up Clock to the computer using the Mini-B USB cable. Open theProgrammable_Color_Clock草图和编译和Ardu上传代码ino Nano. When the sketch is first uploaded the RTC is most likely not running yet. In the setup code it will automatically set the clock to the appropriate time on your computer, based on when the sketch was compiled. Also, as part of the initial first setup, the initial configuration settings are saved into long-term memory.
首次上传后，您需要发表评论//longTermSave();line in the setup function and recompile/upload again. This allows you to modify settings and alarm times with the buttons on the clock and when the clock is unplugged and it goes through setup again, it will not reset to the default alarms, but retrieve your saved settings.
Note: I have included all Library files just in case, but they should be standard except for a modified TM1637.cpp file where I added certain display digits for the 4 digit display. The bounce2 library can be foundhere。
Note: Here is an Instructable to getarduino.Nano CH340Drivers to work if you bought on Aliexpress.
Step 5: Customizing and Configuring Settings
Make it Glow Contest