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

The personal computer detects the closing of the switch from a distance. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Note to the student

Comments on the article Comments on the article

Often systems that control personal computers need to detect the closing of remote switches or contacts at various points in time. Such short circuits can be detected by an IBM or compatible personal computer in two simple ways, each based on the application of a circuit and a BASIC program. In both cases, the serial port of a personal computer is used and no additional devices are required for the computer or changes in its circuitry.

In the first method, the program is executed continuously. Each time the line 130 command is executed, an attempt is made to send a print command to the communication port. The remote switch controls the "Reset to send" line of the port (Figure 1).

PC detects circuit breaker closing from a distance
Rice. 1 (click to enlarge)

When the switch is open, the print command sent to the port is accepted for execution during the operation of the main program. When the switch is closed, when a print command is issued, the required "Reset to send" signal is not accepted, which causes a device connection timeout error.

Processing program:

100' Circuit breaker closed detection
105 ' Setting corn1: port. Setting the pulse duration "Reset transmission
"1 ms
110 OPEN "com1:9600,n.8,1,rs,cs1,cd,ds" AS #1,
115 ON ERROR GOTO 150 ' Set error trap 120 '
125' Main program
130 PRINT #1 ' An attempt was made to issue a print command to the communication port.
135 PRINT "Main program"
140 GOTO 125 ' reverse run in main program
145 '
150 ' Cycle with key closed
155 PRINT "Switch closed"
160 RESUME NEXT End of subroutine active with circuit breaker closed
With the switch open, the BASIC program uses
received signal "Reset to send". When the switch is closed
the BASIC program detects an error in the port operation when receiving
data in serial code and directs the execution of the program
to line 150.

The error handler (introduced on line 115) directs program execution to the subroutine beginning line 150, which is processed with the switch closed. This subroutine ends with the Resume next statement, transferring the program execution to line 135 to the execution of the main program. This loop will run every time the Print # 1 statement occurs in the program. When the switch is opened, command line 130 will be executed again, and the cycle associated with the closing mode will remain unclaimed.

Schematic and program improvements ensure accurate counting of circuit breaker closings. This uses a 555-series CMOS timer connected to the handshake line, generating a valid ASCII RS-232 character. Each time the switch closes, the circuit generates a 300-µs pulse (equivalent to one start bit and two data bits). The extra character generated is not essential to program execution.

The link buffer used by the BASIC program accumulates each character generated by the timer so that the number of key closures can be accurately counted. Each time line 225 is encountered during program execution, the buffer state is monitored. If any characters were received by him, they are read and counted by the subroutine beginning with line 245. The only condition is that line 225 must be executed often enough so that the buffer does not overflow. By default, the buffer size is set to 128 characters, but can be changed if necessary with the Open statement on line 210.

Fastidious users can transmit information during the duration of the one-shot pulse and control the reception of a special ASCII character. The duration of this pulse can range from the duration of one start bit (104 µs at 9600 baud) to the duration of the start bit plus eight data bits (937 µs). It is possible to use 9-level (rather than 9-bit) code. The duration of the pulse generated by the timer can be changed by selecting the resistor R3 and capacitor C3 or by changing the voltage at pin 5 of the timer. Although the program has proved its worth when working with BASIC and Quick Basic, sufficient opportunities for controlling the communication port provided by the described techniques can be obtained using other languages.

Literature

  1. Vgise S. Trump. PC detects remote switch closures, ED, 1990, No. 13. pp. 73, 74

Author: Bruce Trump; Publication: N. Bolshakov, rf.atnn.ru

See other articles Section Note to the student.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

A New Way to Control and Manipulate Optical Signals 05.05.2024

The modern world of science and technology is developing rapidly, and every day new methods and technologies appear that open up new prospects for us in various fields. One such innovation is the development by German scientists of a new way to control optical signals, which could lead to significant progress in the field of photonics. Recent research has allowed German scientists to create a tunable waveplate inside a fused silica waveguide. This method, based on the use of a liquid crystal layer, allows one to effectively change the polarization of light passing through a waveguide. This technological breakthrough opens up new prospects for the development of compact and efficient photonic devices capable of processing large volumes of data. The electro-optical control of polarization provided by the new method could provide the basis for a new class of integrated photonic devices. This opens up great opportunities for ... >>

Primium Seneca keyboard 05.05.2024

Keyboards are an integral part of our daily computer work. However, one of the main problems that users face is noise, especially in the case of premium models. But with the new Seneca keyboard from Norbauer & Co, that may change. Seneca is not just a keyboard, it is the result of five years of development work to create the ideal device. Every aspect of this keyboard, from acoustic properties to mechanical characteristics, has been carefully considered and balanced. One of the key features of Seneca is its silent stabilizers, which solve the noise problem common to many keyboards. In addition, the keyboard supports various key widths, making it convenient for any user. Although Seneca is not yet available for purchase, it is scheduled for release in late summer. Norbauer & Co's Seneca represents new standards in keyboard design. Her ... >>

The world's tallest astronomical observatory opened 04.05.2024

Exploring space and its mysteries is a task that attracts the attention of astronomers from all over the world. In the fresh air of the high mountains, far from city light pollution, the stars and planets reveal their secrets with greater clarity. A new page is opening in the history of astronomy with the opening of the world's highest astronomical observatory - the Atacama Observatory of the University of Tokyo. The Atacama Observatory, located at an altitude of 5640 meters above sea level, opens up new opportunities for astronomers in the study of space. This site has become the highest location for a ground-based telescope, providing researchers with a unique tool for studying infrared waves in the Universe. Although the high altitude location provides clearer skies and less interference from the atmosphere, building an observatory on a high mountain poses enormous difficulties and challenges. However, despite the difficulties, the new observatory opens up broad research prospects for astronomers. ... >>

Random news from the Archive

Transparent OLED TV Mi TV Lux Transparent Edition 12.08.2020

Xiaomi has announced Mi TV LUX OLED Transparent Edition, the world's first fully transparent TV, which will be mass-produced for the consumer market.

Mi TV LUX OLED Transparent Edition uses a 55-inch 5,7mm thick transparent OLED panel that supports 120Hz refresh rate, 10-bit data representation provides coverage of 93% of the DCI-P3 color space. The matrix response time is 1 ms. Support for MEMC technology (system for dynamic adaptation of picture quality on the screen) is also announced.

The entire element base is placed in a non-removable round base, which also acts as a stand. The hardware base is a custom-made MediaTek 9650 SoC with AI Master Smart Engine, which offers more than 20 optimization algorithms and a special adaptive mode for 5 main use cases. Hidden in the compute unit is an audio system that supports Dolby Atmos surround sound technology and AI Master for Audio, which detects the type of content being played and automatically applies the appropriate sound settings.

Transparent TV Xiaomi Mi TV LUX OLED Transparent Edition will go on sale in China from August 16 at a suggested price of about $7200.

Other interesting news:

▪ DC-DC Converters MAX1553/4

▪ Transplanting a beak to a vulture

▪ Smartphone Smartisan T2

▪ Recreated volcanic lightning

▪ test tube steaks

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ site section Digital technology. Article selection

▪ article Dr. Jekyll and Mr. Hyde. Popular expression

▪ article When did the first attempt to launch a jet aircraft with a person on board take place? Detailed answer

▪ article Snowberry racemosus. Legends, cultivation, methods of application

▪ article 432 MHz antenna with circular polarization. Encyclopedia of radio electronics and electrical engineering

▪ article Jump card. 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