DIY digital clock diagram. Multifunctional LED wristwatch. Electrical diagram of a homemade clock with a thermometer

In this step by step instructions I'll tell you how to do it Wall Clock with your own hands.

Watch Features:

  • Large numbers (each number is approximately equal to the size of an A4 sheet).
  • Thin walls (can be inserted into a picture frame).
  • Automatic adjustment depending on the brightness of the lighting in the room.
  • Dedicated daylight saving time button.

Step 1: Materials Needed


What I used for a digital wall clock with large numbers.

Electronics:

  • Arduino nano V3.0 (unfortunately, since I can’t afford the original Arduino, I used a Chinese clone) - 150 rubles.
  • Digital module for measuring light intensity Photoresistor for Arduino - 60 rubles.
  • DS3231 AT24C32 IIC memory module for precise time for Arduino - 60 rubles.
  • DC-DC converter LM2596, output power 1.23V-30V - 50 rubles.
  • 4 meters of WS2811 LED strip 30 diodes/m - 700 rubles. (one WS2811 controls 3 LED chips)

Total cost of electronics: 900 rubles.

Other materials:

  • Heat shrink tube - 400 rubles (33m in stock)
  • 20 pcs. 5 x 7 cm printed circuit board - 200 rubles.
  • 3 pcs. Microswitch - 60 rubles.
  • Solder - 50 rubles
  • Flux - 50 rubles.
  • UTP (Unshielded Twisted Pair) Cable
  • LCD font (http://www.dafont.com/lcd-lcd-mono.font) - free.
  • Cardboard is free in the supermarket.
  • Polystyrene panel - 100 rubles.

As well as various tools.

Step 2: Preparation - Number Patterns


  1. Download and install the clock font
  2. Open Word or another program and create a template like the one in the first photo.
  • Font size ~ 800,
  • Font white with black outline,
  • Gray stripes where the LED strips will be

Print the template and cut out the stripes with a utility knife (as in the second photo)

Step 3: Preparation - cutting cardboard and LED strip

Using the digital template, cut the cardstock to size (remember to leave room for the dots between the hours and minutes)

If your LED strips come with a connector on each end (like mine), unplug the connector and cut them into 3 pieces.

Step 4: Attach the LED strip


Using the template, stick LED strip on cardboard.

This is not necessary, but I used a pencil to mark where the LED strips should be placed.

It is much more convenient to glue them when you see the final shape. Thanks to this, I noticed that I had left too much space for dots between the numbers and corrected it in time.

Step 5: Solder the LED strip


Now the long soldering process begins.

Solder the LED strip to form a continuous strip. Pay attention to the order in which the strips are soldered in the photo. For the dots, I used one piece of tape and taped it in the middle.

Colors I chose:

  • Blue for earth
  • Green for data
  • Red for +12V

Step 6: Installing the Arduino on the PCB


I tried to sketch in Fritzing but couldn't find all the details :)

So, the first photo shows the wiring diagram, and the second photo shows how it looks for me.

Step 7: LED Check

Before you upload the code (which I have nothing to do with), be sure to install the FastLED library.

If everything works fine, the LEDs should cycle through colors. If you are having problems, check your soldering first.

Files

Step 8: Program the Clock

After some time, I managed to make a watch that completely suits me. However, everyone will find something that can be improved.

The code is well commented, so there shouldn't be any problems with it.

All debug messages are also commented.

To change the color used, you must change the variable on line 22 (int ledColor = 0x0000FF; // Color used (in hex)). You can find a list of colors at the bottom of this page

Even in my youth, I wanted to assemble an electronic watch. It seemed to me that assembling a watch was the pinnacle of skill. As a result, I assembled a clock with a calendar and an alarm clock on the K176 series. Now they are already obsolete and I wanted to put together something more modern. After a long search on the Internet (I never thought that I was so difficult to please;)) I liked this scheme. The difference from the above circuit is that a rare microcircuit is not used TRIC6V595, and its composite and more powerful analogue on microcircuits 74HC595 And ULN2003. Corrections to the diagram are given below.



Scheme of an electronic LED clock running line

Dear author of the diagram OLED, the firmware is also his. Clock display current time, year, month and day of the week, as well as the temperature outside and inside the house in a creeping line. They have 9 independent alarms. It is possible to adjust (correct) the stroke + - minute per day, select the speed of the line, change the brightness of the LEDs, depending on the time of day.

If there is a power outage, the watch is powered either by an ionistor (a capacity of 1 Farad is enough for 4 days) or by a battery. Whoever likes it, the board is designed to install both. They have a very convenient and understandable control menu (all controls are performed with just two buttons). The following parts are used in the watch (all parts are in SMD cases):

Microcontroller AtMEGA 16A

-
Shift register 74HC595

-
Chip ULN2803(eight Darlington keys)

-
Temperature sensors DS18B20(installed upon request)

-
25 resistors at 75 Ohm (type 0805)

-
3 resistors 4.7kOhm

-
2 resistors 1.5 kOhm

-
1 resistor 3.6 kOhm

-
6 SMD capacitors with a capacity of 0.1 uF

-
1 capacitor 220 µF

-
Hour quartz at a frequency of 32768 hertz.

-
Matrices 3 pieces brand 23088-ASR 60x60 mm - common cathode

-
Any 5 volt buzzer.



Printed circuit board for electronic LED clock ticking line

For residents of Ukraine, I’ll tell you, the matrices are available in the Lugansk Radio Market store. The advantages of watches over other similar devices are a minimum of parts and high repeatability. The LED clock starts working immediately after the firmware is installed, unless of course there are mistakes in the installation. The microcontroller is flashed in-circuit; for this purpose, special pins are provided on the board. I flashed it with Poniprog. Fuse screens for programs ponyprog And AVR are given below, the firmware files are also posted in Ukrainian and Russian, which is more familiar to whom.


If you do not need temperature sensors, then you do not need to install them. The clock automatically recognizes the connection of sensors, and if one or both sensors are missing, the device simply stops displaying the temperature (if one sensor is missing, the outside temperature is not displayed, if both are missing, the temperature is not displayed at all).

Homemade housing for LED watches

A video is provided to demonstrate the operation of the watch; it is not of high quality, since it was filmed with a camera, but it is what it is.

Video of the clock working

I have already collected four copies of these watches, and I give each one as a birthday present to my relatives. And everyone really liked them. If you also want to collect this watch and have any questions, you are welcome to visit our forum. Sincerely, Voitovich Sergey ( Sergey-78 ).

Discuss the article ELECTRONIC LED CLOCK

I remember... Thirty years ago, six indicators were a small treasure. Anyone who could then make a clock using TTL logic with such indicators was considered a sophisticated expert in his field.

The glow of the gas-discharge indicators seemed warmer. After a few minutes I was wondering if these old lamps would work and wanted to do something with them. Now it is very easy to make such a watch. All you need is a microcontroller...

Since at that time I was interested in programming microcontrollers in languages high level, I decided to play a little. I tried to construct a simple clock using digital gas discharge indicators.

Purpose of design

I decided that the clock should have six digits, and the time should be set with a minimum number of buttons. Additionally, I wanted to try to use several of the most common families of microcontrollers from different manufacturers. I intended to write the program in C.

Gas discharge indicators require high voltage to operate. But dealing with dangerous mains voltage I did not want. The watch was supposed to be powered by a harmless 12 V voltage.

Since my main goal was the game, you will not find any description of the mechanical design or body drawings here. If you wish, you can change the watch yourself in accordance with your tastes and experience.

Here's what I got:

  • Time display: HH MM SS
  • Alarm indication: HH MM --
  • Time display mode: 24 hours
  • Accuracy ±1 second per day (depending on quartz crystal)
  • Supply voltage: 12 V
  • Current consumption: 100 mA

Clock diagram

For a device with a six-digit digital display, multiplex mode was a natural solution.

The purpose of most elements of the block diagram (Figure 1) is clear without comment. To a certain extent, the non-standard task was to create a TTL-to-TTL level converter high voltage signals indicator management. The anode drivers are made using high-voltage NPN and PNP transistors. The diagram is borrowed from Stefan Kneller (http://www.stefankneller.de).

The 74141 TTL chip contains a BCD decoder and a high-voltage driver for each digit. It may be difficult to order one chip. (Although I don't know if anyone makes them anymore). But if you find gas-discharge indicators, 74141 may be somewhere nearby :-). At the time of TTL logic, there was practically no alternative to the 74141 chip. So try to find one somewhere.

The indicators require a voltage of about 170 V. It makes no sense to develop a special circuit for a voltage converter, since there are a huge number of boost converter chips. I chose the inexpensive and widely available IC34063. The converter circuit is almost completely copied from technical description MC34063. A T13 power switch has just been added to it. Internal key for this high voltage doesn't fit. I used a choke as inductance for the converter. It is shown in Figure 2; its diameter is 8 mm and its length is 10 mm.

The efficiency of the converter is quite good, and output voltage relatively safe. With a load current of 5 mA, the output voltage drops to 60 V. R32 acts as a current-sensing resistor.

To power the logic, linear regulator U4 is used. There is space on the circuit and board for a backup battery. (3.6 V - NiMH or NiCd). D7 and D8 are Schottky diodes and resistor R37 is for limiting charging current according to battery characteristics. If you are building watches just for fun, you won't need the battery, D7, D8 and R37.

The final circuit is shown in Figure 3.

Figure 3.

The time setting buttons are connected via diodes. The state of the buttons is checked by setting a logical “1” at the corresponding output. As a bonus feature, a piezo emitter is connected to the output of the microcontroller. To shut up that nasty squeak, use a small switch. A hammer would be quite suitable for this, but this is a last resort :-).

List of circuit components, figure printed circuit board and the layout diagram can be found in the "Downloads" section.

CPU

Almost any microcontroller with a sufficient number of pins, the minimum required number of which is indicated in Table 1, can control this simple device.

Table 1.
Function conclusions
Nutrition 2
Quartz resonator 2
Anode management 6
Driver 74141 4
Button input 1
Piezo emitter 1
Total 16

Each manufacturer develops its own families and types of microcontrollers. The location of the pins is individual for each type. I tried to design a universal board for several types of microcontrollers. The board has a 20-pin socket. With a few jumper wires you can adapt it to different microcontrollers.

The microcontrollers tested in this circuit are listed below. You can experiment with other types. The advantage of the scheme is the ability to use different processors. Radio amateurs, as a rule, use one family of microcontrollers and have the corresponding programmer and software tools. There may be problems with microcontrollers from other manufacturers, so I gave you the opportunity to choose a processor from your favorite family.

All the specifics of switching on various microcontrollers are reflected in Tables 2...5 and Figures 4...7.

Table 2.
Freescale
Type MC68HC908QY1
Quartz resonator 12 MHz
Capacitors C1, C2 22 pF
Program freescale.zip
(see "Downloads" section)
Settings

Note: A 10 MΩ resistor is connected in parallel with the quartz resonator.

Table 3.
Microchip
Type PIC16F628A
Quartz resonator 32.768 kHz
Capacitors C1, C2 22 pF
Program pic628.zip
(see "Downloads" section)
Settings Int. 4 MHz generator - I/O RA6,
MCLR OFF, WDT OFF, LVP OFF,
BROUT OFF, CP OFF, PWRUP OFF

Note: The microcircuit must be rotated 180° in the socket.

Table 4.
Atmel
Type ATtiny2313
Quartz resonator 12 MHz
Capacitors C1, C2 15 pF
Program attiny.zip
(see "Downloads" section)
Settings Sq. 8 MHz oscillator, RESET ON

Note: Add SMD components R and C to the RESET pin (10 kΩ and 100 nF).

Table 5.
Atmel
Type AT89C2051
Quartz resonator 12 MHz
Capacitors C1, C2 22 pF
Program at2051.zip
(see "Downloads" section)
Settings --

Note: Add SMD components R and C to the RESET pin (10 kΩ and 100 nF); connect the pins marked with asterisks to the +Ub power bus via 3.3 kOhm SMD resistors.

When you compare the codes for different microcontrollers, you will see that they are very similar. There are differences in access to ports and definition of interrupt functions, as well as in what depends on the hardware components.

The source code consists of two sections. Function main() configures ports and starts a timer that generates interrupt signals. After this, the program scans the pressed buttons and sets the appropriate time and alarm values. There, in the main loop, the current time is compared with the alarm clock and the piezo emitter is turned on.

The second part is a subroutine for handling timer interrupts. A subroutine that is called every millisecond (depending on the timer's capabilities) increments the time variables and controls the display digits. In addition, the status of the buttons is checked.

Running the circuit

When installing components and setting up, start with the power source. Solder the U4 regulator and surrounding components. Check for 5 V voltage for U2 and 4.6 V for U1. The next step is to assemble the high voltage converter. Use trimming resistor R36 to set the voltage to 170 V. If the adjustment range is not enough, slightly change the resistance of resistor R33. Now install the U2 chip, transistors and resistors of the anode and digital driver circuit. Connect the U2 inputs to the GND bus and connect one of the resistors R25 - R30 in series to the +Ub power bus. The indicator numbers should light up in the corresponding positions. On last stage To check the circuit, connect pin 19 of the U1 microcircuit to ground - the piezo emitter should beep.

You will find the source codes and compiled programs in the corresponding ZIP file in the “Downloads” section. After flashing the program into the microcontroller, carefully check each pin in position U1 and install the necessary wire and solder jumpers. Refer to the microcontroller images above. If the microcontroller is programmed and connected correctly, its generator should start working. You can set the time and alarm. Attention! There is space on the board for one more button - this is a spare button for future expansions :-).

Check generator frequency accuracy. If it is not within the expected range, slightly change the values ​​of capacitors C1 and C2. (Solder small capacitors in parallel or replace them with others). The accuracy of the watch should improve.

Conclusion

Small 8-bit processors are quite suitable for high-level languages. C was not originally intended for small microcontrollers, but for simple applications you can use it just fine. Assembly language is better suited for complex tasks, requiring compliance with critical times or maximum processor load. For most radio amateurs, both free and shareware limited versions of the C compiler are suitable.

C programming is the same for all microcontrollers. You must know the hardware functions (registers and peripherals) of the selected type of microcontroller. Be careful with bit operations - the C language is not suitable for manipulating individual bits, as can be seen in the example of the original when for ATtiny.

Are you done? Then tune in to contemplate the vacuum tubes and watch...

...the old days are back... :-)

Editor's note

A complete analogue of the SN74141 is the K155ID1 microcircuit, produced by the Minsk Integral software.
The microcircuit can be easily found on the Internet.

I propose for repetition the circuit of a simple electronic clock with an alarm clock, made on the PIC16F628A type. A big advantage of this watch is the ALS type LED indicator for displaying the time. Personally, I’m pretty tired of all kinds of LCDs and I want to be able to see the time from anywhere in the room, including in the dark, and not just directly with good lighting. The circuit contains a minimum of parts and has excellent repeatability. The watch was tested for a month, which showed its reliability and performance. I think of all the schemes on the Internet, this one is the easiest to assemble and run.

Schematic diagram of an electronic clock with an alarm clock on a microcontroller:


As can be seen from the clock diagram, it is the only microcircuit used in this device. A 4 MHz quartz resonator is used to set the clock frequency. To display the time, red indicators with a common anode are used; each indicator consists of two digits with decimal points. In the case of using a piezo emitter, capacitor C1 - 100 μF can be omitted.

You can use any indicators with a common anode, as long as each digit has its own anode. To ensure that the electronic watch is clearly visible in the dark and from a great distance, try to choose a larger ALS.


The clock display is dynamic. At a given time, only one digit is displayed, which allows you to significantly reduce current consumption. The anodes of each digit are controlled by a PIC16F628A microcontroller. The segments of all four digits are connected together and, through current-limiting resistors R1 ... R8, connected to the terminals of the MK port. Since the indicator lights up very quickly, the flickering of the numbers becomes unnoticeable.


Momentary buttons are used to set minutes, hours and alarm clock. Pin 10 is used as an output for the alarm signal, and a cascade of transistors VT1,2 is used as an amplifier. The sound emitter is a piezoelectric element of the ZP type. To improve the volume, you can replace it with a small speaker.


The clock is powered from a stabilized 5V source. It can also be powered by batteries. The watch has 9 display modes. Switching between modes is carried out using the “+” and “-” buttons. Before the readings themselves are displayed, a short hint about the name of the mode is displayed on the indicators. The duration of the hint display is one second.


Using the "Correction" button, the alarm clock is switched to settings mode. In this case, a short-term prompt is displayed for half a second, after which the adjusted value begins to blink. Correction of readings is carried out using the “+” and “-” buttons. When you press the button for a long time, the auto-repeat mode is activated at the specified frequency. All values, except hours, minutes and seconds, are written to EEPROM and restored after power cycle.


If no button is pressed within a few seconds, the electronic clock switches to time display mode. By pressing the "On/Off" button the alarm clock turns on or off, this action is confirmed by a short sound. When the alarm clock is on, the dot in the low-order digit of the indicator lights up. I was thinking about where to put the clock in the kitchen, and decided to mount it directly in gas stove:) Material sent by in_sane.


Discuss the article ELECTRONIC ALARM CLOCK

This clock is assembled on a well-known chipset - K176IE18 (binary counter for a clock with a bell signal generator),

K176IE13 (clock counter with alarm) and K176ID2 (binary to seven-segment code converter)

When the power is turned on, zeros are automatically written to the hour and minute counter and the alarm clock memory register of the U2 chip. For installation

time, press the S4 (Time Set) button and holding it press the S3 (Hour) button - to set the hour or S2 (Min) - to set

minutes. In this case, the readings of the corresponding indicators will begin to change with a frequency of 2 Hz from 00 to 59 and then again 00. At the moment of transition

from 59 to 00 the hour counter will increase by one. Setting the alarm time is the same, you just need to hold it

button S5 (Alarm Set). After setting the alarm time, you need to press the S1 button to turn on the alarm (contacts

closed). Button S6 (Reset) is used to force the minute indicators to be reset to 00 during setup. LEDs D3 and D4 play a role

dividing dots flashing at a frequency of 1 Hz. Digital indicators on the diagram are located in in the right order, i.e. come first

hour indicators, two dividing dots (LEDs D3 and D4) and minute indicators.

The clock used resistors R6-R12 and R14-R16 with a wattage of 0.25W, the rest - 0.125W. Quartz resonator XTAL1 at a frequency of 32 768Hz -

ordinary sentry, KT315A transistors can be replaced with any low-power silicon of the appropriate structure, KT815A - with transistors

average power with a static base current transfer coefficient of at least 40, diodes - any low-power silicon. Tweeter BZ1

dynamic, without built-in generator, winding resistance 45 Ohm. Button S1 is naturally locked.

The indicators used are TOS-5163AG green, you can use any other indicators with a common cathode without reducing

resistance of resistors R6-R12. In the figure you can see the pinout of this indicator; the conclusions are shown conditionally, because presented

view from above.

After assembling the watch, you may need to adjust the frequency of the crystal oscillator. This can most accurately be done by digitally controlling

using a frequency meter, the oscillation period is 1 s at pin 4 of the U1 microcircuit. Tuning the generator as the clock progresses will require significantly more expense

time. You may also have to adjust the brightness of LEDs D3 and D4 by selecting the resistance of resistor R5, so that everything

glowed uniformly brightly. The current consumed by the clock does not exceed 180 mA.

The watch is powered by a conventional power supply, assembled on a positive microcircuit stabilizer 7809 with an output voltage of +9V and a current of 1.5A.



If you find an error, please select a piece of text and press Ctrl+Enter.