How to make a simple electronic watch with your own hands. Homemade clock on LED matrices. Ready clock on Arduino

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. The clock displays the current time, year, month and day of the week, as well as the temperature outside and inside the house with a ticker. 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

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. The digital indicators on the diagram are located in the correct 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.

Not long ago there became a need to have a clock in the house, but only an electronic one, since I don’t like 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 simplest scheme, since I don’t need a watch with an alarm clock.

I chose this scheme because it’s easy make your own watch

Let's get started, so what do we need in order to make a watch with our own hands? Well, of course, hands, skill (not even great) in reading circuit diagrams, soldering iron and parts. Here's a complete list of what I used:

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

But there is a flaw in this scheme: the pins of the microcontroller (hereinafter referred to as MK), which are responsible for controlling the discharges, receive quite a decent load. The total current is much higher than the maximum port current, but with dynamic indication the MK does not have time to overheat. To prevent the MK from malfunctioning, 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 MK. The repetition rate of these signals is more than 25 Hz and because of this, the glow of the indicator numbers seems continuous.

Electronic watches made according to the above scheme can only show time (hours and minutes), and seconds are shown by a dot between the segments, which is flashing. To control the operating mode of the watch, push-button switches are provided in its structure, which control the setting of hours and minutes. This circuit is powered from a 5V power supply. During 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 the board, the 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. Afterwards, the textolite of the required size was cut out. My size turned out to be 36*26 mm. Such a small size is due to the fact that all parts are selected in an SMD package.

The board was etched using ferric chloride (FeCl 3 ). The etching took about an hour, since the bath with the board was on the fireplace; high temperature affects the etching time; no copper was used in the board. But don't overdo it with the temperature.

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

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

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

Hello geektimes! The first part of the article discussed the principles of obtaining accurate time on a homemade watch. 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 simply connected to the microcontroller through quenching resistors.

Beware of traffic!

Pros: simplicity of design, good viewing angles, low price.
Cons: The amount of information displayed 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 can help. Difficulties begin when we want to make a large clock - after all, looking at a small indicator is not particularly convenient. Then we need the following indicators (photo from eBay):

They are powered by 12V, and they simply won’t work directly from the microcontroller. This is where the microcircuit comes to our aid. CD4511, just for this purpose. 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

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

They are sold on eBay in the form of single modules or ready-made blocks, for example 4 pieces. Managing them is very simple - a microcircuit is already soldered onto the modules MAX7219, ensuring their operation and connection to the microcontroller using only 5 wires. There are many libraries for Arduino, anyone can look at the code.
Pros: low price, good viewing angles and brightness.
Cons: low resolution. But for the inference task, the time is quite enough.

LCD indicators

LCD indicators can be graphic or text.

Graphic ones are more expensive, but they allow you to display more varied 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 symbols into the display.

Working with an LCD indicator from code is not difficult, but there is a certain disadvantage - the indicator requires many 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 ended up being very convenient - only 4 wires are enough to connect (photo from eBay).


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

OLED indicators

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

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

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

These indicators are now very popular, apparently due to the “warm tube sound of light” and the originality of the design.


(photo from nocrotec.com)

Their connection diagram is somewhat more complicated, because These indicators use a voltage of 170V for ignition. A converter from 12V=>180V can be made on a microcircuit MAX771. A Soviet microcircuit is used to supply voltage to the indicators K155ID1, which was created specifically for this purpose. The issue price for self-production: about 500 rubles for each indicator and 100 rubles for K155ID1, all other parts, 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 at radio markets or in a few specialized stores.

2. Platform selection

We have more or less figured out the display, all that remains is to decide which hardware platform is best to use. There are several options here (I’m not considering homemade ones, because those who know how to route a board and solder a processor don’t need this article).

Arduino

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

There are a huge number of different libraries for Arduino (for example, for the same LCD screens, real-time modules), Arduino is hardware compatible with various additional modules.
The main disadvantage: the difficulty of debugging (only through the serial port console) and a rather weak processor by modern standards (2KB RAM and 16MHz).
The main advantage: you can do a lot of things, practically without bothering with soldering, buying a programmer and wiring boards; you just need to connect the modules to 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 (out of all the different ones, I liked the Coocox IDE best), however, we will need a separate ST-LINK programmer-debugger with a JTAG connector (the issue price is $20-40 on eBay). Alternatively, you can buy the STM32F4Discovery development board, 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, probably already known to everyone - 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 located on the edge of the board, allowing you to connect various peripherals (pins are available from 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 board’s power is enough, for example, not only to display the time, but also to run an HTTP server for setting parameters via a web interface, loading a weather forecast via the Internet, and so on. In general, there is a lot of room for flight of fancy.

There is only one difficulty with Raspberry (and STM32 processors) - its pins use 3-V logic, and most external devices (for example LCD screens) operate the “old-fashioned” way from 5V. Of course, you can connect it this way, and in principle it will work, but this is not quite the correct method, and it’s kind of a shame to ruin a $50 board. The correct way is to use a “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 consistent.

ESP8266

The method is rather exotic, but quite promising due to the compactness and low cost 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 exchange via a serial port, but enthusiasts have written many alternative firmware that allow them to work with sensors, i2c devices, PWM, etc. Hypothetically, it is quite possible to receive time from an NTP server and output 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 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 32 KB), but this makes the task even more interesting. The ESP8266 modules use 3V logic, so the level converter above will also come in handy here.

This concludes the introductory excursion into homemade electronics; 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 photo of the desktop clock screen while writing this article.

The clock displays the exact time taken from the Internet, and the weather is updated from Yandex, all this is written in Python, and has been working quite well for several months now. At the same time, an FTP server is running on the watch, which allows (coupled with port forwarding on the router) to update its firmware not only from home, but also from any place where there is Internet. As a bonus, Raspberry resources, in principle, are enough to connect a camera and/or microphone with the ability to remotely monitor the apartment, or to control various modules/relays/sensors. You can add all sorts of “goodies”, 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 “bought for $1, sold for $3, and live on that 2 percent.” As a simple example, Arduino Uno R3 costs (at the time of writing) 3600 rubles in St. Petersburg, and 350 rubles on eBay with free shipping from China. The difference is truly an order of magnitude, without any literary exaggeration. Yes, you will have to wait a month to pick up the parcel at the post office, but I think such a difference in price is worth it. But however, if someone needs it right now and urgently, then there is probably a choice in local stores, here everyone decides for themselves.

As the name suggests, the main purpose of this device is to find out the current time and date. But it has many other useful features. The idea for its creation appeared after I came across a half-broken watch with a relatively large (for a wrist) metal case. I thought that I could insert a homemade clock there, the possibilities of which are limited only by my own imagination and skill. The result was a device with the following functions:

1. Clock - calendar:

    Counting and displaying hours, minutes, seconds, day of the week, day, month, year.

    Availability of automatic adjustment of the current time, which is performed every hour (maximum values ​​+/-9999 units, 1 unit = 3.90625 ms.)

    Calculating the day of the week from a date (for the current century)

    Automatic transition between summer and winter time (can be switched off)

  • Leap years are taken into account

2. Two independent alarm clocks (a melody sounds when triggered)
3. Timer with 1 second increments. (Maximum counting time 99h 59m 59s)
4. Two-channel stopwatch with counting resolution of 0.01 sec. (maximum counting time 99h 59m 59s)
5. Stopwatch with counting resolution of 1 second. (maximum counting time 99 days)
6. Thermometer in the range from -5°C. up to 55°C (limited by the temperature range of normal operation of the device) in increments of 0.1°C.
7. Reader and emulator of electronic keys - tablets of the DS1990 type using the Dallas 1-Wire protocol (memory for 50 pieces, which already contains several universal “all-terrain keys”) with the ability to view the key code byte by byte.
8. IR remote control (only the “Take a picture” command is implemented) for digital cameras “Pentax”, “Nikon”, “Canon”
9. LED flashlight
10. 7 melodies
11. Sound signal at the beginning of every hour (can be switched off)
12. Sound confirmation of button presses (can be switched off)
13. Battery voltage monitoring with calibration function
14. Digital indicator brightness adjustment

Maybe such functionality is redundant, but I like universal things, and plus the moral satisfaction that this watch will be made with my own hands.

Schematic diagram of the clock

The device is built on the ATmega168PA-AU microcontroller. The clock ticks according to timer T2, operating in asynchronous mode from a clock quartz at 32768 Hz. The microcontroller is in sleep mode almost all the time (the indicator is off), waking up once a second to add this very second to the current time and falls asleep again. In active mode, the MK is clocked from the internal RC oscillator at 8 MHz, but the internal prescaler divides it by 2, as a result, the core is clocked at 4 MHz. For indication, four single-digit LED digital seven-segment indicators with a common anode and a decimal point are used. There are also 7 status LEDs, the purpose of which is as follows:
D1- Negative value sign (minus)
D2- Sign of a running stopwatch (flashing)
D3- Sign of the first alarm clock being turned on
D4- Sign of the second alarm being turned on
D5- Sign of sound signal at the beginning of every hour
D6- Sign of a running timer (flashing)
D7- Low battery voltage indicator

R1-R8 - current-limiting resistors of segments of digital indicators HG1-HG4 and LEDs D1-D7. R12,R13 – divider for monitoring battery voltage. Since the clock supply voltage is 3V, and the white LED D9 requires about 3.4-3.8V at rated current consumption, it does not glow at full strength (but it is enough to avoid stumbling in the dark) and is therefore connected without a current-limiting resistor. Elements R14, Q1, R10 are designed to control the infrared LED D8 (remote control implementation for digital cameras). R19, ​​R20, R21 are used for pairing when communicating with devices that have a 1-Wire interface. Control is carried out by three buttons, which I conventionally called: MODE (mode), UP (up), DOWN (down). The first of them is also designed to wake up the MK by an external interrupt (in this case the indication turns on), so it is connected separately to the PD3 input. The pressing of the remaining buttons is determined using an ADC and resistors R16, R18. If the buttons are not pressed within 16 seconds, the MK goes to sleep and the indicator goes off. When in mode “Remote control for cameras” this interval is 32 seconds, and with the flashlight on - 1 minute. MK can also be put to sleep manually using the control buttons. When the stopwatch is running with a count resolution of 0.01 sec. The device does not go into sleep mode.

Printed circuit board

The device is assembled on a double-sided printed circuit board of a circular shape to the size of the inner diameter of the wristwatch case. But in production I used two single-sided boards with a thickness of 0.35 mm. This thickness was again obtained by peeling it off from double-sided fiberglass laminate with a thickness of 1.5 mm. The boards were then glued together. All this was done because I did not have thin double-sided fiberglass, and every millimeter of thickness saved in the limited internal space of the watch case is very valuable, and there was no need for alignment in the manufacture of printed conductors using the LUT method. The printed circuit board drawing and parts location are in the attached files. On one side there are indicators and current-limiting resistors R1-R8. On the back are all the other details. There are two through holes for white and infrared LEDs.

The button contacts and battery holder are made of flexible spring sheet steel with a thickness of 0.2...0.3 mm. and tinned. Below are photos of the board from both sides:

Design, parts and their possible replacement

The ATmega168PA-AU microcontroller can be replaced with ATmega168P-AU, ATmega168V-10AU ATmega168-20AU. Digital indicators - 4 pieces KPSA02-105 super-bright red glow with a digit height of 5.08 mm. Can be supplied from the same series KPSA02-xxx or KCSA02-xxx. (just not green ones - they will glow faintly) I am not aware of other analogues of similar sizes with decent brightness. In HG1, HG3, the connection of the cathode segments is different from HG2, HG4, because it was more convenient for me for wiring the printed circuit board. In this regard, a different character generator table is used for them in the program. Used resistors and capacitors SMD for surface mounting of standard sizes 0805 and 1206, LEDs D1-D7 of standard size 0805. White and infrared LEDs with a diameter of 3 mm. The board has 13 through holes into which jumpers must be installed. A DS18B20 with a 1-Wire interface is used as a temperature sensor. LS1 is a regular piezoelectric tweeter, inserted into the lid. With one contact it is connected to the board using a spring installed on it, with the other it is connected to the watch body by the cover itself. Quartz resonator from a wristwatch.

Programming, firmware, fuses

For in-circuit programming, the board has only 6 round contact spots (J1), since a full connector does not fit in height. I connected them to the programmer using a contact device made from a PLD2x3 pin plug and springs soldered onto them, pressing them with one hand to the spots. Below is a photo of the device.

I used it because during the debugging process I had to reflash the MK many times. When flashing one-time firmware, it is easier to solder thin wires connected to the programmer to the patches, and then unsolder them again. It is more convenient to flash the MK without a battery, but so that the power comes either from an external +3V source or from a programmer with the same supply voltage. The program is written in assembler in the VMLAB 3.15 environment. Source codes, firmware for FLASH and EEPROM in the application.

The FUSE bits of the DD1 microcontroller must be programmed as follows:
CKSEL3...0 = 0010 - clocking from internal RC oscillator 8 MHz;
SUT1...0 =10 - Start-up time: 6 CK + 64 ms;
CKDIV8 = 1 - frequency divider by 8 is disabled;
CKOUT = 1 - Output Clock on CKOUT disabled;
BODLEVEL2…0 = 111 - supply voltage control is disabled;
EESAVE = 0 - erasing EEPROM when programming the crystal is prohibited;
WDTON = 1 - Watchdog Timer is not always on;
The remaining FUSE bits are best left untouched. The FUSE bit is programmed if set to “0”.

Flashing the EEPROM with the dump included in the archive is required.

The first cells of the EEPROM contain the initial parameters of the device. The table below describes the purpose of some of them, which can be changed within reasonable limits.

Cell address

Purpose

Parameter

Note

The amount of battery voltage at which a low level signal occurs

260 ($104) (2.6V)

coefficient for correcting the value of the measured battery voltage

time interval for switching to sleep mode

1 unit = 1 sec

time interval for switching to sleep mode when the flashlight is on

1 unit = 1 sec

time interval for switching to sleep mode when in remote control mode for cameras

1 unit = 1 sec

IButton key numbers are stored here

Small explanations on points:

1 point. This indicates the voltage level on the battery at which the LED will light up, indicating its low value. I set it to 2.6V (parameter - 260). If you need something else, for example 2.4V, then you need to write 240 ($00F0). The low byte is stored in the cell at address $0000, and the high byte is stored in $0001.

2 point. Since I did not install a variable resistor on the board to adjust the accuracy of the battery voltage measurement due to lack of space, I introduced software calibration. The calibration procedure for accurate measurement is as follows: initially, the coefficient 1024 ($400) is written in this EEPROM cell, you need to switch the device to active mode and look at the voltage on the indicator, and then measure the real voltage on the battery with a voltmeter. The correction factor (K), which must be set, is calculated by the formula: K=Uр/Ui*1024 where Uр is the real voltage measured by the voltmeter, Ui is the voltage that was measured by the device itself. After calculating the “K” coefficient, it is entered into the device (as stated in the operating instructions). After calibration, my error did not exceed 3%.

3 point. Here you can set the time after which the device will go into sleep mode if no buttons are pressed. Mine costs 16 seconds. If, for example, you need to fall asleep in 30 seconds, then you need to write down 30 ($26).

In points 4 and 5 the same.

6 point. At address $0030 the zero key family code (Dallas 1-Wire) is stored, then its 48-bit number and CRC. And so 50 keys in sequence.

Setup, operating features

Setting up the device comes down to calibrating the battery voltage measurement, as described above. It is also necessary to detect the deviation of the clock rate for 1 hour, calculate and enter the appropriate correction value (the procedure is described in the operating instructions).

The device is powered by a CR2032 (3V) lithium battery and consumes approximately 4 µA in sleep mode, and 5...20 mA in active mode, depending on the brightness of the indicator. With daily five-minute use of the active mode, the battery should last approximately 2....8 months depending on the brightness. The watch case is connected to the battery negative.

Key reading was tested on the DS1990. Emulation has been tested on METAKOM intercoms. Under serial numbers from 46 to 49 (last 4) universal keys for intercoms are flashed (all keys are stored in EEPROM, they can be changed before flashing). The key registered under number 49 opened all the METAKOM intercoms that I came across, I did not have a chance to test the rest of the universal keys, I took their codes from the network.

Remote control for cameras was tested on Pentax optio L20 and Nikon D3000 models. Canon could not be obtained for review.

The user manual takes up 13 pages, so I did not include it in the article, but included it in an appendix in PDF format.

The archive contains:
Scheme in and GIF;
Drawing of the printed circuit board and arrangement of elements in the format;
Firmware and source code in assembler;

List of radioelements

Designation Type Denomination Quantity NoteShopMy notepad
DD1 MK AVR 8-bit

ATmega168PA

1 PA-AU To notepad
U2 temperature sensor

DS18B20

1 To notepad
Q1 MOSFET transistor

2N7002

1 To notepad
C1, C2 Capacitor30 pF2 To notepad
C3, C4 Capacitor0.1 µF2 To notepad
C5 Electrolytic capacitor47 µF1 To notepad
R1-R8, R17 Resistor

100 Ohm

9 To notepad
R9 Resistor

10 kOhm

1 To notepad
R10 Resistor

8.2 Ohm

1 To notepad
R11 Resistor

300 Ohm

1 To notepad
R12 Resistor

2 MOhm

1 To notepad
R13 Resistor

220 kOhm

1 To notepad
R14 Resistor

30 kOhm

1 To notepad
R15, R19 Resistor

4.7 kOhm

2 To notepad
R16 Resistor

20 kOhm

1