ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING Onboard tachometer on the PIC16C84 microcontroller. Encyclopedia of radio electronics and electrical engineering Encyclopedia of radio electronics and electrical engineering / Microcontrollers The magazine "Radio" describes a lot of instruments for measuring the speed of the crankshaft of an internal combustion engine - both analog and digital. The digital tachometer with a quasi-analogue scale, presented to your attention, is noticeably simpler than other similar ones according to the circuit and at the same time has better accuracy characteristics. The author managed to achieve such high results using the modern PIC16C84 microcontroller. The tachometer is built in such a way that it is equally convenient to use it both while driving and when adjusting the engine in the garage. When operating a car that does not have a built-in tachometer, electronic tachometers are used to control the engine speed. Made according to various schemes, they show the measured rotational speed either in digital form or in the form of an LED scale [1]. Scale instruments are more convenient, but less accurate due to the finite number of scale elements. Based on the circuit processing of pulse sequences, such devices are very sensitive to the temporal parameters of the pulses, which manifests itself in the instability of readings when the temperature changes and the scale flashes. This limits the field of application of electronic scale tachometers, in essence, only to indicate the speed of rotation, since it does not allow recording readings with the accuracy necessary, for example, for adjusting a carburetor or engine diagnostics. The use of software processing of pulses from the speed sensor allows you to combine the convenience of the scale and high accuracy of readings, turns the engine shaft speed indicator into a real measuring device. For this purpose, programmable peripheral microcontrollers from Microchip Technology Inc. are most suitable. (USA) with high speed and port capacity. The tachometer described below uses the PIC16C84 microcontroller, with which readers are already familiar from the publication [2]. Its feature is the presence of a programmable memory device with electrical program and information erasure (EEPROM) with a capacity of 1K (14 bits and 64 bytes, respectively. This made it possible to do without external memory and significantly simplify the device. The tachometer is easy to manufacture, reliable in operation and does not require adjustment . On fig. 1 shows the appearance of an electronic tachometer. It is equipped with two LED scales and can operate in two modes: indication and measurement. In display mode, the entire speed range from 0 to 6000 min-1 divided into 12 parts - divisions forming an overview scale with a resolution of 500 min-1. In the measurement mode, the device operates in the range from 300 to 3000 min.-1 and the overview scale has a resolution of 250 min-1. Together with the overview scale, an extended scale of 0...200 min works in this mode.-1. It is formed by four LEDs and therefore has a resolution of 50 min.-1. The reading of the frequency value n is formed by adding two components: n = 250N0 + 50Np, where N0 and Np - the number of luminous elements of the survey and stretched scales, respectively. The measurement error is equal to the division value of the extended scale, i.e. 50 min-1, which is quite sufficient for solving practical problems. The principle of operation of the tachometer is based on the direct measurement of the pulse repetition period taken from the breaker contacts, followed by the calculation of the engine shaft speed and displaying the result on a discrete scale. In this case, the measurement of time intervals is realized by counting calibrated time intervals - discretes, generated by software from clock pulses. The averaging interval is 10 periods. On fig. 2 shows the circuit diagram of the tachometer. It consists of a central processor, an input shaper, an indication unit and a power supply. The central processor is made on the microcontroller DD1. It has two ports: A with five and B with eight pins, which can be programmatically configured to both input and output information. Inputs RA0-RA3, RB2-RB5 are configured to output information, RB0 and RB1 are configured to input, and RA4, RB6 and RB7 are not used. The central processor is clocked by the built-in clock generator, the frequency of which is set by the quartz resonator ZQ1. The processor is reset when the power is turned on by the R2C1 circuit at the MCL input. Resistor R3 serves to limit the current of this input, and diode VD1 - to quickly discharge the capacitor C1 when the power is turned off. The input shaper is assembled on the DD2.1 element and the DD3.1 trigger according to the scheme from [3] and is supplemented with a preamplifier on the VT1 transistor. The base circuit of this transistor includes elements that increase the noise immunity of the input driver [4]. From the output of the shaper, the pulses are fed to the input of the element DD2.2, which performs the functions of a buffer, and to the input of the D-trigger DD3.2, included by a frequency divider by two. At the output of this trigger, a pulse sequence of the "meander" type is formed with a repetition rate that is half the input. The buffer element DD2.2 is designed to connect other automotive electronics devices (for example, an ignition unit) to it. The output of this element also serves to control the operation of the input shaper. The pulse repetition rate at the output of the DD2.2 element is equal to the sparking frequency. Element DD2.2 and trigger DD3.2 are optional, they only add additional flexibility to the technical solution of the device. The generated pulse sequence is fed to the RB0 input of the DD1 processor, which processes it according to the built-in program using interrupts. The required type of measurement is selected by the toggle switch SA1, which changes the input mode RB1 of the processor. The display unit consists of two LED scales HL1-HL4 and HL5-HL17 and a decoder DD4, DD5. The survey scale is formed by LEDs HL6-HL17, which are connected to the outputs of the decoder, assembled on the code converters DD4 and DD5 [5]. At the input of the decoder from port A of the DD1 processor, a signal is received that carries a binary code for the speed value, which leads to the activation of the corresponding number of scale LEDs. The HL5 LED indicates the device is on, since its glow corresponds to the zero code at the decoder input. The second scale - stretched - is formed by LEDs HL1-HL4, which are connected to the outputs RB2-RB5 of the processor through current-limiting resistors R5-R8. The device is powered from the twelve-volt on-board network of the car. Through the SA2 power switch and the R15C7 input filter, the DC voltage is supplied to the DA1 stabilizer, from the output of which a voltage of 5 V is supplied to all components of the device. The processing program is entered into the memory of the processor using the programmer; it takes about 400 bytes (see table). The details of the tachometer, with the exception of LEDs, toggle switches and the DA1 stabilizer, are mounted on a printed circuit board, the drawing of which is shown in fig. 3. Chip stabilizer DA1 is installed on a heat sink with a cooling surface of 25 cm2. The stabilizer used by the author has a fully insulated plastic case. In the case of using a domestic stabilizer KR142EN5A (or KR142EN5V), it is better to install it on the heat sink through an insulating gasket. The tachometer display, which is the front panel of the device, is assembled on LEDs of the KIPM11 series. Two toggle switches SA1 and SA2 are also mounted here - any miniature ones are suitable. The frequency of the ZQ1 quartz resonator determines the settings in the program so that the value of the time increment, taking into account the prescaler of the processor, lies within 20...160 µs. A larger frequency value leads to an overflow of the processor counter, a smaller value reduces the resolution of the device. In practice, it is possible to use resonators for frequencies up to 4 MHz, preferably in a metal case with wire leads (for example, RK-374). The resonator is attached to the board with a wire clamp, the ends of which are soldered into two holes A. Two groups of contacts on the board, indicated by the numbers 1-4, must be respectively connected with a bundle of four conductors. The PIC16C84-04/P controller can be replaced by the PIC16C84-10/P and use a quartz resonator with a frequency of up to 10 MHz. It is also possible to use the more affordable PIC16F84 microcontroller, which differs from the PIC16C84 in the type of program memory (flash memory). It should be noted that the operating temperature range of this microcircuit is from 0 to +70°C. If it is necessary to use a tachometer and at sub-zero temperatures, it is better to use a controller with the letter I in the designation (corresponding to a temperature range of -40 ... + 85 ° С). Transistor VT1 can be any low-power silicon npn structure with a static current transfer ratio of at least 100. Literature
Publication: cxem.net See other articles Section Microcontrollers. Read and write useful comments on this article. Latest news of science and technology, new electronics: Machine for thinning flowers in gardens
02.05.2024 Advanced Infrared Microscope
02.05.2024 Air trap for insects
01.05.2024
Other interesting news: ▪ Caterpillar saliva against plastic ▪ Toshiba TC358870XBG - 4K HDMI/MIPI Dual-DSI Converter News feed of science and technology, new electronics
Interesting materials of the Free Technical Library: ▪ site section Welding equipment. Article selection ▪ article On a par with the century. Popular expression ▪ article The leaves of which plant can withstand a weight of up to 30 kg? Detailed answer ▪ article Shipbuilder-repairman. Standard instruction on labor protection
Leave your comment on this article: All languages of this page Home page | Library | Articles | Website map | Site Reviews www.diagram.com.ua |