Stairs.  Entry group.  Materials.  Doors.  Locks.  Design

Stairs. Entry group. Materials. Doors. Locks. Design

» Alarm clock with remote control on PIC16F628A - Devices on microcontrollers - Schemes of devices on microcontrollers. LC meter on a PIC16F628A microcontroller. Scheme and description Description of the original scheme

Alarm clock with remote control on PIC16F628A - Devices on microcontrollers - Schemes of devices on microcontrollers. LC meter on a PIC16F628A microcontroller. Scheme and description Description of the original scheme

Clock with a small 4-digit indicator. The dot between hours and minutes flashes at a frequency of 0.5 seconds. Can be built into any object: a desk calendar, a radio, a car. Estimated error – 0.00002%. In practice, for six months there was never a need for correction.

Power supply 4.5 - 5 volts, current up to 70mA. The voltage stabilizer is located in the adapter plug. It is assembled on a 3-watt transformer and a high-frequency converter - stabilizer according to a standard circuit. For a car, of course, a transformer is not needed. The microcircuit does not heat up without a heatsink. Connector for 3.5mm power supply. Quartz 4 MHz. Any low-power n-p-n transistors.

Any buttons . The length of the button pusher is selected based on the design requirements. You can also solder buttons on the conductor side. Each time you press the button, a unit is added. When held, the count speeds up to a reasonable speed.

Resistors MLT – 0.25. R7 – R14 300 – 360 Ohm. R3 – R6 1-3 kOhm.
Batteries: 4 pieces of GP-170, or similar. When the mains voltage is turned off, they only supply power to the microcontroller. They hold up for 8 days exactly, I checked.
Diodes with the lowest voltage drop in the forward direction.

The boards are made of one-sided foil fiberglass.

Before installing the microcontroller into the panel of the manufactured board, turn on the power and measure the voltage on the 14th leg of the socket. It should be 4.5 - 4.8 volts. On the 5th leg 0 volts. If you are not sure about the quality of the manufactured board or the serviceability of the parts, check the device without a microcontroller. This is done very simply:

  • Insert a jumper from the bare wire into the socket, terminals 1 and 14. This means that +4.5 volts from the first leg will open transistor VT 2 through a resistor and the cathode of the clock unit indicator will be connected to zero.
  • Connect any wire with one end to +, and with the other end alternately touch terminals 6,7,8,9,10,11,12,13 of the socket.
  • At the same time, observe the lighting segments and their correspondence to the diagram: + on the 6th leg – segment “g” is lit and so on.
  • Move the jumper to terminals 2 and 14 of the socket. Check all segments of the minutes unit indicator.
  • Jumpers 18 and 14 – tens of hours are checked, 17 and 14 – tens of minutes.

If something doesn't work correctly, fix it. If everything is correct, program the microcontroller and insert it into the socket with the power off.
HEX file is attached.
Turn on the power and get a ready-made watch.

If you buy all the parts, including resistors, then according to my diagram the device will cost about 400 rubles:

  • PIC16F628A – 22.8 UAH
  • LM2575T-5.0 – 10 UAH
  • FYQ 3641AS21 - 9.3 UAH
  • Panel – 3 UAH
  • Quartz – 1.5 UAH

Literature:

  • Pic microcontrollers. Everything you need to know. Sid Katzen.2008
  • PIC microcontrollers. Architecture and programming. Michael Predko. 2010
  • Pic microcontrollers. Application practice. Christian Tavernier.2004
  • Development of embedded systems using PIC microcontrollers. Tim Wilmshurst. 2008
  • Data sheet: PIC16F628A, FYQ 3641, LM2575.
  • Tutorial on programming PIC controllers for beginners. Evgeny Korabelnikov. 2008

Below you can download the firmware and PCB in LAY format

List of radioelements

Designation Type Denomination

Shop

MK PIC 8-bit

PIC16F628A

1
Search in store
VR2 DC/DC pulse converter

LM2575

1 5VSearch in store
VT1-VT4 Bipolar transistor

KT315A

4
Search in store
VD1, VD3, VD4 Diode

D310

3
Search in store
VD2 Schottky diode

1N5819

1
Search in store
VD5 Diode bridge

DB157

1
Search in store
C1, C2 Capacitor20 pF2
Search in store
C3 Capacitor0.1 µF1
Search in store
C4 330 µF 16 V1
Search in store
C5 Electrolytic capacitor100 µF 35 V1
Search in store
R1, R2 Resistor

10 kOhm

2
Search in store
R3-R6 Resistor

1.5 kOhm

4
Search in store
R7-R9, R11-R14 Resistor

300 Ohm

7
Search in store
R10 Resistor

360 Ohm

1

These electronic watches are the simplest. They were assembled in a few hours. The basis is a PIC16F628A microcontroller; in addition to it, the clock contains several simple and cheap elements; the information is displayed on a 4-digit (clock) LED indicator. The circuit is powered from the mains and also has a backup power supply. This design can be recommended for beginners; I specifically provided the original program with detailed comments to make it easier to understand what and how it works.

The circuit is very simple, simple and the algorithm of their work (see comments in the source). Buttons kn1 and kn2 are used to correct the time - hours and minutes, respectively. The clock has a 24 hour display format. In the 1st digit of the clock, an insignificant zero has been suppressed. The accuracy of the clock depends entirely on the frequency of the quartz resonator. But even without special selections of quartz and capacitors in the clock generator, the clock runs very accurately.

The clock is assembled on 2 printed circuit boards, docked one to the other at an angle of 90 degrees. The entire indicator is placed on one board, and everything else is on the other. The backup battery was broken from a Chinese lighter with an LED flashlight. We remove the LED and install the battery holder on the board. The photo shows that cut-off resistor leads are connected to the batteries - they hold this entire structure. Of course, the capacity of such batteries is small, but when the watch is powered from the mains, no current is consumed from the batteries. They power the circuit only if there is no mains power. In this case, only the microcontroller is powered, the indicator is not powered by batteries, so it goes out, and the clock continues to tick. The control buttons are located on the board in any convenient place on the case. The design of the buttons can be any. To supply power from the network, a Chinese power supply adapter was used, to which a board with a 7805 chip (5-volt stabilizer) was added. In general, any power supply with an output voltage of 5V and a current of 150mA will do.

The program is written in such a way that it can be used for initial study of the PIC microcontroller; the action of almost every command is commented on. If desired, you can easily add additional functions to it, such as a calendar, timer, stopwatch, etc.



File:
Size:
Content:


This version of the watch is made in such a way as to simplify the circuit as much as possible, reduce power consumption, and ultimately obtain a device that easily fits in your pocket. By choosing miniature batteries to power the circuit, SMD mounting and a miniature speaker (for example, from a non-working mobile phone), you can get a design slightly larger than a matchbox.
The use of a super-bright indicator allows you to reduce the current consumed by the circuit. A reduction in current consumption is also achieved in the "LoFF" mode - the indicator is off, and only the blinking dot of the low-order digit of the clock is turned on.

Indication
Adjustable brightness of the indicators allows you to choose the most comfortable display of readings (and again reduce energy consumption).
The watch has 9 display modes. Switching between modes is carried out using the “plus” and “minus” 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. The use of short-term prompts made it possible to achieve good ergonomics of the watch. When switching between display modes (of which there are quite a lot for such a simple device as an ordinary watch), there is no confusion, and it is always clear which readings are displayed on the indicator.


Correction of the readings displayed on the indicator is activated by pressing the "Correction" button. In this case, a short-term prompt is displayed for 1/4 second, after which the adjusted value begins to blink at a frequency of 2 Hz. The readings are corrected using the plus and minus buttons. When you press the button for a long time, the auto-repeat mode is activated at the specified frequency. The auto-repeat frequencies for pressing a button are: for hours, months and day of the week - 4 Hz; for minutes, year and indicator brightness - 10 Hz; for the correction value - 100 Hz.
All adjusted values, except hours, minutes and seconds, are written to EEPROM and restored after turning the power off and on. The seconds during correction are reset to zero. All modes except hours-minutes, minutes-seconds and LoFF are automatically returned. If no button is pressed within 10 seconds, the clock switches to the hour-minute display mode.
By pressing the button "On/Off alarm." The alarm clock turns on/off. The activation of the alarm is confirmed by a short two-tone sound. When the alarm clock is on, the dot in the low-order digit of the indicator lights up.
In the "Corr" mode, a correction constant is displayed on the indicator, the initial value of which is 5000 microseconds per second. When the clock lags, we increase the constant by the amount of lag calculated in microseconds per second. If the clock is in a hurry, then we reduce the constant using the same principle.

Here is another sample of laboratory equipment - an LC meter. This measurement mode, especially the L measurement, is almost impossible to find in cheap factory multimeters.

Scheme of this LC meter on microcontroller was taken from the site www.sites.google.com/site/vk3bhr/home/index2-html. The device is built on a 16F628A PIC microcontroller, and since I recently purchased a PIC programmer, I decided to test it with this project.

I removed the 7805 regulator because I decided to use a 5 volt cell phone charger.

In the circuit, the trimmer resistor is 5 kOhm, but in reality I installed 10 kOhm, according to the datasheet for the purchased LCD module.
All three capacitors are 10 µF tantalum. It should be noted that capacitor C7 - 100 µF is actually 1000 µF.
Two 1000pF capacitors, styroflex capacitors with a tolerance of 1%, 82µH inductive coil.

The total current consumption with backlight is about 30mA.
Resistor R11 limits the backlight current and must be sized according to the LCD module actually used.

I used the original PCB drawing as a starting point and modified it to fit the components I had.
Here's the result:




The last two photos show the LC meter in action. On the first of them, the capacitance of a 1nF capacitor is measured with a deviation of 1%, and on the second - an inductance of 22 μH with a deviation of 10%. The device is very sensitive - that is, with an unconnected capacitor it shows a capacitance of about 3-5 pF, but this is eliminated by calibration.