Simple do-it-yourself electronic clock diagram. Electronic clock - Clock - Designs for home and garden. Homemade housing for LED watches

In this step-by-step instruction I will tell you how to make a wall clock with your own hands.

Watch features:

  • Large numbers (each number is approximately 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 savings time button.

Step 1: Required Materials


What I used for wall electronic 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)

The 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 - free of charge in the supermarket.
  • Polystyrene panel - 100 rubles.

As well as various tools.

Step 2: Preparation - Number Templates


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

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

Step 3: Preparation - cut cardboard and LED strip

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

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

Step 4: Attaching the LED Strip


Using the template, stick the LED strip onto the cardboard.

This is not required, 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 left too much space for dots between the numbers and corrected it in time.

Step 5: Soldering the LED Strip


Now the long soldering process begins.

Solder the LED strip to form a continuous strip. Pay attention to the order of soldering the strips in the photo. For the dots, I used one piece of tape, which I sealed with tape in the middle.

Colors I chose:

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

Step 6: Mounting the Arduino on the PCB


I tried sketching in Fritzing but couldn't find all the details 🙁

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

Step 7: Checking the LED


Before uploading the code (which I have nothing to do with), don't forget to install the FastLED library.

If everything works fine, the LEDs should cycle through colors. If you're having problems, check your solder joint first.

Files

Step 8: Program your watch

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

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

All debug messages are also commented out.

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

Clock with a seven-segment LED indicator on the K145IK1911 chip

The history of these watches appearing on the site is slightly different from other schemes on the site.

Regular day off, I go to the post office, rummage, and go to our reader Fedorenko Eugene, sent a diagram of the clock, with a description and with all the photos.

Briefly about the scheme. This electronic clock circuit their hands performed on the K145IK1911 chip, and the time is displayed on seven segment LED indicators. And so is his article. We look at everything.

Clock layout:


To enlarge a picture, simply click to enlarge it. And save your computer.

Not so long ago, I was faced with the task of either buying a new watch or assembling a new one myself. The requirements for the clock were simple - the display should show hours and minutes, there should be an alarm clock, and LED seven-segment indicators should be used as a display device. I did not want to pile up a bunch of logical microcircuits, and there was no desire to get involved with programming controllers. The choice was made on the development of the Soviet electronic industry - chip K145IK1901.

It was not in the store at that time, but there was an analogue, in a 40-pin package - K145IK1911. The name of the pins of this microcircuit is no different from the previous one, the difference is in the numbering.



The disadvantage of these microcircuits is that they only work with vacuum fluorescent displays. To ensure docking with an LED indicator, it was necessary to build a matching circuit on semiconductor keys.

As string drivers - J1-J7 transistors can be used KT3107 with the letter index I, A, B. For the drivers for selecting segments D1-D4, KT3102I, or KT3117A, KT660A, as well as any others with a maximum collector-emitter voltage of at least 35 V and a collector current of at least 100 mA will go. The current of the indicator segments is regulated by resistors in the collector circuits of the row drivers.



To separate the digits of hours and minutes, a dot flashing at a frequency of 1 Hz is used.

This frequency is present at the output of the Y4 chip, after the timing has begun. This scheme also provides the ability to display on the display instead of hours and minutes - minutes and seconds, respectively. Switching to this mode is carried out by pressing the "Second" button. Return to the time indication of hours and minutes is carried out after pressing the "Return" button. This chip provides the ability to set two alarms at the same time, but in this scheme the second alarm is not used as unnecessary. A piezo tweeter with a built-in generator, with a supply voltage of 12V, was used as a sound emitter. The alarm signal is taken from the Y5 output of the microcircuit. To ensure intermittent sound, the signal is modulated at a frequency of 1 Hz, used to indicate the second rhythm (dots). For a more detailed study of the functionality of the K145IK1901 (11) microcircuit, you can refer to the documentation, which recently can be easily found on the net. The microcircuit must be powered by a negative voltage of -27V ± 10%. According to the experiments, the microcircuit remains operational even at a voltage of -19V, and the accuracy of the clock is not affected at all.

The clock diagram is shown in the figure above. Chip resistors of size 1206 were used in the circuit, which can significantly reduce the dimensions of the device. As a seven-segment indicator, any one with a common anode is suitable.

Well, the article has ended at the moment. Which will be further developed and replenished. And I express my gratitude to its author, Evgeny Fedorenko, for all questions and also give his mail. Write to This email address is being protected from spambots. You must have JavaScript enabled to view.

Hey geektimes! In the first part of the article, the principles of obtaining the exact time on a homemade watch were considered. Let's go further and consider how and on what it is better to display this time.

1. Output devices

So, we have a certain platform (Arduino, Raspberry, PIC / AVR / STM controller, etc), and the task is to connect some kind of indication to it. There are many options that we will consider.

Segment display

Everything is simple here. The segment indicator consists of ordinary LEDs, which are tritely connected to the microcontroller through quenching resistors.

Beware of traffic!

Pros: simple design, good viewing angles, low price.
Minus: the amount of displayed information is limited.
There are two types of indicator designs, with a common cathode and a common anode, inside it looks something like this (diagram from the manufacturer's website).

There are 1001 articles on how to connect an LED to a microcontroller, Google to help. Difficulties begin when we want to make a big clock - after all, looking at a small indicator is not very convenient. Then we need such indicators (photo from eBay):

They are powered by 12V, and they simply will not work directly from the microcontroller. This is where the microchip comes to the rescue. CD4511, designed just for that. It not only converts data from a 4-bit line into the desired numbers, but also contains a built-in transistor switch to supply voltage to the indicator. Thus, in the circuit we will need to have a “power” voltage of 9-12V, and a separate step-down converter (for example, L7805) to power the “logic” of the circuit.

Matrix indicators

In fact, these are the same LEDs, only in the form of an 8x8 matrix. Photo from eBay:

Sold on eBay in the form of single modules or ready-made blocks, for example, 4 pieces. Their management is very simple - the microcircuit is already soldered on the modules MAX7219, ensuring their operation and connection to the microcontroller with just 5 wires. There are many libraries for Arduino, those who wish can look at the code.
Pros: low price, good viewing angles and brightness.
Cons: low resolution. But for the task of outputting time is enough.

LCD indicators

LCD indicators are graphic and text.

Graphical ones are more expensive, but they allow you to display more diverse information (for example, a graph of atmospheric pressure). Text ones are cheaper and easier to work with, they also allow you to display pseudo-graphics - it is possible to load custom characters into the display.

It is not difficult to work with an LCD indicator from the code, but there is a certain minus - the indicator requires a lot of control lines (from 7 to 12) from the microcontroller, which is inconvenient. Therefore, the Chinese came up with the idea of ​​​​combining an LCD indicator with an i2c controller, which turned out to be very convenient in the end - only 4 wires are enough to connect (photo from eBay).


LCD indicators are quite cheap (if you take it on eBay), large, they are easy to connect, and you can display a variety of information. The only negative is not very large viewing angles.

OLED indicators

They are an improved continuation of the previous version. They range from small and cheap 1.1" to large and expensive. Photo from eBay.

Actually, everything is good except for the price. As for small indicators, 0.9-1.1" in size, it is difficult to find any practical application for them (except for learning how to work with i2c).

Gas discharge indicators (IN-14, IN-18)

These indicators are now very popular, apparently because of the "warm lamp sound of light" and the originality of the design.


(photo from nocrotec.com)

The scheme of their connection is somewhat more complicated, because. these indicators for ignition use a voltage of 170V. Converter from 12V => 180V can be made on a chip MAX771. A Soviet microcircuit is used to supply voltage to the indicators. K155ID1 which was created specifically for this. Issue price for self-manufacturing: about 500 rubles for each indicator and 100 rubles for K155ID1, all other details, as they wrote in old magazines, "are not in short supply." The main difficulty here is that both IN-xx and K155ID1 have long been out of production, and you can only buy them on radio markets or in a few specialized stores.

2. Platform selection

We have more or less figured out the indication, it remains to decide which hardware platform is better to use. There are several options here (I don’t consider home-made ones, because those who know how to separate the board and solder the processor do not need this article).

Arduino

The easiest option for beginners. The finished board is inexpensive (about $10 on eBay with free shipping), has all the necessary connectors for programming. Photo from eBay:

Under Arduino there are a huge number of different libraries (for example, for the same LCD screens, real-time modules), Arduino is hardware compatible with various additional modules.
The main disadvantage: the complexity of debugging (only through the serial port console) and a rather weak processor by modern standards (2KB RAM and 16MHz).
The main plus: you can do a lot of things, practically without bothering with soldering, buying a programmer and wiring boards, it is enough to connect the modules with each other.

32-bit STM processors

For those who want something more powerful, there are ready-made boards with STM processors, for example, a board with STM32F103RBT6 and a TFT screen. Photo from eBay:

Here we already have full-fledged debugging in a full-fledged IDE (of all the different ones, I liked the Coocox IDE more), however, you will need a separate ST-LINK debugger with a JTAG connector (issue price $ 20-40 on eBay). Alternatively, you can buy a debug board STM32F4Discovery, on which this programmer is already built in, and it can be used separately.

Raspberry PI

And finally, for those who want full integration with the modern world, there are single-board computers with Linux, everyone probably already knows the Raspberry PI. Photo from eBay:

This is a full-fledged computer with Linux, a gigabyte of RAM and a 4-core processor on board. A panel of 40 pins is displayed on the edge of the board, allowing you to connect various peripherals (pins are available from the code, for example, in Python, not to mention C / C ++), there is also a standard USB in the form of 4 connectors (you can connect WiFi). There is also standard HDMI.
The power of the board is enough, for example, not only to display the time, but also to run an HTTP server for setting parameters via the web interface, downloading the weather forecast via the Internet, and so on. In general, the scope for a flight of fancy is large.

There is only one difficulty with Raspberry (and STM32 processors) - its pins use 3V logic, and most external devices (for example, LCD screens) work "the old fashioned way" from 5V. Of course, you can connect it like that, in principle, it will work, but this is not quite the right method, and it’s somehow a pity to ruin the $50 board. The correct way is to use the "logic level converter", which costs only $1-2 on eBay.
Photo from eBay:

Now it is enough to connect our device through such a module, and all parameters will be coordinated.

ESP8266

The method is rather exotic, but rather promising due to the compactness and cheapness of the solution. For very little money (about $4-5 on eBay) you can buy an ESP8266 module containing a processor and WiFi on board.
Photo from eBay:

Initially, such modules were intended as a WiFi bridge for exchanging via a serial port, however, enthusiasts wrote a lot of alternative firmware that allows you to work with sensors, i2c devices, PWM, etc. Hypothetically, it is quite possible to get time from an NTP server and display it via i2c to the display. For those who want to connect a lot of different peripherals, there are special NodeMCU boards with a large number of pins, the issue price is about 500 rubles (of course, on eBay):

The only negative is that the ESP8266 has very little RAM (depending on the firmware, from 1 to 32KB), but this makes the task even more interesting. ESP8266 modules use 3V logic, so the above level converter will also come in handy here.

On this, an introductory excursion into home-made electronics can be completed, the author wishes everyone successful experiments.

Instead of a conclusion

I eventually settled on using a Raspberry PI with a text indicator configured to work with pseudo-graphics (which turned out to be cheaper than a graphic screen of the same diagonal). I took a picture of the desktop clock screen while writing this article.

The clock displays the exact time taken from the Internet, and the weather that is updated from Yandex, all this is written in Python, and has been working quite well for several months. At the same time, an FTP server is running on the watch, which allows (together with port forwarding on the router) to update the firmware on them not only from home, but also from any place where there is Internet. As a bonus, Raspberry resources are basically enough to connect a camera and / or microphone with the ability to remotely monitor an apartment, or to control various modules / relays / sensors. You can add all sorts of "buns", such as LED indication of incoming mail, and so on.

PS: Why eBay?
As you can see, prices or photos from ebay were given for all devices. Why is that? Unfortunately, our stores often live by the principle “I bought for $1, I sold for $3, I live on these 2 percent”. As a simple example, the Arduino Uno R3 costs (at the time of writing) 3600r in St. Petersburg, and 350r on eBay with free shipping from China. The difference is really an order of magnitude, without any literary exaggeration. Yes, you have to wait a month to pick up the package at the post office, but I think that such a difference in price is worth it. But by the way, if someone needs it right now and urgently, then probably there is a choice in local stores, here everyone decides for himself.

On sale you can find many different models and options for electronic digital watches, but most of them are designed for indoor use, since the numbers are small. However, sometimes it is required to place the clock on the street - for example, on the wall of a house, or in a stadium, square, that is, where they will be visible at a great distance by many people. For this, this circuit of a large LED clock was developed and successfully assembled, to which you can connect (through internal transistor switches) LED indicators of arbitrarily large size. You can enlarge the circuit diagram by clicking on it:

Description of the watch

  1. Watch. In this mode, there is a standard view of the time display. There is a digital correction of the accuracy of the watch.
  2. Thermometer. In this case, the device measures the temperature of the room or the air outside, from one sensor. Range from -55 to +125 degrees.
  3. Power supply control is provided.
  4. Output of information to the indicator alternately - clock and thermometer.
  5. To save the settings and settings in the event of a 220V power outage, a non-volatile memory is used.


The basis of the device is the ATMega8 MK, which is flashed by exposing fuses according to the table:

Operation and clock management

When you turn on the clock for the first time, the screen will display an advertising splash screen, and then switch to the time display. Pushing the button SET_TIME the indicator will go in a circle from the main mode:

  • display mode for minutes and seconds. If in this mode you simultaneously press the button PLUS And MINUS, then seconds will be reset;
  • setting the minutes of the current time;
  • setting the clock of the current time;
  • symbol t. Setting the duration of the clock display;
  • symbol o. Time for displaying the symbols for indicating the external temperature (out);
  • the value of the daily correction of the accuracy of the watch. Symbol c and correction value. Setting limits from -25 to 25 sec. The selected value will be daily at 0 hours 0 minutes and 30 seconds added to or subtracted from the current time. For more details, read the instructions that are in the archive with firmware files and printed circuit boards.

Clock setting

Holding buttons PLUS/MINUS do an accelerated setting of values. After changing any settings, after 10 seconds, the new values ​​will be written to non-volatile memory and will be read from there when the power is turned on again. The new settings take effect during installation. The microcontroller monitors the presence of the main power supply. When it is turned off, the device is powered from an internal source. The Redundant Power Module schematic is shown below:


To reduce the current consumption, the indicator, sensors and buttons are turned off, but the clock itself continues to count time. As soon as the mains voltage of 220V appears, all indication functions are restored.


Since the device was conceived as a large LED clock, it has two displays: a large LED - for the street, and a small LCD - for easy adjustment of the main display. The large display is located at a distance of several meters from the control unit and is connected by two cables of 8 wires. To control the anodes of the external indicator of the indicators, transistor keys are used according to the scheme given in the archive. Project authors: Aleksandrovich & SOIR.

Clock concept with big numbers

Structurally, the device will consist of two boards - one above the other. The first board is a matrix of LEDs that form the digits of hours and minutes, the Second is the power part (LED control), logic and power. This design will make the watch more compact (without a case about 22 cm x 9 cm, 4-5 cm thick) + it will make it possible to screw the matrix to another project if something goes wrong.

The power section will be based on the UL2003 driver and transistor switches. Logic - on Atmega8 and DS1307. Power supply: 220V - transformer; logic 5V (via 7805), power section - 12V (via LM2576ADJ). Separately, there will be a bed for a 3V battery for autonomous power supply of the real time clock - DS1307.

I’m thinking of using Atmega8 and DS1307 (I plan to hang the watch under the ceiling, so that in the event of a power outage I don’t have to go through the settings every time), however, the layout of the board will suggest that the device can work without the DS1307 (for the first time, or maybe forever - how succeed).

Thus, depending on the configuration, the clock program operation algorithm will be as follows:

Atmega8- timer counter. Work in a cycle without pauses: polling the keyboard, adjusting the time (if necessary), displaying 4 digits and a separator.

Atmega8+DS1307. Work in a cycle without pauses: polling the keyboard, adjusting the DS1307 time (if necessary), reading the time from the DS1307, displaying 4 digits and a separator. Or another option - reading from the DS1307 on a timer, the rest in the cycle (I don’t know how better yet).

The segment consists of 4 red LEDs connected in series. One digit - 7 segments with a common anode. I don't plan to separate the segments with the figure-of-eight pattern, as is done in conventional indicators.

Power part of the clock

The power part of the clock is built on the UL2003 driver and transistor switches VT1 and VT2.

UL2003 is responsible for controlling the segments of the indicator, the keys are for controlling the digits.

Separate hour and minute separator (signal K8) is controlled separately.

The segments, digits and separator are controlled by the microcontroller by supplying a positive potential (i.e. supplying + 5V) to K1-K8, Z1-Z4.

Signaling to segments and discharges must be carried out synchronously and with a certain frequency in order to provide dynamic output of information (hours and minutes).

As a transistor VT1 (BCP53), you can use the transistor BCP52.

Scheme of the power part of the watch with large numbers

Printed circuit board for a seven-segment display for watches with large numbers

As I said earlier, structurally, the clock will consist of two printed circuit boards - an indicator board + logic and a power section.

Let's start with the design and manufacture of the indicator printed circuit board.

Development of a printed circuit board for a seven-segment indicator for watches with large numbers

The printed circuit board of the seven-segment indicator for watches with large numbers in the "lay" format is at the end of the article, in the attached files. You can read about the technology for manufacturing printed circuit boards using the LUT method.

If you did everything right, the finished PCB will look something like this.

Ready-made printed circuit board of a seven-segment indicator for watches with large numbers

Assembly of the seven-segment indicator

Since the indicator board is double-sided, the first thing to do is to make vias. I do this with the legs of unnecessary parts - I thread them into the holes and solder them on both sides. When all the transitions are done, I clean them with a flat small file - it turns out very neat and pretty.

Interlayer vias on the indicator board

The next step, in fact, is the assembly of the indicator. Why do we need a pack of red (green, white, blue) LEDs. For example, I took these.

Preparing to assemble the indicator

When installing diodes, do not forget that we are making an indicator with a common anode - i.e. "+" diodes must be connected together. Common PCB anodes are large chunks of copper. Be sure to pay attention to the anode of the separation point.

Location of anodes on the printed circuit board of the indicator

As a result, after 2 hours of painstaking work, this is what should happen:

Seven-segment indicator

The digital part of the watch

We will assemble the digital part of the clock with large numbers according to the scheme:

Clock scheme with large numbers

The clock scheme is quite transparent, so I don’t see the point in explaining how it works. The printed circuit board in *.lay format can be downloaded at the end of the article. I note that the printed circuit board is mainly designed for surface mount parts.

So, the element base that I used:

1. DFA028 diode bridge (any compact surface mount will do);
2. Voltage regulators LM2576ADJ in D2PAK package, 78M05 in HSOP3-P-2.30A package;
3. BCP53 transistor switches (SOT223 package) and BC847 (SOT23 package);
4. Microcontroller Atmega8 (TQFP);
5. Real time clock DS1307 (SO8);
6. Power supply 14V 1.2A from some old device;
7. The remaining parts - any type, suitable in size for installation on a printed circuit board.

Of course, if you want to use other parts packages, you will need to make some changes to the PCB.

Pay attention to the resistance values ​​R3 and R4 - they must be exactly as indicated in the diagram - no more, no less. This is done in order to provide exactly 12V at the output of the LM2576ADJ voltage regulator. If all the same it is not possible to find such resistor values, then the value of the resistance R4 can be calculated by the formula:

R4=R3(12/1.23-1) or R4=8.76R3

Assembly of the digital part. Version 1, without DS1307

If, in the manufacture of the clock circuit board, you followed the recommendations outlined in, then it is unnecessary for you to be reminded that the printed circuit board must be drilled before assembly, all visible short circuits on it are eliminated, and the board is covered with liquid rosin? Then we start assembling the clock.

I recommend starting with the assembly of the power supply and only then proceed with the installation of the digital part. This is a general recommendation for self-assembly of devices. Why? Just because if the power supply is assembled with an error, you can burn all the low-voltage electronics that should be powered by this power supply.

If everything is done correctly, the power supply should work immediately. We check the assembly of the power supply - we measure the voltage at the control points.

The figure shows the test points where the supply voltage should be checked. If the voltage corresponds to the declared one, you can start assembling the digital part of the clock. Otherwise, we check the installation and performance of the power supply elements.

Checkpoints and voltage values ​​​​for the clock power supply

After the power supply has been checked, we proceed to assemble the digital part of the clock - we install all the other elements on the printed circuit board. We check for short circuits, especially at the legs of the Atmega microcontroller and the UL2003 driver.

Mounting the digital part of the clock

Please note that we are assembling the clock WITHOUT installing the DS1307 real-time clock, however, all wiring of this microcircuit must be completed. In the future, if necessary, this will save us time for finalizing the clock for the second version, where a separate, independent real-time clock on the DS1307 will still be used.

ATMEGA8 microcontroller pre-check

In order to check the correctness and performance of the microcontroller, we need:

1. Programmer, for example.
2. for in-circuit programming of the microcontroller.
3. AVRDUDESHELL program.

Connect the clock board to the data cable. Connect the data cable to the programmer. Programmer to the computer on which the AVRDUDESHELL program is installed. Do not connect the clock board to a 220V power supply.

Successful reading of data from the microcontroller by the AVRDUDESHELL program

If there are problems when reading the fuses - check the installation - perhaps somewhere there is a short circuit or "non-solder". Another tip - perhaps the microcontroller is in low-speed programming mode, then it is enough to switch the programmer to this mode (

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