Clocks on matrices. Homemade clocks on LED matrices

On the Internet, there is no shortage of various kinds of electronic watches. The clock looks solid on matrix indicators, for example, the well-known scheme from a radio cat, but I wanted it to be with an indication of not only hours and minutes, but also seconds. I decided to create such a watch, adding some other functions.

The electronic clock presented here, in addition, allows you to measure the temperature in the room. There are four independent alarms, as well as a calendar events indicator that signals the onset of events such as an anniversary, birthday, etc. Allows you to change the brightness in manual and automatic mode, which dramatically improves the comfort of perception in the dark, and finally, they are controlled by any remote control from the BRA or by local buttons.

Main characteristics:

  • Supply voltage (V) ………… .…………………... 5
  • Current consumption (mA) …………………………………. 100 - 200
  • Total matrix size (pixels) …………………… 8 x 40
  • Limits of the measured temperature (degrees) …….…. -40 - +99.5
  • Temperature measurement accuracy (degrees) ……….. 0.5
  • Limits of daily course correction (seconds) …………. -9.9 - +9.9
  • The number of gradations of brightness change …………………… 31 + “auto” mode
  • Number of alarms ………………………………. four
  • Volume of text of each alarm (characters) ……….. 11
  • Number of event indicators …………………….. 14
  • Volume of text for each event (characters) ....……. fifteen
  • Mode control …………………………………. Buttons / any remote control

The circuit diagram of the clock is conditionally divided into indicator and "controller" parts, shown in the figures below. The numbering of the elements is the same and further, in the description, we will consider the circuit as a whole.

Display scheme

Control scheme

The actual control of the registers is carried out through three ports of the microcontroller (MK) DD7, in interrupts from the TMR0 timer with an interval of 2 ms, which provides a total information change frequency of 63 Hz. Also, a PWM signal is supplied from the MK to pin 9 of DD6 (on-off outputs) to change the brightness of the indicators. MK DD7 was chosen as PIC16F88, which differs from the popular PIC16F628A in the presence of an ADC and twice the program memory capacity. The MK operates from an internal oscillator at a frequency of 8 MHz (another difference from the 628A).

The device uses a real-time clock chip DS1307, which provides counting and storage of seconds, minutes, hours, day of the week, date (including year from 0 to 99). During the initial initialization, the DS1307 is configured in a mode in which a square wave with a frequency of 1 Hz is present at pin 7, which is fed to the RB0 input of the MK. An interrupt is enabled on this input, where a special flag is set once per second. In the main program, using this flag, the main actions are performed once per second: reading data from the DS1307, indicating the time, checking for a match between alarms and event indicators, setting the brightness in automatic mode. The additional battery BAT1 allows you to store data in the absence of the device's supply voltage for an almost unlimited time. The MK controls the DS1307 via the I2C bus with ports RB1, RB2. The temperature sensor is also controlled by I2C - the DS1621 microcircuit.

The device is controlled using buttons S1 and S2, connected respectively to the ports MK RA4, RA2. The functions of the S1 button can be performed using any remote control from the ABR using the circuit on the DA1 type TSOP48 receiver and a single vibrator on the DD8.1 D-trigger and elements C8, R47 and D1. The duration of the single vibrator signal is selected as 0.2 s, which ensures the conversion of bursts of short pulses from the DA1 output into pulses of this duration with a short press and into a continuous signal while holding down any button on the remote control. The signal from the inverse output of the trigger through the diode D2 duplicates the button S1. With the help of elements R48, HL6, an indication of this fact is organized.

On the second trigger of the DD8.2 chip and the piezoceramic emitter LS1, an audible alarm circuit is assembled when an alarm clock or event indicator is triggered. The counting input of the trigger receives a PWM signal from the output of the MK with a frequency of 8 kHz. With a logical 1 signal at the combined inputs R and S of the trigger, there is a log.1 on both outputs and there is no sound. When an indication event occurs, the MC changes the level at these inputs with a frequency of 1 Hz, and antiphase pulses with a frequency of 4000 Hz appear at the trigger outputs with this frequency. Since this frequency is resonant for this radiator, a loud intermittent signal is produced. Measures have been taken programmatically to save the PWM pulse even at extreme brightness values.

A light sensor is assembled on elements FR1, R45 and C6. The MK, using the built-in ADC, reads the lighting-dependent voltage from this divider and sets the appropriate duty cycle of the PWM signal.

The device is powered by a voltage of + 5V supplied to the J1 connector and then through the filter circuits R41C3C4, R42C5, C7R46 to the circuit elements. The R49 D3 circuit protects the device from accidental connection of excessive or reverse voltage. It is convenient to use a 5 volt smartphone charger as an IP.

The device is assembled on a printed circuit board made of fiberglass with one-sided metallization with dimensions of 60 mm by 170 mm

DD1-DD5 are used in SO16 package, DD6 - in SOIC20 package. DD8 is used in DIP package. It can be replaced by the domestic K561TM2. DD9, DD10 - in SO8 cases. Almost all SMD resistors and capacitors are size 0805, C1,C7,C3,C5 - size 1206. It is better to solder a quartz resonator from an old motherboard - they are usually more stable. Photoresistor FR1, when replaced with another one, should have a dark resistance of about 1 - 2 MΩ. The BAT1 battery type CR2032 is mounted on a standard holder. It can be replaced by any suitable size voltage of 3V. When replacing a piezo emitter with another one, it is highly desirable that the resonant frequency be close to 4000 Hz. The photodetector can be soldered from an old TV. LED - any bright, red glow. Diodes can be replaced with KD521, KD522. Zener diode - voltage 5.6V and preferably with a power of at least 1 watt. Since the applied matrix indicators turned out to be with a common anode, it was necessary to install them with a 90-degree rotation during the development of the board and use the rows as columns and vice versa. When replacing with indicators with a common cathode, for example 1088AS, you will have to completely change the wiring diagram. Buttons - any clock, angular. When closing the indicators in front with colored plexiglass, erroneous responses were observedDA 1 reflected brightness signal from the indicators. This effect is easily eliminated by gluing a black paper screen between the indicator and the photodetector.

A properly assembled device usually does not need to be adjusted. However, if the existing dependence of the illumination and the corresponding brightness of the indicator in auto mode does not suit you, you should choose the value of the resistor R45. In this case, a lower resistance corresponds to a lower brightness for a given illumination.

The appearance of the assembled board is shown in the photographs.

The reason for the not very beautifully soldered current-limiting resistors is that after the manufacture of the board, it turned out that the nominal value of these is not 0805, but 1206. I had to somehow solder ...

The controller control program is written in C language and translated in the MikroC for PIC environment. The configuration word is contained in the firmware and is entered automatically. The author's orientation of the clock - the matrix is ​​on top, which minimizes the possible impact from the details of the circuit on the temperature of the DD9, DD10 microcircuits. However, if someone likes the location of the clock with matrices down, you should change the value of the parameter in the very first line from 1 to 0 in the file “watch.c” before translating the program, according to the comment. The firmware is attached for both cases. It is also possible to change the font of numbers to thin (bold by default), similar to letters (this, by the way, will slightly reduce the current consumption in the initial mode). To do this, in the first line in the “font.c” file, you need to change the value of the “font_2” parameter from 1 to 0.

Now let's move on to the description of the watch modes and work with them.

Immediately when turned on, the clock goes into the main mode - time indication. At the same time, the digit of hours and minutes is 8 pixels high, and seconds - 7 (in general, each digit or letter is displayed in a 5x8 pixel field, seconds digits - 5x7). When you press the S1 button or any button on the remote control (these actions are equivalent, and further we will keep in mind that when it comes to pressing the S1 button, the same happens with a signal from the remote control), the current full date and day of the week are displayed using a creeping line. If no further action is taken, after 16 sec. the device returns to its original state - time indication. If you press the S1 button again during the date display, then the temperature display also starts by means of a running line for 16 seconds. (pressing the button again - return to the initial state immediately).

By continuously pressing the S1 button for 9 seconds, the watch switches to the "MENU" mode, as indicated by the corresponding inscription. Such a long press was chosen for this in order to reduce the likelihood of accidentally entering the menu during normal use of the remote control (actually for controlling household appliances).

This is followed by a small digression - we will explain the work with the buttons in general. The clock is controlled in such a way that all actions with them can be performed using only the S1 button (or remote control). After all, the clock can hang high on the wall, and access will only be to the S1 button (via the remote control). So, sorting through the menu items, as well as sorting through the list of alarms or events, is done by short (up to 3 seconds) pressing S1, and the transition to the selected item is done by a long (more than 3 seconds) pressing. No impact for 15 - 30 sec. (depending on the specific mode) – return to the initial state. In the same place where the value of a parameter changes, a short press increases the value not by 1, but by holding it for more than 2 seconds. - the value increases automatically about 3 times per second. Here, the absence of influence for some adjustable (from 5 to 8 seconds) time leads to the transition to the next parameter while maintaining the current parameter. This is where you can use the S2 button - to save the parameter with the transition to the next one without waiting, immediately. So, holding the watch in your hands can significantly speed up such manipulations.

Let's go back to the menu item. There are five items here: INSTALLATION, CORRECTION, ALARM CLOCK, EVENTS, SETTINGS. Let's talk about each in order.

INSTALLATION. This is where you set the current date and time. The parameter to be changed is initially highlighted by inversion, which disappears with the onset of changes. The values ​​change only upwards, with the transition from the maximum value (when it is reached) to the minimum and then in a circle. At the very end, when the date and hours with minutes are set, there will be inverse zeros in place of seconds. Here, at the moment of resetting the reference seconds, press S1 and the clock will go to its original state with the changed date and time.

CORRECTION. Over time, inevitably there is an error in the course of the clock. This paragraph serves to correct it. Preliminary it is necessary to measure the “leaving” of the watch for 10 days. Let's say the clock is 58 seconds faster. We then enter this mode, as indicated by the line “care for 10 days”. When you press S1, the line is replaced by a static inscription "XX sec", where XX is the current correction value, let's say 31. Since the clock is in a hurry, we subtract our 58 seconds from this value. (if they lag behind, we add). Gaining received (-27) sec. After the exit, this value will be saved in EEPROM. The interval of input values ​​is from -99 to 99, the sign changes when passing through 0. The correction takes place every day at 00:00:19, for which the whole of one tenth of the correction value (in our case (-2)) is added to the current time, and the remainder (we have (-7)) is stored in EEPROM and the next time it is added to the coefficient before processing. That is, in a day, 3 seconds will be subtracted from time and (-4) (-27-7 \u003d -34) will remain.

ALARM. When you enter this item, a line runs on the screen, consisting of: number (1-4), sign of inclusion (“+” or “-“), response time, name of the alarm clock (text of 11 characters). By default, for example, in the second alarm clock, there will be data: “2. - 12:00 ALARM CLOCK-2. With short presses, you can switch from one alarm to another, with a long press you can go to the current alarm, where you can change the data, enable or disable, select activity for each day of the week, set the response time, change the text name by typing the characters of each position. All information about four alarm clocks is stored in the free memory of the DS1307 chip (56 bytes). If the current time coincides with some alarm clock that is turned on and active on this day of the week, a line with data about this alarm clock is displayed, with an intermittent sound signal, for one minute. The alarm signal can be "early" interrupted by pressing the S1 button.

DEVELOPMENTS. When you enter this item, on the indicator with short presses of the button, active events alternately run through plus the “ADD NEW” item. By default, there are no active events, therefore, there will only be an invitation to add a new event. Active event format: "<дата> <текст из 16 знаков>". When all 14 events are active, the "ADD NEW" item is not displayed and a new event can only be added in place of any of the existing ones. Long press to switch to event editing mode. Here you can enable or disable, change the date, as well as write your own text corresponding to this event. All changes are stored in the MK's non-volatile memory (EEPROM).

The current date is checked for coincidence with the event dates every day at 8:00, and if it matches, a string is displayed from the current date and the text of the event with an intermittent sound signal for one minute. Such a signal will be given every hour until 19:00, provided that it has not been interrupted by the button. The signal interrupted by the button is no longer repeated.

SETTINGS. When entering this mode, a message like "BRIGHT.XX" is displayed on the screen, where "XX" is the current brightness. By pressing the S1 button, this value can be changed in the range from 1 to 31, or set to “AB”, which means “automatically”. When you change the brightness value, the actual brightness of the indicator immediately changes visually. If you save the automatic mode, the brightness of the clock display subsequently changes without intervention, depending on the level of light in the room. In this case, we get to the item for setting the minimum brightness for auto mode (“MIN.XX” is displayed). This value is best set in conditions of the minimum expected illumination. If a specific numerical brightness value was set in the previous paragraph, this paragraph is skipped.

The next setting item is to adjust the waiting time before saving the values ​​of various kinds of variable parameters in the range from 5 to 8 seconds. With the minimum value of this parameter, there is a danger of storing erroneous values, with the maximum value, the total time for entering data from the remote control increases. The user chooses a value that is comfortable for him.

All settings are stored in the EEPROM memory of the MK and are not lost in the event of a power failure.

In the application, in addition to the source code and firmware, there is a Proteus model and a board in the Lay6 format.

List of radio elements

Designation Type of Denomination Quantity NoteScoreMy notepad
DD7 MK PIC 8-bit

PIC16F88

1 To notepad
DD1-DD5 shift register74HC5955 SOP-16 To notepad
DD8 Dual D flip-flopCD40131 K561TM2 To notepad
DD9 Real time clock (RTC)

DS1307

1 To notepad
DD10 temperature sensor

DS1821

1 To notepad
DA1 PhotodetectorTSOP481 To notepad
DD6 Powerful shift registerTPIC6B5951 To notepad
LS1 Piezo buzzerXCFT-14A1 To notepad
HL1-HL5 LED Matrix1088BS5 To notepad
HL6 Light-emitting diodeARL-35141 red To notepad
X1 Quartz resonator32768 Hz1 To notepad
BAT1 lithium batteryCR20321 3V To notepad
D1-D2 Diode1N47482 To notepad
D3 zener diode

1N4734A

1 To notepad
S1, S2 Clock buttonangular2 To notepad
FR1 photoresistorNCL-49521 To notepad
R1-R40 Resistor

220 ohm

40 0805

On the topic of homemade watches, and promised to continue, so if you please. Watches on homemade LED matrices.
, and

This was done in order to try to make a segment clock, based on three LEDs per segment 7 * 4 * 3 = 84 + 2 = 86 pieces

It's roughly like this:

I wanted to try different colors and definitely bright (but how else?)

According to this, parties of 100 pieces suited me quite well, especially since the price is quite acceptable, and I also ordered it in the same store - to make multi-colored numbers so that you can compare colors on one display - which one will be more beautiful, well, and so - have fun … :)

Item ordered and paid for August 20, 2016, and arrived September 15, 2016, by our standards quite quickly. BUT! Red LEDs - did not come! At the end of the buyer's protection period, a dispute was opened and the seller returned the money. It was just a waste of time...

The product came in a standard yellow-and-pimpled postal envelope, the LEDs themselves were packed in a separate plastic bag, the number of pieces in blue, green was a little more than 100 (I don’t remember exactly now, but I remember that there were 4-5 more pieces)

All workers (i.e. glow)

In those that are multi-colored - it was packed in separate bags, on which the color R G B W Y was marked with a marker - the color matched everywhere, and also 2-3 extra ones - it seemed that everyone probably did, but later I was convinced that not always so it happens and vice versa...

If it weren’t for the jamb with red, the seller could have put a fat five with a plus for non-greed.

On the other hand, the money was returned - the problem is lost time, and he also sent a letter where he wrote that he was returning MY money to me, and if the goods arrived, he asked me to return this amount to him

Verbatim:

Hi, my friend, I am now a refund, when you receive a package, please return my money, Please give me a five-star high praise.

To which he had to roll a letter that it was not HIS money, but he just returns me as a result of a dispute MY money, because I never received his goods and at the same time lost a lot of time waiting for his goods

By the way, when all the other orders from him arrived, 10 days later, I wrote to him that they say I'm worried, because. it's strange - everyone came, but one of the orders did not come

To which he, without any “hello friend”, dryly replied “60 days have not passed yet”

And then suddenly he became a “friend”, and it seems like HIS money and raped ...

But in general - the seller fulfills his obligations, responds to letters, from the sent goods - only positive emotions, money for not sent returned - everything is according to the RULES

Well, now about what it was acquired for

Homemade clocks on homemade LED matrices

Clock + radio + weather + remote control

I have long wanted to make a clock on RGB matrices. GMT2088 matrices were found and ordered. But as they say, appetite comes with eating. Since even just a colored watch is boring, it was decided to put an FM tuner, an equalizer, humidity, temperature and pressure sensors into them. It is also possible to operate from batteries in case of loss of the main mains voltage.

The result is this watch:




In the red LEDs, you can notice 4 luminous dots, it’s not quadrupling in your eyes and it’s not a camera glitch, just two films are inserted in front of the matrices that are in front of the monitor’s LCD matrix and the diode glow is divided into 4 parts. If you play around with the location of the films relative to each other, you can get many different displays. The quality of the photo is lame but the basics are visible.

Clock settings options:

1. The color of the display of the received radio station. For the whole and fractional value of the station, you can set your own color.

2. Customize the color of the ticker.

3. Change the speed of the running line.

4. Clock display color setting. You can set your own color for each character.

5. Radio range 65MHz to 108MHz. Stores up to 20 radio stations in memory.

6. The sound for each station is saved separately as well as the equalizer settings.

7. Alarms 7 . Configurable turn-on time, turn-off time, sound volume, turn-on days, increasing sound or not, and the radio station or buzzer to be turned on.

8. Adjustment of LF and HF frequencies.

9. Clock display font selection up to 8 fonts, you can upload your own fonts.

10. Automatic or manual adjustment of the brightness of the matrix.

A) Fully automatic depending on the illumination

B) Manual keys on the remote control or the watch itself

C) At the appointed time. Sets the minimum and maximum brightness turn-on time.

11. Control of a charge of a reserve battery of hours.

12. Clock control with remote control. Made it possible to learn the remote control (NEC, RC5, SAMSUNG formats)

13. Made 6 options for replacing the character when changing the time. (More options will be added later)

14. Control of the main supply voltage. When it fails, it switches to a backup battery, when it appears, it turns off the battery.

15. Off timer with a maximum interval of 99 minutes. Turns off the radio sound.

16. Setting the minimum and maximum brightness limit.

17. Forced display of a creeping line with information about the temperature in the room and on the street

The software is completely written in assembler and AVR Studio. Maybe somewhere the program is not written very competently, because I took up assembler for a little more than a year, and then only in my free time, but the main thing is that it works stably and quickly.

The heart of the device is the AVR Atmega32 at a frequency of 16 MHz. The clock is made on two boards. On one matrix with strapping. On the second everything else.

Column matrix control is given to the STP16CP05 registers in the TSSOP-24 package. These registers have 16 outputs and load each output up to 80mA. String control decoder 74HC138. Field-effect transistors IRF7314 are installed at the output of the decoder.The RGB modules were not soldered into the board, but were installed in the connectors.

This clock uses a real-time clock chip DS3231. The choice fell on her due to the fact that she does not need an external quartz, because a fairly accurate quartz resonator with temperature compensation is built into it and a temperature sensor is also built in.

FM radio is implemented on the RDA5807 chip. This chip has a fairly good sensitivity.

A ready-made AM2321 module is used as a humidity sensor. Ready-made BMP180 module as a pressure sensor. These sensors also have a temperature sensor.

BMP180 sensor:

AM2321 module:


The TEA6330T chip is used as an equalizer. She is responsible for adjusting the volume and setting the bass and treble frequencies.

The power amplifier is made on PAM8403. Small chip but delivers enough power. Speakers 8 ohm 2W are connected to the output. You can also connect 4 ohm speakers. At 8 ohms, the output power is approximately 1.6 watts. At 4 ohm speaker 3 watts.

The watch is designed to run on battery power. A battery brand L12T1P31 3.7V 3700 mAh was installed.

When the mains voltage fails, the brightness of the matrices is automatically adjusted to a minimum. If there was an automatic brightness control mode, then it is replaced by manual. The ability to adjust the brightness in the absence of mains voltage remains. You can also enable auto mode. When the mains voltage is restored, the brightness will return to the level that was set before the power failure.

Battery life in clock mode with reduced brightness is approximately 15 hours. Operating time with maximum brightness, wide font, average radio volume is about 5 hours.

Implemented battery voltage control. Because the internal controller of the battery turns it off when the voltage is below 2.5 V, and when the voltage drops below 3.2 V, the converter starts to work incorrectly and its output is only 5V. The clock goes into an endless reset. Therefore, a voltage threshold of 3.2V was chosen so as not to be lowered to the minimum voltage for the converter. If the voltage drops below 3.2V, the clock will be de-energized.

The board provides for the possibility of installing a specialized voltage control microcircuit of the BU48xx type. In this circuit, BU4832 controls 3.2 V.

Battery charge control is assembled on ms TP4056. The voltage converter from 3.7v to 12v is assembled on the LM3488.

It is possible to install both 3- and 2-pin batteries. If you do not need battery temperature control, then we do not install some of the elements (for details, see the diagram). All circuit boards and firmware are at the end of the article.

A divider is assembled on the elements R13 R14 to control the voltage of the backup battery.

On the elements R1 R10 R11 R12 a divider is assembled to control the illumination in automatic mode.

A level matcher is assembled on the elements of Q1 Q2 R19-R22, because some ms are powered by 3V, and some by 5V.

To start the circuit of the main module, the RGB matrix module and the outdoor temperature sensor module

Several photos of the finished RGB matrix board. Boards made of double-sided fiberglass. Some improvements were made during the debugging process. Therefore, some photos are slightly different from the boards that are in the archive. In the archive, all changes are taken into account.

Bottom side of the board:


On the underside, the 2.4 kΩ resistors are simply soldered onto the pins.

Upper side without installed matrices:


Side view:


View from above:


Effects of changing numbers (not all effects are shown in the video)

Clock management


When you turn on the watch for the first time, you can only control it with the buttons. To be able to control the remote control, you need to teach the clock signals from the remote control. To do this, hold down any of the control buttons and press the "Reset" button.The scrolling line "Setting the remote control" will run and we will see the display of the first format of the remote control - NEC. By default, the first NEC protocol is displayed on the matrices. Browse through protocols by pressing any of the buttons on the back of the watch. Protocols change in a circle NEC - Samsung - RC5.




As I wrote above, the NEC protocol is set by default. We take the remote control and press any button on it. If the selected protocol and the protocol of the remote control match, the inscription will turn green and then the device will go into the learning mode of the remote control. If the protocols do not match, then there will be no changes on the matrices and the inscription will remain blue. We rearrange to the next protocol and press again any button on the remote control.
The definition of the protocol should work from the first press of the remote control button. If it works from the second pressing of the remote control button or more, then the protocols do not match and you need to select another protocol.
Since the NEC and Samsung protocols are a bit similar, the NEC format remote control can be trained in the Samsung protocol mode, but you will need to press the same button twice. In the future I will try to correct the intervals for measuring pulses and perhaps this will be removed.

The RC5 protocol is the simplest. In this mode, you can train any remote control, but it will not work normally. In this mode, only the remote control of the RC5 protocol will work normally.
A lot of articles have been written about the difference between remote control protocols and I will not describe all this here.

After defining the protocol, the program will switch to the learning mode of the remote control buttons. The matrices will display which button to press. In standby mode, the color of the symbol will be blue.


We press the button on the remote control. If the data is received successfully, the color of the symbol will turn green:


If the data is received with an error, the color will turn red for a couple of seconds, and then the device will switch to waiting for the button to be pressed again.


After the last requested button is pressed. The clock will enter the main mode of operation. If no sensor or real-time chip is installed, the running line "No sensor found" will be constantly displayed. If you do not install DS3231 and install any of the sensors, then only flashing dots will be displayed on the matrices.

Further description will be for the remote control. There will be a separate description for controlling the buttons, because using the remote control you can go directly to the desired menu, and using the buttons only a sequential transition from the beginning to one menu, then to another, and so on in a circle.

After setting up the remote, we will see the displayed time. From this mode, you can go to different menus. The program provides control of installed TEA6330 and RDA5807 chips. If some microcircuit is not installed, then it will not be possible to go to its settings menu and the corresponding running line will be entered either "Equalizer not found" or "Radio not found".

Description of the operation of the remote control buttons:

On / Off button - turn on - turn off the matrix

Up arrow and down arrow buttons - adjust the brightness of the matrix or change data in the setting mode. The brightness of these buttons is adjusted in all menus.

Left arrow or right arrow button - change the font in the time display mode, and in the alarm setting mode, move through the alarm submenu

Button "1" - menu "Clock"

Button "2" - menu "Radio"

Button "3" - menu "Alarms"

Button "4" - menu "Equalizer"

Button "5" - display of the running line

A) one click display of information from all sensors

B) two presses within 3 seconds display only the outdoor temperature.

Button "6" - menu "Off timer"

Button "8" - setting / resetting the minimum and maximum brightness

Button "9" - reset seconds and time correction via the Internet

Button "0" - automatic or manual brightness control

Button CH + and CH - scroll through radio stations in FM mode

Button sound + and sound - volume control

Button On / Off sound - turn on turn off the sound

"MENU" button - go to the main settings in time mode, go to radio settings in radio mode and alarm settings in alarm mode

"ESC" button - exit from the submenu

Transition depending on what mode the device is in. If it is in the "Time" mode, then the transition will be in the main settings. If in the "Radio" mode, then go to the radio settings. If in the "Alarm Clocks" mode, then in the alarm settings

"OK" button - confirmation of changes in setting modes

The clock has 8 fonts for displaying the time. Switching between fonts using the "Left" or "Right" buttons on the remote control or S6 on the clock board.

Wide font example:


Narrow font example:


Adding your own fonts

Fonts are stored in EEprom. A maximum of 8 fonts can be uploaded.

The font was created using PixelFontEdit-2.7
The font itself and the Eprom source for Atmel studuo6.2 are in the archive at the end of the page.
Fonts are added from the label eeFront1:
Number of fonts no more than 8, will not fit anymore. The program itself will determine the number of downloaded fonts.
Fonts must end with the line .db "E","N","D" signifying the end of fonts.
Letters END may be large or small but Latin.
Compile the EEprom file and flash it. You can immediately fill in all your values ​​​​in EEprom in it with detailed comments for each line.
Also in the font it is set what will be the points separating the hours and minutes. It is set only in the first character of each font.
In the first character, if bit0 of the first byte is set, then it will be double, if it is reset, it will be single.

Settings in time display mode

In this menu, change the parameters with the "Up" and "Down" buttons, confirm the changes with the "OK" button. You can exit the setup at any time by pressing the "ESC" button.

We press the "Menu" button, the running line "Basic settings" will run, then the line "Radio color". The whole part of the FM range will flash, use the "Up" or "Down" buttons to set the desired color and press the "OK" button. The fractional part of the FM band will flash. Also set the desired color and click "OK".



If installed color option for the running line as in the photo:


Then, when the scrolling line is displayed, its color will be new each time.

Next, the line "Setting the clock" will run. The hour value will start flashing. Use the "Up" or "Down" buttons to set the current hour and press "OK". The minutes will start flashing. Use the "Up" or "Down" buttons to set the current minutes and press "OK".


Next, the line "Clock color" will run. In this menu, you can set a different color for each clock symbol. Select a color using the Up or Down buttons. There are 7 color options in total. The eighth option is a multi-colored symbol with alternating colors. Once you have chosen the desired color, press the "OK" button. Next, set the color for the following characters and click "OK".


Use the "Up" or "Down" buttons to set the current date and press "OK".




Next, the line "Setting the day of the week" will run. The days of the week are displayed in the abbreviation Sun-Sunday, Sat-Saturday, Fri-Friday, etc. Use the "Up" or "Down" buttons to set the current day of the week and press "OK". This completes the basic setup.


Next, a scrolling line will run with the current day of the week, date, year, pressure, temperature and humidity. The device will enter the time display mode. In this mode, a ticker displaying information about the temperature, pressure and humidity in the room will be displayed after about 4 minutes. Output of information from all sensors button "5" RC. A line about the temperature and humidity on the street is displayed once every 15 minutes (you can set the desired interval yourself, more on that below.) If for some reason a sensor is not installed, then information from this sensor will not be displayed in the running line. Since there is a temperature sensor in all three sensors, the data will be read from the sensor that is installed. By default, the temperature is read from the DS3221.

Radio mode.

The transition to this mode is carried out by pressing the button "2" on the remote control. Radio range 65MHz - 108MHz.

In this mode, the ticker also runs after about 4 minutes.

The following menu is displayed:


The first four digits are the frequency of the received station. The letter "M" or "C" is the received mono or stereo signal. Under the letter in red is the level of the received signal. The volume is displayed at the very bottom. Scroll through the tuned stations with the "CH +" and "CH-" buttons, and adjust the volume with the "GR+" and "GR-" buttons. The volume value is saved for each station individually. Also, for each station, the treble and bass equalizer settings are saved separately. To switch to the equalizer mode, press the "4" button on the remote control (the description of the setting is just below).

To switch to the radio settings mode, press the "Menu" button on the remote control. The running line "Radio settings" will be displayed.

The letter indicating Stereo or Mono will turn red. In playback mode, it is blue. If no button is pressed within 15 seconds, the device will switch to radio playback mode.


Changing the frequency of the station is carried out using the "CH +" and "CH-" buttons and the "Left" "Right" buttons on the remote control.

In the range of 76-108 MHz, the "Left" and "Right" keys change the range by 1 MHz, and the "CH-" and "CH +" keys of the remote control change by 0.1 MHz.
In the range of 65-76 MHz, the "Left" and "Right" keys change the range by 0.1 MHz, and the "CH-" and "CH +" keys of the remote control change by 0.01 MHz.

Adjust the volume with the "Gr+" and "Gr-" buttons. After selecting the desired frequency and volume level, press the "OK" button. The box for the current station entry will be displayed. If there is already a recorded station in the cell, then its number will be in red.



If the cell is free, it will be green.


Select the desired cell with the "CH+" and "CH-" buttons. A total of 20 cells are available for recording. After selecting the desired cell, press the "OK" button. The cell will record the frequency of the station, and the volume level. The device will return to setup mode. To exit the setup mode, press the "ESC" button or do not press anything for 15 seconds. The device will enter the radio playback mode.

Setting alarms

Switching to the mode of setting alarms with the button "3" of the remote control. The running line "Alarm Clocks" will be displayed. If no button is pressed within 15 seconds, the device will enter the time display mode.

After going to the alarm menu, we will see the following:


B1 means alarm number. There are seven in total. Dashes after the number mean that the alarm is not enabled. Use the "Left" and "Right" buttons to change the number of the alarm. If the alarm is turned off, it will not be possible to view its settings. To turn on the alarm, press the "OK" button. The LED will turn on indicating that there are alarms enabled and a bell will appear.


Now if you can view the alarm settings. The menu of each alarm is divided into four parts. In the first part, the turn-on time and volume are adjusted. In the second part, the turn-off time is set and the sound mode is linear or rising. In the third part, the station to be switched on is set or the buzzer is selected. In the fourth part, the days of the alarm are selected. Press the "Right" button in front of us will be the first part.


The alarm time is displayed here. In the lower right corner is the power on volume. To change the settings, press the "OK" button. The switch-on clock starts flashing. Use the "Left" and "Right" buttons to change the value and press the "OK" button. So we set up all four parameters.

After adjusting the volume level, click "OK". This completes the setting in the first part of the alarm clock.

In this part, you can set the turn-off time and the volume increasing when the alarm goes off or linear.

Linear volume is displayed on the right as a rectangle:


Rising groThe capacitance is displayed as a triangle:


All configuration steps are the same as in the first part.

A little about the volume settings. In the first menu, we adjusted the volume level. If linear volume is set in the second part, then when the alarm goes off, the maximum volume will be the one that was set in the first part. If the volume was set to increasing, then when the alarm goes off, the volume from the minimum value will gradually increase to the value set in the first part.

After setting the second part, press the "Right" button and get into the third part of the alarm settings.


In this part, the radio station to be switched on is configured or the buzzer is selected by scrolling to the inscription BEEP.


Setting the same buttons as in the previous parts. Stations are selected only from those that were tuned in the "Radio" mode.

After setting the third part, press the "Right" button and get into the fourth part of the alarm settings.

Here we set the days of the alarm.


The designation of the days of the week is done in numbers. 1-Monday, 2-Tuesday, 3-Wednesday, etc.

Press "OK" The remote control will start flashing the first character. Use the "Left" or "Right" buttons on the remote control to turn on the day of the week or turn it off. Green color is active day, red is not active. An LED below the active day lights up. Made for those who collected watches on ordinary LEDs to see which day of the week is active.

After setting, press the "Right" button on the remote control and go to the next alarm or press "ESC" and exit the time display mode.

When the alarm goes off, the LED will flash. If you press the "Off" button while the alarm is running, the remote control LED will stop flashing and the alarm will not turn off when the turn-off time is reached, i.e. the alarm is canceled.

Equalizer setting

Switch to the equalizer settings menu by pressing the "4" button on the remote control. The running line "Equalizer" will run. In this mode, bass and treble frequencies are adjusted. Equalizer settings are stored separately for each radio channel. If none of the buttons is pressed within 15 seconds, it will switch to the time display mode.

To adjust the desired frequencies, press the "Left" or "Right" button on the remote control.

Tuning LF and HF maximum:



To change the low-pass or high-pass filter, press the "OK" button. The bar on the left will start flashing. Use the "Left" and "Right" buttons to change the value. To save the set value, press "OK" on the remote control. Depending on the magnitude of the value, the color of the pointers and the numbers indicating the level also change. Closer to the maximum value will be red. Closer to the minimum value in blue, and in the middle range in green.

Bass setting minimum:


Bass setting average value:


Setting-removing the minimum brightness threshold

By default, the brightness is adjusted from maximum to full blanking of the indicators. But this is not very convenient in automatic mode. In complete darkness, the indicators will go out and nothing will be visible. For this, this mode was made so that the minimum brightness does not fall below or above the set

We press the button 8 on the remote control to get into the menu for setting the brightness limits.

The first sets the minimum brightness limit.


Use the "Up" "Down" buttons on the remote control to set the desired brightness and press "OK" on the remote control. There will be a long signal buzzer and recorded the minimum brightness threshold.


Use the "Up" "Down" buttons on the remote control to set the desired brightness and press "OK" on the remote control.

There will be a long buzzer and the minimum brightness threshold will be recorded.

The next section sets the minimum brightness turn-on time, and then the maximum brightness turn-on time.

Exit their setup menu "ESC" remote control. Now, when adjusting the brightness, it will not be possible to make it darker or lighter than the set threshold, and in automatic mode, the brightness will not be lower or higher than the set one.

To enable the automatic brightness control mode on the remote control, press "0" to switch to automatic mode. The LED on the front of the watch will light up.

For real-time brightness adjustment to work, depending on illumination time, the minimum and maximum brightness must be equal. Otherwise, the brightness will be set according to the selected time. The change in brightness from the minimum to the maximum level and vice versa is smooth.

To reset the brightness threshold, simply enter the brightness threshold setting menu again and all limits will be reset.

To set the threshold from the buttons, read paragraph 8 below.

Button control

Buttons S4-S9 are located on the back of the watch. Depending on which menu we are in, the function of the buttons changes.

Button S8 switch to different menus. In order to go to the desired menu, press S8 and hold. After the required number of buzzer signals, release and get into the selected menu. The number of buzzer signals will correspond to the number of the remote control button. If there are 4 signals, then we will get into the "Equalizer" menu, if there is 1 signal, then the time display menu, etc.

1. Button functions in the watch menu:

S6 font change

S7 reset seconds and update time via internet

S9 go to basic settings.

By pressing S9 we go to the setup menu. In this menu, the buttons S4 and S5 change the parameter, button S6 go to the next setting parameter. Exiting the menu is not possible; you will have to go through all the adjustable parameters.

After setting the last parameter, a scrolling line will run and the device will return to the time display mode.

2. Button functions in the radio menu:

S4 and S5 sound adjustment "+" and "-"

S6 and S7 transition on configured channels "+" and "-"

S9 enter radio tuning mode

In the settings menu, the action of the buttons:

S4 and S5 sound adjustment "+" and "-"

S6 and S7 radio frequency change "+" and "-"

S9 go to the menu for storing a station in the memory. With buttons S6 and S7 we change the number of the memory cell, and the button S9 confirms the entry.

Exit the settings menu - do not press any buttons and the exit will be automatic after 15-20 seconds.

3. Button functions in the alarm settings menu:

S4 and S5 scrolling alarms "+" and "-"

S6 and S7 are not involved

S9 Turn the alarm on and off

If the alarm is on, press S4 to get into the main settings of the enabled alarm. Navigate through the S4 and S5 alarm submenus. To set the parameter, press S9 and S4 and S5 change the parameter. The next press of S9 moves to the next setting parameter. The device will exit the alarm settings automatically if within 15 seconds. any of the buttons will not be pressed.

4. Button functions in the equalizer menu:

S4 and S5 scroll through the adjustable parameters.

S6 enter the mode of changing the selected parameter. In this mode, S4 and S5 changes the parameter, and S6 confirms the change.

S7 is not involved.

Exit from the mode is automatic after 15 seconds if none of the buttons is pressed.

6. Button functions in the off timer menu:

S4 and S5 setting of the switch-off time interval in steps of 5 minutes. An interval of 0 minutes means the timer is off

S6 exit to time display menu.

7. Free. It may be used in the future.

8. Button functions in the brightness limit setting menu:

S4 and S5 brightness change.

S6 confirmation of the selected brightness.

S7 exit setting.

9. Free. It may be used in the future.

A little about the parts used and their replacement and adjustment.

All SMD elements are of size 0805. The U1 LM317ADJ stabilizer can be replaced with any stabilizer with a stabilization voltage of 3 Volts, for example ASM1117-30. In this case, replace R18 with a jumper, and do not install R17. The 5V stabilizer U8 LM2576-5 can be replaced with LM2596-5. LEDs D6 D7 D11 D12 D13 size 2835. Resistor R24 ​​set the volume of the buzzer. Do not forget to set the charge current for the battery used with resistors R44 R45 (see table in the diagram). With a high charge current, I recommend installing a radiator on the TP4056. Resistors R38 and R49 can limit the maximum volume or replace them with jumpers. Capacitors C28 C29 C42 C43 in the TEA6330T piping should be installed which are indicated in the diagram. Departure from the capacitance in one direction or another to change the frequency adjustment range. C28 and C43 are responsible for low frequencies, and C29 and C42 for high frequencies. I tried to set 6.8nF C29 and C42 HF frequencies practically do not change. Resistors R28 R33 R31 can change the voltage at the output of the converter. With the ratings indicated in the diagram, the voltage is 11.86V.

The voltage is calculated by the formula:

Uout=1.26*(1+((R33+R28)/R31))

Schottky diodes D4 D5 D1 D8 D10 can be replaced by any for a current of 2A. Zener diode D3 can be stopped by any stabilization voltage of 4.3V 4.7V or 5V.

Installation is better to start with the installation of all voltage stabilizers and check them for operability, so that it would not be a shame for the burnt controllers and sensors. Then it is better to mount the converter and check it by applying voltage to the 8th leg of the LM3488 in the range of 3.2-5V. The output should be about 12V.

Next, we mount the elements for charging the battery and monitoring the battery voltage and check for operability. For a 2-wire battery, we do not install R39, but replace R43 with a jumper. We also act for 3-wire if battery temperature control is not needed. The middle terminal of the battery remains to hang out. If temperature control is needed, then we install all the elements, although R43 can not be installed because it will be connected in parallel to the battery thermistor and will not greatly affect the operation.

The battery voltage controller is assembled on TL431 and LM358. A reference voltage source of 2.5 V is assembled on the TL431. This voltage is supplied to pin 2 of the LM358, and voltage is supplied to pin 3 of the LM358 from the battery through the divider R58 R62 as soon as the voltage on the battery is below 3.2 at pin 3, the voltage will also become less than 2.5 volts and on 1 output will be 0 Q9 will close. Positive voltage through R56 R51 will go to the base of Q8. Q8 will close thereby and close the transistor Q7.1 de-energizing the entire board. After turning off, starting the clock will only be possible when an external power supply is connected, since the LM358 is powered by an external power source.

If there is a BU4832 chip, then TL431 LM358 do not install their piping and R56. If we assemble on TL431 and LM358, then we do not install R53 and it may be necessary to adjust the response threshold with the divider R58 R62. If there is a main power supply, the battery should be charged, and there should be no voltage at the output of the converter. If the battery voltage is higher than 3.2 volts, then at the base of transistor Q9 it should be about 0.7-0.8V.

Now we check the operation of the backup power supply. First, we power the circuit from the main source. Then we pull it out of the network and 12V should appear at the output of the converter. If the converter does not start, then we look at what is based on Q9. If the voltage there is less than 0.7V, and the battery is charged, then we measure the voltage at pin 2 of the LM358 should be 2.5V and at pin 3 more than 2.5V. If everything is normal, then the LM358 is faulty or the power is not connected to it. The cut-off threshold can be adjusted R62. With an increase in its value, the shutdown threshold increases, i.e. the device will be completely de-energized with a deeper discharge of the battery. As the value decreases, the threshold decreases.

Capacitors C6 C11 C21 C20 C37 are recommended for low ESR.

If everything works, then we mount the processor, flash it and mount all the other elements .. For the convenience of flashing, contacts for the ISP connector are provided on the board. We solder the GND pin for ISP in any convenient place.

LED indication

LED D11 is lit, which means that the automatic brightness control mode is set. Manual adjustment does not work. The mode is switched by the button "0" of the remote control.

LED D12 is lit, which means there are alarms enabled. If it blinks, the alarm has been triggered.

LED D13 is lit, which means that the clock backup battery needs to be replaced. Even if you remove the battery, the time will not be reset, because due to the charge of the capacitors, the DS3231 will be powered for some time. So there are 5 minutes to change the battery.

LED D6 is lit, which means the battery is being charged

LED D7 is lit, which means the battery is charged.

If both LEDs D6 and D7 are not lit, the clock is powered by the internal battery.

We manufacture printed circuit boards (PP)

There were small miscalculations in the fastening of the speakers, the cutouts were made more than necessary and I had to be smart with their fastening. The archive takes into account all the changes that were worn in the board.

Board version with WI-FI.



I make printed circuit boards using a negative photoresist. I print a template on a film with an Epson L800 inkjet printerin a negative way. I clean the workpiece with Pemolux powder. I apply a film photoresist to the wet workpiece. Per lack of I iron the laminator with an iron set to division 1. I apply a template and illuminate it with three UV lamps of 20W each for 1 min 10 sec. Then again under the iron, then I wash off the not tanned areas and poison. I drill several holes in the extreme pads and make punctures in the same places in the template. The board and template are combined with needles. The second side is etched. The first is sealed with tape.

We drill holes. I usually drill through holes with a diameter of 0.4 mm and solder the wires into them. We solder the elements.

Photo of the finished board with WI-FI



We are more attentive to the installation so that later we do not look for why it does not work. Some output elements need to be soldered on both sides. The pins of these elements are like vias. Under the quartz on the board, you need to stick adhesive tape or electrical tape so that there is no contact with the tracks or solder it to the Atmega32 side.

The case was made of 4mm soft plastic. Cuts well with a utility knife. Since the LEDs are deep, then light guides are needed. The lid of a car lamp box was used as light guides. The case was drawn in CorelDRAW, printed on plain paper and fixed to plastic with double-sided tape and cut out. We hide everything in the case, fasten the antenna:


Sensors stick out from above:


In order to have a normal look and not just the sensors stick out of the case, a set for fixing the number was bought in a car shop and reflective caps are glued on top of the case.

It turned out like this:


That's like all. We plan to add the ability to display information from RDS. Just make another option for encoders.

A program was written for the ESP8266 module. The firmware for Atmega32 has also been changed in the archive, everything is updated. Changes were also made to the scheme. The TX RX signals from Atmega to ESP8266 were incorrectly connected. All changes described here are taken into account in the scheme in the archive.

Minor changes have been made to the diagram. Combined Reset Atmega and ESP8266 signals. But for this you need to match the voltage signals. Added 9.1 kΩ resistor between Reset Atmega and GND. 10k resistor between Reset ESP8266 and 3V rail removed. The voltage at the Reset pin should be within 3V-3.3V.

Added TX RX level matching. Although you can do without it, but did it as it should be according to the rules.

To flash the ESP8266 module, you need:

1. Download (if not installed) Arduino IDE from off site (https://www.arduino.cc/en/Main/Software), install.

2.Start the Arduino IDE, thenFile - Settings- in field Additional Boards Manager URLsinsert link to stable versionhttp://arduino.esp8266.com/package_esp8266com_index.json

4.B Board Managerenter esp8266 in the filter field or manually scroll through the list and click on ESP8266 by ESP8266 Community Forum
Click Install and wait for the download to complete (about 130 MB).
If the download is too fast, it is possible that you have already installed the Arduino IDE for ESP8266 and you will need to clear the Boards Manager cache, otherwise you will end up with the old version installed. You must first uninstall the old version, and then you need to delete the cache files. For Win7 x64, delete the files from the C:UsersUserAppDataRoamingArduino15 folder and repeat everything from step 2
Close the Boards Manager and from the Tools menu select Board - Generic ESP8266

Select the serial port to which the board is connected. Open the firmware file.

I used PL2303 to flash the module. The driver for it below in the archive works on Win 8.1. The driver is installed manually.

You can use any USB-COM adapter.

We solder the ESP 8266 module to the board. We connect the module with a USB-COM adaptersignal connections TX RXcross i.e. TX ESP8266 to RX USB-COM and RX ESP8266 to TX USB-COM. Install the jumper on XP10 and remove the jumpers XP11 and XP12. Click Reset.

In the firmware for the module that needs to be changed in the clock.

In the firmware, enter the name of your WI-FI network and the password for it.

Press the "Right Arrow" icon to start flashing the module.

After the firmware is completed, remove the XP10 jumper and install XP11 and XP12 back.

I recommend checking that you have ports 123 open on your PC and in the router.
It's easier to do this on a PC, in the time settings, the Internet time tab - Change settings. We drive into the fieldtime.nist.govand click "Update Now". If it says that the time was successfully updated, then your ports are open. If an error, then open the ports in the router.
At home, on an ASUS RT16 router with Tomato firmware, everything worked fine by default.
At work, I had to open ports on a Zuxel Keenetic Giga II router with native firmware, although the time was updated from the Internet in the router itself.

The time is updated by pressing the "9" button on the remote control. The only thing to consider when updating the time, if there is no access to the Internet, then the seconds will all be exactly reset to zero.
After turning on the clock or pressing the Reset button, to update the time via the Internet, you must wait 30 seconds. This time is necessary for the module to connect to the network or to return an error if there is no connection. If you press the "9" button on the remote control earlier, nothing will happen. During the time synchronization, the matrices for 1-2 seconds will be extinguished.
If there is no access to the Internet, then the line will be displayed"Oops No Network".
If there is access to the network but there is no access to the exact time server, then the line will be displayed"Unable to access time server"

A new network will also appear with the name "Datchik". You can also change its name to any in Arduino and change the password for it. The second module with outdoor sensors will be connected to this network.

PS. I decided to refuse automatic synchronization, because the DS3231 has a very small time drift and synchronization is needed no more than once a month, and then the drift is a few seconds. So it's easier to do it manually.

The matrix test program was written. Fuse as for the main firmware.
Everything is controlled visually.

The LEDs for Backup Battery Status, Alarm On, and Auto Brightness should be lit. The buzzer should be silent.

1. The first test turns on all the matrix LEDs. The test runs on all colors. Visually, you can determine which LEDs do not glow or their color is different from the others, so don’t disappear somewhere. The test starts with fully canceled matrices.

2. The second part of the test lights only one LED and runs it through all the rows in each of the three colors R G and B . Only one LED should light up. If two LEDs are on, then somewhere there is a short circuit at the outputs of the matrix registers.

The power supply must provide a current of at least 2A in test mode, since there is no brightness control and the consumption is quite large (especially when the color is white). If the block cannot provide such a current, then the test will not start, i.e. there will be attempts to start and immediately reset.

Outdoor temperature sensor module.

The outdoor temperature sensor module is also made on ESP8266 and AM2321 is used as a sensor. A room temperature sensor is also installed in this module. This is done in order if several identical clocks are collected and then they can receive data from one module. The external module has built-in USB charging for the battery, as well as battery voltage control. When the battery voltage drops below 3.2 volts, the LED will light up.

Also added visual error control.

1. No sensor AM2321 green LED on

2. No sensor BME280 red LED on

3. Unsuccessful connection to the WI-FI network, the blue LED is on



The firmware is done in the same way as for the module in the clock. The only thing is that some lines need to be changed in the program.

Set the polling time for the temperature sensor. Default is 900 sec = 15 min
Change the values ​​in the line:

ESP.deepSleep(900*1000000,WAKE_RFCAL);// time 900 seconds = 15 minutes
Change to your value. Save and flash.

My module is powered by a 1000mA battery.

Many novice radio amateurs, and not only, like to "reinvent the wheel" - everyone wants to build their own electronic clock. This fate did not pass me by either. There are plenty of watch designs on the Internet, but there are only a few watches on LED matrices. In the Russian-speaking Internet, I found only one completely finished design with a description.
At the same time, LED arrays have recently fallen in price, and their cost may even be less than seven-segment displays of the same size. For example, the GNM23881AD used with a size of 60x60mm was bought by me for one and a half dollars (three indicators cost four and a half dollars), for such money you can hardly buy four seven-segment indicators of the same size. But to place information on a matrix indicator, it will turn out much more. In addition to digital indication, various letters, signs, and text can be displayed on the LED matrix. After analyzing all this, it was decided to build a multifunctional clock on LED matrices, while there was a desire not to complicate the circuit more than on seven-segment displays. I also wanted the scheme to be multifunctional and not like the others. And so this scheme was born.

Watch functionality:
Time, calendar, days of the week. (leap year is taken into account, but there is no change to summer / winter time). Keeping the watch working when the external power supply is turned off (current consumption is only 15 μA). Clock rate correction + - 59.9 sec \ day, step 0.1 sec. 9 alarms. Three of them are “disposable”, and 6 are “permanent”, customizable individually by day of the week. The duration of the sound signal for each alarm is individually adjustable (1-15min).

Audible confirmation when buttons are pressed (can be disabled). Beep every hour (can be disabled). From 00-00 to 08-00 sleep mode, no signal is given. 1 or 2 temperature sensors (Street and house). A customizable creeping line, with which you can display all the information (except for time) Correction of the course, and the settings of the "creeping line" - are stored in memory even when the backup power supply is turned off.

AtMega16A was chosen as the "heart" of the watch, the criterion was its cheapness and affordability. Its 40 legs will allow you to realize all your ideas. There was a desire to simplify the circuit as much as possible, and therefore all the functionality was assigned to the controller. As a result, we got a circuit with only two microcircuits, a controller and a TPIC6B595 register. If it is not possible to get TPIC6B595, then it is quite possible to replace it with 74HC595 + ULN2803. All options have been tested. You can also try to replace it with TPIC6С595, but it is rather weak, and it got a little warm, but it worked quite stably.

The countdown is carried out using an asynchronous timer - T2. When the main power is lost, the clock is saved. In this case, almost the entire circuit is de-energized, and the controller is powered by a battery, battery or supercapacitor. There was a desire to "play" with the ionistor, that's why I applied it. The watch consumes about 15 μA in standby mode. With backup power from a ionistor at 1F, the capacity was enough for four days, which is quite enough to maintain the clock during power outages. If you use a CR2032 battery, then the charge will last for a year and a half.

The controller listens for the presence of the network through the pin. PB3 (inverting comparator input). The supply voltage is supplied through the R2-R3 divider to the pin. РВ3, and is approximately equal to 1.5 V. If the supply voltage drops to 4.1 volts, then the voltage at the pin. РВ3 will become less than 1.2 V, while an interrupt from the comparator will be generated, and in the handler of this interrupt, all “extra” controller nodes are turned off and the controller itself is put to sleep. In this mode, only the timer T2 keeps running. When an external power supply appears, the voltage on PB3 will again rise above 1.23V, the controller "seeing" this will put all nodes into working condition. If instead of an ionistor, a CR2032 battery is used, then it must be connected through a diode (preferably a Schottky diode). The anode of the diode is connected to + batteries, and the cathode to the cathode VD1.

In normal mode, the screen displays the time in hour-minute format. With an interval of one minute, the running line is launched. The running line displays the day of the week, date, year, temp. at home, and temp. on the street. The running line is customizable, i.e. You can turn on / off the display of any of the elements. (For example, I always turn off the display of the year). When all elements are turned off, the creeping line does not start, and the clock constantly displays the current time.

The 9 alarms are divided into 3 disposable and 6 reusable. When you turn on alarms 1-3, they only work once. In order for them to work again, they must be re-enabled manually. And alarm clocks 4-9 are reusable, i.e. they will work daily, at the set time. In addition, these alarms can be set to sound only on certain days of the week. This is convenient, for example, if you do not want the alarm clock to wake you up on the weekend. Or, for example, you need to wake up on weekdays at 7-00, and on Thursday at 8-00, and on weekends you don’t need an alarm clock. Then we set one reusable at 7-00 on Monday-Wednesday and Friday, and the second at 8-00 on Thursday ... .. In addition, all alarm clocks have a signal duration setting, and if you don’t have enough signal for 1 minute to wake up , then you can increase it for a time from 1 to 15 minutes.

The course correction is made once a day, at 00-00. If the clock is faster, for example, by 5 seconds per day, then at 00-00-00 the time will be set to 23-59-55, if the clock is behind, then at 00-00-00 the time will be set to 00-00-05. Correction step - 0.1 sec. The maximum correction is 59.9 sec/day. With serviceable quartz, more is unlikely to be needed. Correction is also carried out in standby mode when powered by a battery.

You can apply any LED matrix 8 * 8 LEDs with a common cathode. As already mentioned, I used the GNM23881AD. But you can "dial" the matrix from individual LEDs. The AtMega16a microcontroller can be replaced with the “old” AtMega16 with the letter L. In this case, theoretically, the current consumption from the battery should increase slightly. It will probably work just AtMega16, but there may be problems when running on batteries. Diode D1 - preferably any Schottky diode. It also works with a conventional rectifier, but in order to protect yourself from various glitches associated with the fact that part of the circuit is powered by voltage “before the diode”, and the part “after the diode” is better to look for Schottky. Transistor VT1 - any n-p-n.

The clock is controlled by two buttons. Their number could be increased to 8 pieces, without adding any more components at all, except for the buttons themselves, but I wanted to try to “get out” with just two. The buttons are conventionally named "OK" and "STEP". The “STEP” button usually switches to the next menu item, and the “OK” button changes the parameters of the current menu. The signal of the triggered alarm is also turned off by the "OK" or "STEP" buttons. Pressing any button during the alarm will turn off the alarm. The control scheme turned out like this.

Simple clock on LED matrices. Many radio amateurs, beginners and not only like to "reinvent the wheel" - to build THEIR electronic clock. This fate did not spare me either. Of course, there are plenty of watch designs on the Internet today, but for some reason there are only a few watches on LED matrices. In the Russian-speaking Internet, I found only one fully completed and described design. At the same time, LED matrices are now very much cheaper, and their cost is not higher, if not lower than that of seven-segment indicators of the same size. For example, the GNM23881AD I used with a size of 60x60mm were bought for 1.5u (3 indicators cost 4.5u), for this money you can hardly buy four seven-segment units of the same size. But information that can be placed on a matrix indicator can be much more. In addition to numbers, they can display any letters, signs, and with the help of a running line, text can also be displayed.

Based on this, there was a desire to build a clock on LED matrices, but so that the circuit turned out to be no more complicated than on seven-segment ones. I also wanted it to be functional enough and not like the others. Thus, the following scheme was born.

The functionality of the watch is as follows:

  • Countdown, calendar, day of the week. (leap year is taken into account, the transition to summer / winter time is not carried out).
  • Preservation of the clock in case of loss of external power supply (consumption is 15mA).
  • Travel correction + - 59.9 sec \ day, in 0.1 sec increments. 9 alarms. 3 of which are “disposable”, and 6 are “permanent”, individually adjustable by day of the week.
  • Individually adjustable duration of the sound signal for each alarm (1-15min).
  • Sound confirmation of button presses (it is possible to disable).
  • Hourly beep (can be turned off).
  • From 00-00 to 08-00 the signal is not given.
  • 1 or 2 temperature sensors (Street and house).
  • Customizable ticker that displays all information (except time)
  • The value of the stroke correction, and the settings of the “creeping line” are saved even if the backup power is lost.

AtMega16A was chosen as the "heart" of the watch, because of its availability, cheapness and "legs". I wanted to simplify the circuit as much as possible, so everything that was possible was assigned to the controller. As a result, we managed to get by with just two microcircuits, a controller and a TPIC6B595 register. If TPIC6B595 is not available to someone, then you can replace it with 74HC595 + ULN2803. Both options have been tested. You can also try to use TPIC6C595, it is a bit weak, and slightly heated, but in general it worked stably. The time is counted using an asynchronous time - T2. The clock is kept even in the event of a power failure. At this time, most of the circuit is de-energized, and the controller is powered by a battery, accumulator, or from an ionistor. It was interesting for me to “play around” with the ionistor, so I applied it. The current consumption of the watch in standby mode is 15mA. When powered by a ionistor at 1F, the watch “lasted” for four days. This is quite enough to maintain the course during power outages. If you use a CR2032 battery, then theoretically, according to the calculations, the charge should be enough for 1.5 years. The presence of mains voltage controller "listens" through the pin PB.3 This pin is the inverting input of the comparator. The supply voltage, through the divider R2-R3, is supplied to the output PB.3, and in the normal state is approximately 1.5V. If the external voltage drops below 4.1 volts, then the voltage at the PB.3 pin will become less than 1.23 volts, and an interrupt from the comparator will be generated, and all “unnecessary” controller nodes are turned off in the interrupt handler and the controller itself is put to sleep. In this mode, only the timer T2 keeps running. When an external power supply appears, the voltage on PB.3 will again rise above 1.23V, the controller “seeing” this will put all nodes into working condition. If instead of an ionistor, a CR2032 battery is used, then it must be connected through a diode (preferably a Schottky diode). The anode of the diode is connected to + batteries, and the cathode to the cathode VD1. In normal mode, the screen displays the time in hour-minute format. With an interval of one minute, the running line is launched. The running line displays the day of the week, date, year, temp. at home, and temp. on the street. The running line is customizable, i.e. You can turn on / off the display of any of the elements. (For example, I always turn off the display of the year). When all elements are turned off, the creeping line does not start, and the clock constantly displays the current time. The 9 alarms are divided into 3 disposable and 6 reusable. When you turn on alarms 1-3, they only work once. In order for them to work again, they must be re-enabled manually. And alarm clocks 4-9 are reusable, i.e. they will work daily, at the set time. In addition, these alarms can be set to sound only on certain days of the week. This is convenient, for example, if you do not want the alarm clock to wake you up on the weekend. Or, for example, you need to wake up on weekdays at 7-00, and on Thursday at 8-00, and on weekends you don’t need an alarm clock. Then we set one reusable at 7-00 on Monday-Wednesday and Friday, and the second at 8-00 on Thursday ... .. In addition, all alarm clocks have a signal duration setting, and if you don’t have enough signal for 1 minute to wake up , then you can increase it for a time from 1 to 15 minutes. The course correction is made once a day, at 00-00. If the clock is faster, for example, by 5 seconds per day, then at 00-00-00 the time will be set to 23-59-55, if the clock is behind, then at 00-00-00 the time will be set to 00-00-05. Correction step - 0.1 sec. The maximum correction is 59.9 sec/day. With serviceable quartz, more is unlikely to be needed. Correction is also carried out in standby mode when powered by a battery. LED arrays can use any 8*8 common cathode LEDs. As already indicated, I used the GNM23881AD. In principle, you can "dial" a matrix from individual LEDs. The AtMega16a microcontroller can be replaced with the “old” AtMega16 with the letter L. In this case, theoretically, the current consumption from the battery should increase slightly. It will probably work just AtMega16, but there may be problems when running on batteries. Diode D1 - preferably any Schottky diode. It also works with a conventional rectifier, but in order to protect yourself from various glitches associated with the fact that part of the circuit is powered by voltage “before the diode”, and the part “after the diode” is better to look for Schottky. Transistor VT1 - any n-p-n. The clock is controlled by two buttons. Their number could be increased to 8 pieces, without adding any more components at all, except for the buttons themselves, but I wanted to try to “get out” with just two. The buttons are conventionally named "OK" and "STEP". The “STEP” button usually switches to the next menu item, and the “OK” button changes the parameters of the current menu. The signal of the triggered alarm is also turned off by the "OK" or "STEP" buttons. Pressing any button during the alarm will turn off the alarm. The control scheme turned out like this:

Video how it works!