Clock diagrams on pic16f628a large indicators. Clock on PIC16F628A and FYQ3641A

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

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

Any buttons. The length of the button pusher is selected based on the requirements of the design. You can solder the buttons on the side of the conductors. Each time the button is pressed, one is added. When held, the score accelerates to a reasonable speed.

MLT resistors - 0.25. R7 - R14 300 - 360 Ohm. R3 - R6 1-3 kOhm. Batteries: 4 pieces from GP-170 or similar. When the mains voltage is turned off, they feed only the microcontroller. 8 days stand exactly, checked. Diodes with the lowest forward voltage drop. 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 panel. Should be 4.5 - 4.8 volts. Pin 5 has 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 bare wire jumper into the socket, terminals 1 and 14. This means that +4.5 volts from the first leg through the resistor will open the transistor VT 2 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 panel.
  • At the same time, observe the igniting segments and their correspondence to the scheme: + on the 6th leg - segment "g" is lit and so on.
  • Move the jumper to terminals 2 and 14 of the panel. Check all segments of the minute units indicator.
  • Jumper 18 and 14 - tens of hours are checked, 17 and 14 - tens of minutes.

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

If you buy all the details, including resistors, then, in accordance with my scheme, the device will cost about 400 rubles:

  • - 22.8 UAH
  • - 10 UAH
  • FYQ 3641AS21 - 9.3 UAH
  • Socket - 3 UAH
  • Quartz - 1.5 UAH

Source: www.cxem.net


Also often viewed with this scheme:

Hello dear readers! I offer you the history of the creation of watches on gas-discharge indicators IN-14. A simple project at the beginning turned into a whole artistic composition that made me sweat a lot.

The watch has an accuracy correction and a backup in case of power failure.

background

It all started when Alexey (teXnik) posted your article. In close contact with the author of the article, I was able to repeat the project. The clock has been wired on a single double-sided board with a very ergonomic layout. Everything suited, but there was one drawback - the impossibility of correcting the accuracy of the course.


I began to pick up quartz resonators, but for some reason I could not achieve care for less than a minute in one day.

Decided on the old Soviet schemes assemble a stable generator on logic elements.


The generator made it possible to achieve an accuracy of up to half a second in one day. The result is average, moreover, requiring the use of a frequency meter high class precision for adjustment. In the tuned oscillator, it was necessary to lock the variable capacitance by varnishing it, which again led to a frequency shift for the simple reason that the varnish tightened the gaps of the tuning capacitor. In addition, the introduction of a stable oscillator circuit increased the current consumption of the clock.

After suffering for a week, I decided to try to repeat another watch project on lamp indicators, and, of course, with software correction of the course. The topic is not new and there have been many successful implementations of such an idea over the years.

Scheme of the new clock on PIC16F628A

The basis of the circuit is built on the PIC16F628A microcontroller, which sends signals to the K155ID1 decoder and controls the anode switches.

The circuit is powered by a single +12 V source. The LM78L05 type stabilizer provides +5 V to power the microcircuits. High voltage, necessary to power the gas discharge indicators, received from the inverter on the MC3403 chip. The output voltage is adjusted by a divider included in the feedback.
The disadvantage of such an inverter circuit is the absence of a buffer key in the field-effect transistor circuit. The total current consumption of the inverter circuit is 230 mA.
An indisputable plus is the adjustment of the output voltage, and as a result, the adjustment of the brightness of the indicators.

The firmware implements my main need - constant adjustment that affects the course of the clock without the use of precision quartz resonators. The alarm function was a nice bonus.

Practical implementation

Having appreciated all the advantages of this scheme, I decided to repeat it.
The assembled device was supposed to represent two boards with transitional contacts: a control board, on which 90% of all elements are located, and an indication board with IN-14 gas-discharge indicators installed on it.

The disadvantage of such an implementation is in dimensions, but on the other hand, there is also universality. You can separate the indication board for any other gas discharge indicators without touching the control board.

Starting and setting the clock

I collected all the elements, etched the boards and carried out the installation. It's time to check and configure the power supply. First, I started the PSU at idle. The 78L05 stabilizer worked as expected.
The inverter set to a voltage close to the lower limit of the indicators ignition - about 170-175 V using a 2kΩ trimmer.

I put the chips in the sockets and then the unexpected happened. For an unknown reason, the 78L05 chip broke through, the microcircuits burned out from a power surge.
As a result of the tests, I found out that I came across defective K155ID1 decoders. Checking the resistance between the power pins shows a value of about 10 ohms. This could cause the failure of the 78L05 stabilizer.

I installed a new serviceable decoder, went to the radio store for a new PIC16F628A chip, programmed it with .


This time, the start-up under load went without incident. The indicator lamps lit up.



The watch has 3 control buttons: correction, alarm and increment.
I will quote the words of the author of the firmware:

Implemented 2 display modes: hours-minutes and minutes-seconds. Switching with the "Increment" button.
- When you press the "Correction" button, the watch switches to the seconds correction mode (seconds are reset by the "Increment" button). The next press of the “Correction” button puts the clock into the minutes correction mode (minutes are increased by the “Increment” button). One more press of the "Correction" button - transition to the clock correction (the clock is increased by the "Increment" button). The next press of the “Correction” button returns to the hours-minutes display mode.
- When you press the Alarm button, the watch enters the alarm setting display mode. In this mode, use the "Increment" button to turn on the alarm. Switching on is confirmed by a short beep and a flashing dot turns on. The alarm setting is corrected after pressing the "Correction" button. After the first press - minutes, after the second - hours (increase with the "Increment" button). After the third press - the transition to normal mode.
- The watch has a correction function by adjusting the constant (the adjustment mode is activated when the "Correction" button is held for more than 1 second). The default constant is 1032 microseconds per second. When the clock lags, we increase the constant (the “Increment” button) by the amount of lag calculated in microseconds per 1 second. If the clock is in a hurry, we decrease the constant (the “Alarm Clock” button) according to the same principle.
- Return to the normal mode is carried out from the correction modes 3 minutes after the last pressing of any of the buttons.
- When the alarm goes off, an audible signal sounds, which is turned off by pressing any of the buttons or automatically after about 4 minutes.

For clarity, I offer you a short video. The video shows the time correction modes: reset seconds, set minutes, set hours.


I hold the button for more than 1 second and enter the constant adjustment mode. As you can see, my current constant is 1292 microseconds. Quite far from the initial value of 1032 microseconds.
It took me four days to correct the clock. Initially, the clock was behind by 2 minutes per day. It took 2 days to make rough adjustments and 2 days to fine-tune. Ultimately, I did not notice a lag or rush of the clock for a second during the week. Stroke correction completed.

After about 3 weeks, the battery 2032 was discharged and the watch stopped remembering the settings and the current time when the power went out. I note that the set constant does not get lost. I decided to get out of the situation simply - I introduced a more bulky battery - two AA batteries.

Unusual design case

Electronics is ready! Ahead - the highlight of the program - the body.

I worked very hard on the hull. From the very beginning, I did not want to make a typical Nixieclock watch with 4 lamps sticking out of the case. I wanted something more. To place decorative elements near the lamps, I chose the Gainta G0477 case with dimensions of 187 × 118x37 mm.

What have I not tried! Even mirrors and glass spheres, but I didn't like anything in the end. For a while, I abandoned the project and started working on the Pokémon amplifier, while thinking about all kinds of options for decorating the case of a tube watch. One day, on the way to work, my eyes rested on a destroyed column on one of the advertising posters. Imagination presented the idea of ​​ancient Greek columns and baths.
And then it dawned on me - there should be columns near the lamps on the clock! Still not fully presenting the implementation methods, I began to develop this idea. Two columns come out a bit dry, it is better to take something similar, such as Chinese or Japanese gates that stand at the entrances to temples.

When I returned home, I immediately sketched a sketch in Photoshop.


I really liked this option, but it was still a bit dry and there was a lot of free space on the case. I started thinking in the direction of Asian styles. What would you like to add?

I must tell you that even before the all-consuming passion for radio electronics, I was engaged in translations of Japanese fantasy manga (similar to comics). Therefore, dragons naturally came to mind. Namely, the Japanese river dragon. After working a little in Photoshop, I added a sketch.


The final sketch just blew me away. Urgently, drink! But the practice remained vague. Started running options. The first thing that came to mind was the deep etching of aluminum blanks with ferric chloride using a technology similar to LUT, which I successfully applied in my past projects.


The option is suitable, but the scope of the upcoming work was much larger, and it is problematic to process metal to the smallest detail.

It remains to use foil textolite. Working with one-sided foil textolite is many times easier than with aluminum.
Optimized the image for the possibility of image etching by LUT. With some shortcomings, I etched the "fee".

The most difficult thing remains - to cut out images from a single piece of textolite. A terribly long and tedious process that cannot be fulfilled without a creative impulse and a great desire. Rough saw cuts of pieces of textolite were carried out with a manual jigsaw, after which with small tweezers he bit off all available contours near the pattern with sharp wire cutters, up to gaps of 1.5-2 mm from the edge, so as not to damage the pattern itself in any case.

The internal parts were drilled with drills of various diameters, followed by precise removal. Then finishing with needle files. In the bins I had two sets of needle files of various shapes and sizes. For a long time and stubbornly he deduced each bend of the pattern, selecting and combining the desired size and shape of the needle files.

It took me about 2 weeks of concentrated work in my spare time to make the Dragon from a piece of textolite. He managed to torment his wife's musical ear with his "shirking".

After finishing the work, the fingertips on my right hand became rough, as if I had been playing the guitar in rehearsals for two hours a day for a week.


The dragon is finally cut. The next step is painting. Having fantasized one evening, I decided that I would paint it red. This is where the final name of the watch "Red Dragon" came from.

Went experimenting with paint. I immediately bought two cans of aerosol paint in the colors "Chinese Cherry" (acrylic) and "Raspberry" (alkyd). The names are not responsible for the accuracy of the shades and are conditional. None of the presented options satisfied me in the end. "Chinese cherry" turned out to be too dark, and alkyd "Raspberry" dried for a very long time, which is fraught with dust sticking during home painting. Just 3-4 large dust particles on a glossy mirror can kill all job satisfaction.

I ended up going shopping looking for a red matte paint. To my surprise, it turned out that such a paint does not exist in nature. That is, you can’t buy it in spray cans, for this you need to buy separately the main color paint, a matting additive and go to a specialized center to prepare the mixture. For my purposes, this is way too expensive.

The decision came unexpectedly. I saw metallic colors on the shelves. These paints are a transitional link between a glossy and matte surface, that is, they do not have a glossy mirror, and in the case of an acrylic base, they dry very quickly. Color chose under the name "Kalina".

Raspberries, viburnum, cherries - compote can be cooked.

I tested the paint on a sampler. Grabbed after 5 minutes, and not a single speck of dust had time to stick. Great, you can paint.

To paint such cases, I use a tricky "paint box" - I cut plastic bottle with a volume of 5 liters lengthwise into two halves, I paint the part and cover it with one half. This method does not allow dust to settle on the surface, and the hole from the neck allows air to circulate.

Almost everything is ready. It remains to paint the inner contours of the dragon and the gate. The case is complex and requires skill. I took a thin brush and began to fill my hand on special stencils. My stencils are 3 words etched in aluminum. I circle them, look at the result, erase the paint with a solvent and start all over again, until the hand is stuffed to even strokes without departures beyond the boundaries of the engraving.
I sat for about an hour and realized that with rough pads on my fingers, I do not feel the pressure of the brush.

The solution turned out to be simple, but not obvious at first glance - a permanent marker for boards like Edding404.

With it, you can make even strokes with a thickness of 0.5 mm. I tried it on a stencil and realized that it turns out almost perfectly. There are no flights outside the borders, the only difficulty is in choosing the length of the stroke, in which the tip of the marker is not drained to the end. Yes, yes, this marker draws perfectly on smooth textolite, but quickly stops writing when touching matte (well absorbent) surfaces. The reason is that the supply of paint in a thin tip quickly dries up. In this case, you just need to wait 5-10 minutes before the tip is saturated with paint again.

I trained and started painting the dragon and the gate. Less than half an hour later, the marker stopped writing completely. No attempts to paint it worked. The marker is out of paint.

Answer

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five http://jquery2dotnet.com/ centuries , but also the leap into electronic typesetting, remaining essentially unchanged.

The device is designed to measure temperature over the entire range of the DS18B20 sensor (from -55 to +125 degrees), with an accuracy of 0.1 degrees. The accuracy of 0.1 is very conditional, because the accuracy of the DS18B20 sensor itself declared by the manufacturer is 0.5 degrees. Nevertheless, people very often approached me with a proposal to make a thermometer with an indication of up to 0.1 degrees, which I did.

The thermometer measures the temperature and displays it on a 4-digit LED indicator. Different temperature ranges are displayed differently:
-55.0...-10.0 - in -XX.X format without degree symbol
-9.9...0.1 - in -X.X format and degree symbol
0.0...9.9 - X.X format and degree symbol
10.0...99.9 - XX.X and degree symbol
100.0...125.0 - XXX.X without degree symbol


In addition, the thermometer has the function of dimming the brightness of the indicators. The brightness is selected with the S button. While the button is pressed - the brightness is high, if it is not pressed - the brightness is low. Instead of a button, you can connect a light sensor so that the brightness changes automatically depending on the time of day (more precisely, the illumination).

The thermometer is assembled on 2 printed circuit boards. Indicator board and controller board. The boards are soldered together at an angle of 90 degrees, according to the pads. When mounting the 7805 chip, it needs to cut off the heat sink flange. The indicator can be anything, red or green. It is important that it be under dynamic indication with a common anode.

The thermometer will only work correctly with the DS18B20 sensor, DS1820, DS18S20 sensors, etc. not suitable for this thermometer! To power the device, any stabilized or non-stabilized power supply that produces a constant voltage of 7 ... 12 volts is suitable. For example, you can use unnecessary Charger for mobile phone. If a output voltage power supply does not exceed 8 volts, then instead of the 7805 stabilizer, 78L05 can also be used, but if it gets very hot, you will have to increase the resistance in the indicator cathodes to 220 ohms.

Clock on PIC16F628A and temperature sensor DS18B20.

4-segment LED indicator.

Animated display change.

A variant of a simple clock on the popular and affordable PIC16F628A microcontroller. In fact, the project on AVR began with them.

Description of the clock.


1. Functions.

– hours, time display format 24-hour, hours:minutes.

– digital accuracy correction. Daily correction ±25 sec. is possible. The set value of 1 hour 0 minutes 30 seconds will be added/subtracted from the current time.

- thermometer.

- indication. Alternate.

- Customizable animation of changing readings.

– use of the non-volatile memory of the microcontroller to save the settings when the power is turned off.

– if you press the button in the main modePLUS , then the time is displayed on the indicators, if you click onMINUS - temperature. When the buttons are released, automatic change of readings resumes.

2. Setting.

2.1. When the power is turned on, the clock is in the main mode.

2.2. Push buttonSET enters the settings mode and selects the parameter to be set. In turn, available for installation:

- minutes;

- watch;

– seconds (reset to zero when you press the buttonsPLUS orMINUS );

– amount of correction. In the most significant digit, the symbol "With ";

– time of indication of the current time. In high-order digits, the symbols "tc ". Setting range 0÷99 sec. If set to 0, the time will not be displayed;

– temperature indication time. In high-order digits, the symbols "tt ". Setting range 0÷99 sec. If set to 0, the temperature will not be displayed;

– selection of animation effect. In high-order digits, the symbols "EF ". If set to 0, the change of information will be carried out without effects, if automatic mode is selected (symbolBUT ), the effects will change in sequence. If the mode is selectedr , then the effects will change randomly.

– selection of animation speed. In the most significant digit, the symbol "P ". The setting range is 0÷99. One unit corresponds to about 2 ms, the higher the value, the slower the animation.

2.3. The parameter to be set flashes.

2.4. Holding buttonsPLUS / MINUS the parameter is quickly set.

3. Notes.

It is necessary to measure the speed of animation and the time of displaying information. If a slow animation and a short display time are selected, then it may turn out that the information does not have time to fully update before the next shift.

When the main power is turned off (+12V) the indication turns off, the clock continues to run. The MC is powered from a backup source.

In the firmware archive for indicators with a common cathode and anode, a project in Proteus and a description.

Questions, wishes in the forum.

11.03.2015

Added updated firmware for common cathode indicator. AT new firmware more animation effects and small changes in the algorithm. Detailed description in the archive.


This is an ordinary digital thermometer, there are a lot of similar devices on the Internet. The basis of the microcontroller PIC16F628A and digital temperature sensor DS18S20 (DS18B20). LED 3-digit indicators of green color are used as indicators. The indication is dynamic. The thermometer operates over the entire temperature range of the DS18S20 sensor, i.e. from -55 to +125 degrees.

The thermometer is assembled on a printed circuit board, along with an indicator. Sensor and power are connected separately. If the sensor is not connected, the letter E (Error) is displayed on the indicator. This device has no features. Diode VD1 serves to protect against polarity reversal of the power supply.

The device can work both with the DS18B20 sensor and with the DS1820(DS18S20) sensor. Each sensor uses its own microcontroller firmware. Below is a variant of this thermometer with the printed circuit board diode bridge and stabilizer 7805, i.e. to power this device, it is enough to connect the secondary winding of the transformer to the power connector. In addition, this board has an LED that flashes briefly when the microcontroller polls the temperature sensor. The LED is connected between the RB3 pin (pin 9) and ground, naturally with a resistor. The absence of an LED on the board will not affect the operation of the thermometer in any way.

The device is conveniently placed in any plastic box of suitable size. I placed it in the case network block power supply (Adapter) together with a transformer. Those. only the connector for the DS18B20 sensor comes out of the box, and the case itself is inserted into the 220V network.



File:
The size:
Content:

sm_termo.rar
38.3 KB
Drawings of boards (LAY) and microcontroller firmware.