Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Universal timer on the RIS controller. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Clocks, timers, relays, load switches

Comments on the article Comments on the article

The versatility of the device described in the article is that it can not only turn on and off four loads at a given time, but also turn an outdated AT machine into an ATX computer and at the same time perform the function of an "anti-freeze" tool.

When there is a need to switch several loads according to a given program, it is convenient to use an electronic watch with several alarm clocks equipped with electronic keys. However, if this requires control from a computer, then such a watch is no longer suitable. The proposed timer allows you to control four independent channels. For this, 16 events are provided, each of which can change the state of any channel (turn it on or off) at the appointed time, taking into account the day of the week. Channels can be controlled directly from the computer to which the device is connected, from which the current time is set and events are configured in the timer.

The device allows in a regular AT computer to implement advanced power management functions similar to ATX standard machines (programmatically turn off and on at the appointed time), as well as manage the power of peripheral devices (printer, scanner, external modem). To use the timer as an "anti-freeze" tool, you need a program that automatically regularly resets the time to turn off and then turn on after a few minutes. When the computer freezes, the timer, turning off the power for a while, will perform a "cold" reboot of the system.

The schematic diagram of the device is shown in fig. 1. Its basis is PIC-controller PIC16F84A-04 (DD2). The clock frequency (4 MHz) sets the quartz resonator ZQ2. On the element DD1.1, a pulse generator with a repetition rate of 32768 Hz is made for timing. The pulses of this generator are fed through the buffer element DD1.2 to the external input of the RTCC counter of the microcontroller. The required frequency and, consequently, the accuracy of the clock is set by the subscript capacitor C2.

Universal timer on the RIS controller

(click to enlarge)

Transistors 1VT1-4VT1 are loaded with relays 1K1-4K1, the contacts of which are included in the power supply circuits of loads connected to sockets XS1-XS4. LEDs 1HL1-4HL1 - load status indicators.

The computer controls the device via the RS-232 interface. Since the PIC16F84A microcontroller does not have a built-in serial interface, the latter is implemented in software. COM port signals are not used as standard. The transmitted data is synchronized via the DTR line, the computer transmits information via the RTS line, and receives it from the controller via the CTS line. The data is transmitted in duplex mode and is padded with control bytes to check the correctness of the information. The interface used is described in more detail in the author's article "Interface of a PIC controller with a PC" ("Radio", 2003, No. 7, pp. 20-22).

R4R7VD4 and R5R8VD5 circuits convert RS-232 levels to TTL levels for microcontroller inputs. The TTL level from the microcontroller output is enough to directly control the RS-232 line, which made it possible to simplify the matching circuit.

After power is applied, the DD2 microcontroller is set to its initial state, in which all channels are turned off, the clock is reset, and load control is blocked to prevent them from being turned on by mistake. When setting up the device, the computer transmits the current time, day of the week, and parameters for events. All information about the latter is stored in the non-volatile EEPROM memory of the microcontroller. Each event contains the number of the load that it manages, information about the action performed (turning on or off), the time of operation (including the day of the week) and can be in the "off" state (does not perform an action) and in the "daily" mode (occurs at the specified time, regardless of the day of the week).

After setting the time and setting the channels, the device can be used both independently (with the communication cable disconnected from the XS5 connector) and under computer control. Since the RS-232 interface allows you to connect and disconnect a cable while devices are turned on (hot plug), you can do this at any time.

For direct channel control, use the SB1-SB4 buttons. Holding any of them in the pressed position for more than 0,5 s leads to a change in the state of the corresponding channel.

The time delay is implemented in software and prevents loads from being switched by accidental clicks. Port B of the microcontroller is configured so that its input lines RB0-RB3 and RB5 are connected through internal resistors to the power rail.

The power supply of the timer is made according to the traditional scheme and has no special features. The use of a step-down transformer T1 is due to the need for galvanic isolation of the supply network and the computer. The GB1 battery is a backup power source for the clock in case of power outages.

Microcontroller "firmware" codes are given in Table. 1. When programming, you need to set the following bit values ​​in the configuration word: generator type (OSC) - HS, watchdog timer (WDT) - disabled, delay after power on (FWRTE) - enabled.

Universal timer on the RIS controller

(click to enlarge)

The connection of the computer with the timer is carried out through the dynamically loaded library timercom.dll.

Library and description of the programming interface (API) for working with it and creating your own shell for working with the device

The TIMER program is used to set events and manually control loads. Its main window (Fig. 2) has three tabs. The first of them ("Loads") displays the state of the loads, which can be changed by unchecking or checking the corresponding box, the second one ("Events") contains the conditions of the 16th event, the number of the load channel, the required action, the time and day of the week when it should happen. In the "Options" tab, you can select the COM port to which the device is connected and check the box that allows the program to receive data from the device immediately after launch. After changing the parameters of events or the state of loads, you must click the "Record" button to transfer the new information to the timer (in this case, the current time is automatically set). Pressing the "Read" button causes the current device data to be loaded.

Universal timer on the RIS controller

The device is assembled on a printed circuit board and placed in the "Pilot" line filter housing. Buttons, LEDs and socket XS1 are installed on its side wall.

Transformer T1 - any small-sized one with a secondary winding of 12 V. As 1K1-4K1, imported relays TRU-12VDC-SB-CL with an operating voltage of 12 V and 5 A contacts (winding resistance - 400 ... 500 Ohm) are used. Backup power supply GB1 - a battery of batteries or galvanic cells with a voltage of 3,6 ... 4,5 V. The current consumed from it does not exceed 8 mA.

You can connect the timer to the computer's COM port with both a modem and a null modem cable. The assignment of the connector pins for each case is given in Table. 2.

Universal timer on the RIS controller

Author: S.Kuleshov, Kurgan

See other articles Section Clocks, timers, relays, load switches.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Air trap for insects 01.05.2024

Agriculture is one of the key sectors of the economy, and pest control is an integral part of this process. A team of scientists from the Indian Council of Agricultural Research-Central Potato Research Institute (ICAR-CPRI), Shimla, has come up with an innovative solution to this problem - a wind-powered insect air trap. This device addresses the shortcomings of traditional pest control methods by providing real-time insect population data. The trap is powered entirely by wind energy, making it an environmentally friendly solution that requires no power. Its unique design allows monitoring of both harmful and beneficial insects, providing a complete overview of the population in any agricultural area. “By assessing target pests at the right time, we can take necessary measures to control both pests and diseases,” says Kapil ... >>

The threat of space debris to the Earth's magnetic field 01.05.2024

More and more often we hear about an increase in the amount of space debris surrounding our planet. However, it is not only active satellites and spacecraft that contribute to this problem, but also debris from old missions. The growing number of satellites launched by companies like SpaceX creates not only opportunities for the development of the Internet, but also serious threats to space security. Experts are now turning their attention to the potential implications for the Earth's magnetic field. Dr. Jonathan McDowell of the Harvard-Smithsonian Center for Astrophysics emphasizes that companies are rapidly deploying satellite constellations, and the number of satellites could grow to 100 in the next decade. The rapid development of these cosmic armadas of satellites can lead to contamination of the Earth's plasma environment with dangerous debris and a threat to the stability of the magnetosphere. Metal debris from used rockets can disrupt the ionosphere and magnetosphere. Both of these systems play a key role in protecting the atmosphere and maintaining ... >>

Solidification of bulk substances 30.04.2024

There are quite a few mysteries in the world of science, and one of them is the strange behavior of bulk materials. They may behave like a solid but suddenly turn into a flowing liquid. This phenomenon has attracted the attention of many researchers, and we may finally be getting closer to solving this mystery. Imagine sand in an hourglass. It usually flows freely, but in some cases its particles begin to get stuck, turning from a liquid to a solid. This transition has important implications for many areas, from drug production to construction. Researchers from the USA have attempted to describe this phenomenon and come closer to understanding it. In the study, the scientists conducted simulations in the laboratory using data from bags of polystyrene beads. They found that the vibrations within these sets had specific frequencies, meaning that only certain types of vibrations could travel through the material. Received ... >>

Random news from the Archive

FAST telescope 12.06.2020

The National Space Administration of China has initiated the final phase of testing of its new unique telescope called FAST, whose main goal and task is to search for and identify extraterrestrial life - and this is not so much about finding traces of such life that ever existed before, but about directly current, which may be present on other planets and galaxies.

The telescope itself is the largest telescope in its segment, because, having a length of 500 meters, it is equipped with a huge number of additional modules and sensors that eliminate the smallest errors in its operation.

That's what a team of assemblers and engineers from the Chinese Space Agency say about it, which points out that the FAST telescope is equipped with a special internal system that allows not only to efficiently cut through the thinnest and most distant radio signals in space, but also to distinguish external radio signals from internal ones, which are created by the technology of humanity itself on Earth. Of course, with such a promising description, only the highest results should be expected, at the same time, a number of experts in the field of modern space research have their own questions regarding the performance of the telescope in the long term.

The FAST telescope has been tested for several months and in December last 2019 it was even fully tested to help Chinese television, whose satellites are in Earth orbit. Chinese scientists note that the new version of the telescope is about 50% more powerful and more accurate than its original working concept.

China's FAST High Accuracy Telescope resembles in one way or another many of the third-party designs that can be found at both NASA and ESA - but the main feature of this telescope is that it targets really distant galaxies and outer exoplanets, which is a really significant advantage. before third-party projects of a similar type. It remains only to wait for further news regarding the end of the testing phase of the telescope.

Other interesting news:

▪ Gene therapy will build muscle without exercise

▪ Allergy to people

▪ Anker Soundcore Space Q45 and Space A40 Wireless Headphones

▪ ARMADA PXA8 1936-core LTE chip from Marvell

▪ Hydrofoil Electric Taxi Candela P-12

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Tools and mechanisms for agriculture. Article selection

▪ article Monday is a hard day. Popular expression

▪ article Which tradition was broken when decorating souvenirs for the wedding of Prince William and Kate Middleton? Detailed answer

▪ article by Mamei Sapota. Legends, cultivation, methods of application

▪ article Quartz oscillator. Encyclopedia of radio electronics and electrical engineering

▪ article Chairs. Focus Secret

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024