Construction portal - Doors and gates.  Interior.  Sewerage.  Materials.  Furniture.  News

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 clock under the ceiling, and 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 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 time DS1307 (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've done everything right, you're done. printed circuit board 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 completed, 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 clock

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 remind 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 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 the need arises, 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 (

Not long ago, there was a need to have a clock in the house, but only electronic, since I don’t like analog clocks, because they tick. I have quite a bit of experience in soldering and etching circuits. After scouring the Internet and reading some literature, I decided to choose the most a simple circuit because I don't need an alarm clock.

I chose this scheme because it is easy make a watch with your own hands

Let's get started, so what do we need in order to make ourselves a clock with our own hands? Well, of course, hands, the ability (not even great) to read circuits, a soldering iron and details. Here is a complete list of what I used:

Quartz at 10 MHz - 1 pc, ATtiny 2313 microcontroller, 100 Ohm resistors - 8 pcs, 3 pcs. 10 kOhm, 2 x 22 pF capacitors, 4 transistors, 2 buttons, LED indicator 4-bit KEM-5641-ASR (RL-F5610SBAW/D15). I performed the installation on a one-sided textolite.

But there is a flaw in this scheme.: the outputs of the microcontroller (hereinafter MK), which are responsible for managing the discharges, receive a pretty decent load. The total current is much greater than the maximum port current, but at dynamic indication MK does not have time to overheat. In order for the MK not to fail, we add 100 Ohm resistors to the discharge circuits.

In this scheme, the indicator is controlled according to the principle of dynamic indication, according to which the indicator segments are controlled by signals from the corresponding outputs of the MC. The repetition frequency of these signals is more than 25 Hz and because of this, the glow of the indicator numbers seems to be continuous.

Electronic clock, made according to the above scheme, can only show time (hours and minutes), while seconds are shown by a dot between segments which is blinking. To control the operating mode of the clock, its structure provides push-button switches that control the setting of hours and minutes. This circuit is powered by a 5V power supply. In the manufacture of the printed circuit board, a 5V zener diode was included in the circuit.

Since I have a 5V power supply, I excluded the zener diode from the circuit.

To make a board, a circuit was applied using an iron. That is, the printed circuit was printed on an inkjet printer using glossy paper, it can be taken from modern glossy magazines. After that, the textolite of the required dimensions was cut out. I got the size 36 * 26 mm. Such a small size due to the fact that all the parts are selected in the SMD package.

The board was etched using ferric chloride (FeCl 3 ). In terms of time, the etching took about an hour, since the bath with a fee was on the fireplace, heat affects the etching time, not used copper in the board. But do not overdo it with the temperature.

While the process of etching was going on, in order not to rack my brains and not write the firmware for the clock, I went to the Internet and found a firmware for this scheme. How to flash MK can also be found on the Internet. I used a programmer that only flashes MK from ATMEGA.

And finally, our board is ready and we can start soldering our clock. For soldering, you need a 25 W soldering iron with a thin tip in order not to burn the MK and other parts. We carry out soldering carefully and preferably from the first time we solder all the legs of the MK, but only separately. For those who are not in the know, know that the parts made in the SMD package have tin on their terminals for fast soldering.

And this is what the board looks like with soldered parts.

I bring to your attention electronic microcontroller clock. The clock circuit is very simple, contains a minimum of details, is available for repetition by beginner radio amateurs.

The design is assembled on a microcontroller and real time clock DS1307. A four-digit seven-segment LED indicator (ultra-bright, blue color glow, which looks good in the dark, and, at the same time, the clock plays the role of a night light). The clock is controlled by two buttons. Thanks to the use of the DS1307 real-time clock chip, the program algorithm turned out to be quite simple. The microcontroller communicates with the real-time clock via the I2C bus, and is organized by software.

Clock scheme:

Unfortunately, there is an error in the diagram:
- the conclusions of the MK to the bases of the transistors must be connected:
PB0 to T4, PB1 to T3, PB2 to T2, PB3 to T1
or change the connection of the transistor collectors to the indicator bits:
T1 to DP1 ….. T4 to DP4

Details used in the clock circuit:

♦ ATTiny26 microcontroller:

♦ real time clock DS1307:

♦ 4-digit 7-segment LED indicator - FYQ-5641UB -21 common cathode (ultra-bright blue):

♦ quartz 32.768 kHz, with an input capacitance of 12.5 pF (can be taken from the computer motherboard), the accuracy of the clock depends on this quartz:

♦ all transistors are NPN structures, you can use any (KT3102, KT315 and their foreign counterparts), I used BC547C
♦ microchip voltage regulator type 7805
♦ all 0.125 watt resistors
♦ polar capacitors for operating voltage not lower than supply voltage
♦ backup power DS1307 - 3 volt lithium cell CR2032

Any unnecessary cell phone charger can be used to power the watch (in this case, if the output voltage charger within 5 volts ± 0.5 volts, part of the circuit is a voltage regulator on a 7805 type chip, can be excluded)
The current consumption of the device is - 30 mA.
The backup battery of the DS1307 clock can be omitted, but then, if the mains voltage fails, the current time will have to be set again.
The printed circuit board of the device is not shown, the design was assembled in a case from a faulty mechanical clock. An LED (with a flashing frequency of 1 Hz, from the output of SQW DS1307) serves to separate hours and minutes on the indicator.

Factory settings of the microcontroller: clock frequency - 1 MHz, FUSE-bits do not need to be touched.

Clock algorithm(in Algorithm Builder):

1. Setting the stack pointer
2. Setting the timer T0:
— frequency SK/8
- overflow interrupts (with such a preset frequency, the interrupt is called every 2 milliseconds)
3. Initialization of ports (pins PA0-6 and PB0-3 are configured for output, PA7 and PB6 for input)
4. Initialization of the I2C bus (PB4 and PB5 pins)
5. Checking the 7th bit (CH) of the zero register DS1307
6. Global interrupt enable
7. Entering a loop with a button click test

When the DS307 is turned on for the first time, or turned on again if there is no backup power, it will go to the initial setting of the current time. In this case: button S1 - to set the time, button S2 - transition to the next category. Set time - hours and minutes are written to DS1307 (seconds are set to zero), and the SQW / OUT pin (pin 7) is configured to generate rectangular pulses at a frequency of 1 Hz.
When you press the S2 button (S4 - in the program), interrupts are globally disabled, the program goes into the time correction subroutine. At the same time, the tens and units of minutes are set with the S1 and S2 buttons, then, from 0 seconds, by pressing the S2 button, the updated time is recorded in the DS1307, the global interrupt is enabled and the return to the main program is performed.

The watch showed good accuracy, the time drift for a month is 3 seconds.
To improve the accuracy of the course, it is recommended to connect quartz to the DS1307, as indicated in the datasheet:

The program was written in the Algorithm Builder environment.
You can, using the clock program as an example, familiarize yourself with the algorithm for communicating the microcontroller with other devices via the I2C bus (each line is commented in detail in the algorithm).

A photo of the assembled device and a printed circuit board in .lay format from the reader of the site Anatoly Pilguk, for which many thanks to him!

The device uses: Transistors - SMD VS847 and CHIP resistors

Appendices to the article:

(42.9 KiB, 3227 hits)

(6.3 KiB, 4180 hits)

(3.1 KiB, 2657 hits)

(312.1 KiB, 5929 hits)


The second version of the clock program in AB (for those who do not download the top one)

(11.4 KiB, 1942 hits)

In this step by step instructions tell you how to do it 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,
  • Font white color with black outline
  • Gray stripes where the LED strips will be

Print the template and cut out the stripes stationery 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


Paste using the template led strip on 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 have 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.

This clock is assembled on a well-known chip set - K176IE18 (binary counter for clocks with a ring signal generator),

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

When the power is turned on, zeros are automatically written to the counter of hours, minutes and to the memory register of the U2 microcircuit. For installation

time, press the S4 (Time Set) button and while holding it, press the S3 (Hour) button - to set the hours 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

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

closed). The S6 (Reset) button is used to force the minute indicators to be reset to 00 when setting. LEDs D3 and D4 play a role

separating dots flashing at a frequency of 1 Hz. The digital indicators on the diagram are in the correct order, i.e. go 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 clock, KT315A transistors can be replaced with any low-power silicon of the corresponding structure, KT815A - with transistors

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

dynamic, without built-in generator, winding resistance 45 Om. Button S1 is naturally latched.

The indicators used are green TOS-5163AG, 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 clock, it may be necessary to adjust the frequency of the crystal oscillator. This can be done most accurately by controlling the digital

frequency meter, the oscillation period is 1 s at pin 4 of the U1 microcircuit. Adjusting the generator according to the course of the clock will require a significantly higher cost

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

shone evenly brightly. The current consumed by the watch does not exceed 180 mA.

The clock 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 notice an error, select a piece of text and press Ctrl + Enter
SHARE:
Construction portal - Doors and gates.  Interior.  Sewerage.  Materials.  Furniture.  News