Introduction: NTP Synchronized Alarm Clock
This is my first instructable and English is not my native language so please be patient.
I wanted to build an NTP alarm clock with an RTC that will be synchronized from the internet.
The clock is a led dot matrix RTC clock based on the famous ESP8266 that is synchronized to the NTP server.
Despite the clock is very nice it lacks some functions I like so I added some.
1. Alarm function with a separate display.
2. Auto brightness.
3. External reset button if clock is stack and need reset.
4. Changed the month to a number and not a word (I like it that way)
5. On startup if WiFi connection failed and the RTC time is valid the RTC time is displayed.
6. A blue led will lit if there is a WiFi connection.
7. WiFi ssid and password is not hard coded, you can change it thru a web page.
8. If after 24 hours it can't update from NTP server the ESP8266 will try to reconnect to WiFi .
9. Alarm stop switch is a touch button
Step 1: Step 1 : Parts and Tools
4 + 2 x 8x8 MAX7219 LED Matrix (like this)
1 x RTC DS3231 (like this)
1 x ESP12 Board (like this)
1 x single touch button (like this)
1 x LDR module (like this)
1 x I2C PCF8574 module ( I used an I2C to LCD module like this)
1 x Sparkfun Serial led display ( I used yellow but blue is nice)
Prototype PCB 65.5mm x 210mm ( I made it from two parts )
1 x very chip alarm clock to remove the ringer ( like this)
1 x plexiglass pip 80mm Diameter outside 74mm inside 213mm length .
1 x 5.5mm X 2.1mm DC Power Supply Metal Jack Panel Mount.
4 x push buttons.
1 x on/off switch.
1 x blue led and 1k resistor.
1 x 470uF 16v capacitor.
1 x Window tint film.
1 x 5v 1A power supply.
and general tools.
Step 2: Step 2 : Preparing the Display
I got two units of 4 blocks each so I cut one to half and got a 6 block display ,if you prefer you can buy 6 single blocks and stitch them together (pay attention that Dout of one block is connected to the Din of the next).
After you have a 6 block display ,assemble it on the prototype PCB, I used screws,spacers and bolts, if you like a quick solution you can use double sided tape.
Next we need to assemble the alarm display under the main dot matrix display, take a look at the pictures.
At the left of the alarm display I soldered the blue WiFi led.
Step 3: Changing the ESP8266 Module to Use External Antenna .
I have difficulty to get a good WiFi connection in the room that the clock is used ,so I changed the ESP8266 module to use an external antenna.
If you don't have problems with WiFi connection you can use the original antenna.
Step 4: Assembling the Other Stuff
On the back of the prototype PCB we will assemble the ESP8266 ,RTC and the PCF8574 modules.
I soldered sockets so I can plug and unplug the modules.
Also you need to assemble the LDR module so the sensor can sens the ambient light.
Last add the touch switch in a convenient place so you can easily reach it to stop the alarm.
Step 5: Connecting Together All the Stuff
Please take a look at the schematic, its not complicated ,its only connecting wires from one module to the other.
If you have a difficulty to read the schematic here is a text description:
MAX7219 to ESP8266
VCC - 5V (note 1)
GND - GND
CS - D8
DIN - D7
CLK - D5
DS3231 to ESP8266
GND - GND
VCC - 3.3V
SDA - D1
SCL - D2
Sparkfun serial 7 segment display to ESP8266
VCC - 5V (note 1)
GND - GND
RX - D4
LDR light sensor module to ESP8266
VCC - 3.3V
GND - GND
OUT - A0
WiFi led catode - D3 , anode to 3.3V with a 1k resistor
(I used a 1k resistor because I wanted the led to be dim)
Ebay PCF8574T I/O Fr I2C Port Interface Support Arduino ============================================
P0 - hour up button
P1 - hour dn button
P2 - minute up button
P3 - buzzer (I used a electronic buzzer from a chip alarm clock cost ~ $1)
P4 - minute dn button
P5 - alarm ON/OFF button
P6 - add 1 hour for summer (only for Israel) (note 2)
P7 - alarm stop touch button
SDA to SDA of the RTC
SCL to SCL of the RTC
GND to GND
VCC to 3.3V
All buttons connect one side to port and the other side to GND.
Note 1 - All 6 blocks of the led matrix and the alarm display are connected to 5V
Note 2 - The switch that is connected to P6 of the PCF8574 is only needed in my country because the summer time is not always in the same date like the rest of the world so I can add an hour if needed.
The power to the clock can be supplied in two ways:
1. connecting a USB cable to the ESP12e module and taking the 5V for the displays from the VV pin of the module.
2. input 5V through a dedicated connector (like described in the schematic) ,connect the 5V to the dot matrix modules and alarm displays and to the Vin pin on the ESP12e module.
If you use option 2 you need to connect an 470uF 16V capacitor between the 5V and GND.
I also connected the reset to a push button that I can reach from the outside of the clock with a pin.
Notice the voltage of each module !!!
Step 6: Software
Attached is the Arduino sketch, I put a lot of comments so I believe it will be clear .
If you don't know how to program the ESP12e with the Arduino IDE please google for it.
Step 7: The Box
I made the box from a Plexiglas tube 210mm long that I covered inside with a Window tint film (used in cars).
The two side covers I made from Delrin that I machined with a CNC milling machine (perhaps it can be done with a 3D printer).
I have only DXF files for the covers that I used for the CNC programming .
If someone need the DXF files please send me a note.
Of course you can make a different nice box for the clock.
Step 8: The Finished Clock.
The finished clock can be seen Here