WiFi 7 Segment LED Clock
Project: WiFi 7 Segment LED Clock
Date: November - December 2019
The 7 Segment Clock uses a common Anode 5V supply via 22ohm resistors based Shift Register control. The main reason for building this clock was firstly the reuse of two bedside clocks each with 4 X 7 Segment Displays and the second reason the inclusion of a Wemos R1 D2 board connecting to which is a bespoke Android Application. The Android Application uses WiFi communication to send and receive commands to and from the clock. The Android Application can “SET” the time and date of the clock and “GET” the current time, date, temperature, pressure, and humidity.
In addition, and the help from David at the Nixie Google Group who kindly provided me with a schematic of a suitable 74HC595 SPI 16 shift register and a 74HC245 Octal tri-state transceiver register based circuit to support the 8 X 7 segment LEDs using the multiplex method of display. A simple PCB board was constructed using two 74HC595 20 pin IC chips located on 20 pin carriers and two 74HC595 16 pin IC chips located on 16 pin carriers. The output of one side of the circuit was used to support the Anodes of each of the 8 x 7 Segment LEDs and the other side of the circuit was used to support the 7 segments, via 22ohm resistors in series, plus the decimal point.
Supplies
Equipment List
1. WEMOS R1 D2 Arduino card with on board ESP8266 WiFi module
2. Light Detecting Resistor plus 22ohm resistor
3. Two pole switch, coloured wires, PCB female plugs, heatshrink, PCB board, 3mm plastic supports
4. LED plus 330ohm resistor
5. BME280 temperature sensor
6. MP3-TF-16P player plus 22ohm resistor
7. 4 Ohm 5W speaker
8. 16 X 2 line LCD screen using IC2 communications (optional, used mainly for testing)
9. RTC Clock DS3231
10. 2 X DC Step Down 12V – 5V
11. 2 X 74HC245 IC Chip plus 20 chip carrier
12. 2 X 74FC595 IC Chip plus 16 chip carrier
13. 8 X 22ohm resistor
CONSTRUCTION
Attached are Fritzing diagrams of the clock construction showing the WEMOS card, LCD display, MP3 player, BME280 sensor, two step-down DC supplies, an RTC DS3231 clock, and finally Light Detecting Resistor. The second Fritzing diagram shows the Shift and Octal register-based circuit and its connections with the WEMOS. Three attachments cover the 7 Segments LED, 74HC245, and 74HC595 IC Chips.
The clock case was constructed from mahogany with 8 simple boxes constructed to surround each of the 7 segment LEDs. Each box is connected to the next using a 15mm steel tube which passes though each box and via a hollow mahogany box which connects the horizontal steel tube to a vertical steel tube that supports the clock display. The steel tube is fixed to the hollow box below which contains the clock support equipment. The wires connecting each LED are fed though each box and via the steel tube down to the clock system below, one set of eight segment control wires fed in one direction and the second set of eight wires, anode control, are fed in the opposite direction.
The various photos show the layout of the basic components onto the clock's base board. The use of a distribution board for both the I2C communications and 5V power has the advantage of only requiring two pins on the WeMOS board and allows two DC-DC step down 12V to 5V supplies to be used. The first supply to power the board, LCD, RTC, MP3 player etc., the second dedicated to powering the clock display and display driver circuit.
SOFTWARE
The attached files include the ICO Arduino source file and the Android App. The first ICO file contains code which allows the WEMOS to control the BME280, RTC Clock, and LCD screen. This project gave me the opportunity to build on an original Wifi Robot project. The WEMOS D1 R2 Arduino software was based on a previous clock where a Wifi communications package was added using a simple “GET” and “SET” host commands to firstly get the current clock values and secondly set the current clock date and time, as displayed on the App., is used to remotely update the clock. The second ICO file, "WifiAccesPoint" is a simple test routine to establish that the correct send and return strings are working correctly.
NOTE: Currently I cannot upload the following file "app-release.apk". I am waiting for the support team to fix this problem.
It should be noted that version 1.8.10 Arduino IDE has been used and the board selected was "LOLIN(WEMOS) D1 R2 & Mini". The following special libraries were downloaded: Wire.h, LiquidCrystal_I2C.h, SoftwareSerial.h, DFRobotDFPlayerMini.h, SparkFunBME280.h, RTClib.h, ESP8266WiFi.H, WiFiClient.h, and ESP8266WebSErver.h The Wifi access Point created by the WEMOS ESP8266 chip is called "WifiClock" and has a password of "password". It is possible to update the clock not using the bespoke Android App.rather using a standard web page viewer, with the "Wificlock" access point selected, and entering https command as follows:
For the SET command:
"http://192.168.4.1/SET?PARA1=HH-MM-SS&PARA2=DD-MM-YY&PARA3=VV&PARA4=Y&PARA5=Y"
Where time and date are entered using the standard format and "VV" is the 0-30 chime volume, first "Y" next to PARA4 is "Y" or "N" to select the chimes to be played option and the second "Y' next to PARA5 is "Y" or "N" to select the Night Save option which closes down the display during the hours of darkness.
For the GET command:
"http://192.168.4.1/GET"
This returns a string of data from the clock in the following format:
HH,MM,SS,DD,MM,20,YY,HHH,HH,PPP,PP,CC,CC,FF,FF,VV,Y,Y
Where "HHH,HH" is the humidity reading, "PPP,PP" is the pressure reading, "CC,CC" is the temperature in Centigrade, "FF,FF" is the temperature in Fahrenheit, "VV" is chime volume, "Y," is chimes required, and the second "Y," is Night Saving required.
It should be noted that the Tablets' Location Services must be enabled otherwise the WiFi scan button will not return any available networks including of course the WiFiClock network.
PROJECT OVERVIEW
This has been a very interesting project as it has brought together two new elements, namely the use of Wifi as a method of updating the clock, rather than use of a keyboard. Secondly the use of a Shift and Octal register based control circuit for the 7 segment displays. I find it of great satisfaction to be able to re-use old redundant equipment and bring it back to life.The development of an Android based Application allows the clock to be viewed remotely, although a 20 meter range limit, is all that can be expected from the WeMOS ESP8266 chip and its limited power. An alternative to the shift based display driver I have used is one using the MAX7219 IC display driver chip which is designed to provide the 5V supply to 7 segment based displays.
My next project's components have arrived these include old new stock IN-4 Russian Nixie tubes and INS-1 Neon tubes. I intend to return to the MAXIM range of IC driver chips and string together four of these chips in order to drive the IN-4 and Neon based displays.