DIY electronic car tachometer. Do-it-yourself tachometer - making and using in practice. Making your own tachometer

Some car enthusiasts get so used to the tachometer that when replacing a car that does not have a tachometer, they feel very uncomfortable. Tachometer helps to properly adjust the engine, reduce gasoline consumption, increase the overall engine life and learn to drive a car correctly. There are ready-made tachometers available for purchase, but the price is usually quite high. There are complex and simple car tachometer diagrams, according to which you can make a tachometer yourself. I suggest simple tachometer diagrams.

The first version of a simple tachometer.

To measure the number of revolutions, chopper pulses or voltage from a spark plug are used, since their frequency is linearly related to the speed of the car engine shaft. It is also possible to provide inductive coupling with this circuit, which is done in the device, the circuit of which is shown in the figure.


basis schematics for this tachometer is a one-shot device (DA1), which is triggered by pulses from the operating ignition system of the car, induced in coil L1. Input terminal X1 can be used to adjust the tachometer or to supply a signal from the breaker, as shown in the dotted line. For a four-cylinder 4-stroke engine with 3000 rpm, the interruption frequency will be 100 Hz, and for 1500 rpm - 50 Hz, which allows you to simply calibrate the device according to the mains frequency.

Pulses from output 3 of the DA1 microcircuit are sent to a dial indicator - milliammeter RA1, which integrates them and shows the current voltage in the circuit. Since the duration of all pulses at the output of the monovibrator is the same, the voltage that the device will show will be proportional to the frequency of spark formation. The PA1 scale can be calibrated in shaft speed (revolutions per minute). As a sensor (coil L1), you can use a magnetic head from a tape recorder, located close to the high-voltage coil, or you will need to wind it on the wire running from the ignition coil to the distributor (reinforced with insulating tape). To protect the input of the microcircuit from high-voltage surges, it is better to use a TVS diode with a limiting voltage of 12 V as VD2. You can also use a tape signal level indicator or any similar device as an indicator.

The following is a diagram of a simple car tachometer.
To make a tachometer, you will again need a large recording level indicator from a tape recorder (M476Z). Please note this scheme very simple, it’s like a rectifier-integrator of pulses that come from the car’s ignition system breaker. Please note that the highest mark on the scale is 6000 rpm.


The pulse voltage supplied to capacitor C1 through decoupling resistor R1 eliminates voltage surges on the falling and rising edges. After which there is a parametric stabilizer on R2 VD1, it limits the amplitude of these pulses. The differentiating circuit includes capacitor C2. This circuit is a converter AC voltage, having a rectangular shape in short pulses. As a result, the parameters of these pulses do not affect the amplitude and duration of the input pulses, therefore, when the rotation speed changes, only their frequency changes. Capacitor C2 is charged by the rectifier bridge and discharged by resistors R1 and R2. Some of the discharge and charging currents of capacitor C2 flow through measuring device, resulting in a deflection of the arrow. Thanks to the inertia of the mechanism, the work is performed continuously.
This tachometer can be placed in any convenient place on the car dashboard. We advise you to use a backlit indicator, or install a small light bulb in its body, which will have a very positive effect on the perception of readings in the dark.
To set up the device you will need another car tachometer. With its help you can calibrate the manufactured homemade car tachometer. If you do not have another tachometer, you can use a rectangular pulse generator with a variable frequency within the range of 25 - 200 Hz, and an amplitude of 15 - 20 V.

Another one simple circuit car tachometer. The device is designed to measure the crankshaft speed of carburetor engines with an electrical equipment system that has a minus battery connected to the body.


The basis of the circuit is a single pulse shaper assembled on a CD4007 microcircuit (domestic analogue - K176LP1). The shaper is triggered by positive pulses that occur when the breaker contacts open. The PA1 indicator, connected to the output of the driver through a limiting resistor R5, measures the voltage on the measuring capacitor C1, which is proportional to the frequency of the input pulses with an accuracy of no worse than 1...2% - The pulse repetition frequency is 30 times less than the crankshaft speed of a four-stroke engine.

And finally, one more simple tachometer diagram for a motorcycle or moped. The tachometer is designed to work with a single-cylinder two-stroke internal combustion engine with a contact or contactless ignition system and allows you to measure the crankshaft speed up to 10,000 rpm.

Operating principle of the device. In the initial state, transistor VT1 is closed and VT2 is open. At this time, the left (according to the diagram) plate of capacitor C 5 is connected through a small resistance of the open transistor VT2 to the +5 V bus. At this time, no current flows through the microammeter PA1. At the first negative half-cycle of alternating voltage applied to the tachometer input, transistor VT1 opens and VT2 closes. At this time, C5 is quickly charged through the microammeter PA1, VD3 and R5.
With a positive half-cycle of the input voltage, VT1 closes and VT2 opens. Now C5 is discharged through the low resistance of open VT2 and VD4. At the next negative half-cycle, the process is repeated in a similar way.
Trimmer resistor R6 sets the upper limit of the frequency of the measured signal. The value of capacitor C5 is selected depending on the type of engine. The higher the engine speed, the smaller the capacitance of capacitor C5 should be. Properly assembled tachometer diagram does not require adjustment. You just need to use trimming resistor R6 to set the maximum tachometer readings by opening the engine throttle all the way.

Tachometer connection diagram to electrical equipment of a motorcycle or moped.


If used contact ignition, the input of a homemade tachometer is connected to point A. For contactless ignition, we connect to point B.

What is it anyway tachometer? A tachometer is a device used to measure the RPM (revolutions per minute) of any rotating body. Tachometers are made on the basis of contact or non-contact ones. Non-contact optical tachometers typically use a laser or infrared beam to monitor the rotation of any body. This is done by calculating the time taken for one rotation. In this material, taken from an English site, we will show you how to make a portable digital optical tachometer using Arduino Uno. Let's consider an extended version of the device with an LCD display and a modified code.

Tachometer circuit on a microcontroller

Schematic parts list

  • Microcircuit - Arduino
  • Resistors - 33k, 270 ohm, 10k potentiometer
  • LED element - blue
  • IR LED and Photodiode
  • 16 x 2 LCD screen
  • 74HC595 shift register

Here, instead of a slot sensor, an optical one is used - reflection of the beam. This way they don't have to worry about the thickness of the rotor, the number of blades won't change the reading, and it can read the drum revolutions - which the slot sensor cannot.

So first of all you will need an IR emitting LED and a photodiode for the sensor. How to assemble it - shown in step by step instructions. Click on the photo to enlarge the size.

  • 1. First you need to sand the LED and photodiode to make them flat.
  • 2. Then fold the strip of paper sheet as shown in the picture. Make two such structures so that the LED and photodiode fit tightly into it. Connect them together with glue and paint them black.
  • 3. Insert LED and photodiode.
  • 4. Glue them together with superglue and solder the wires.

Resistor values ​​may vary depending on which photodiode you are using. The potentiometer helps to reduce or increase the sensitivity of the sensor. Solder the sensor wires as shown in the figure.

The tachometer circuit uses a 74HC595 8-bit shift register with LCD display 16x2. Make a small hole in the housing to fix the LED indicator.

Solder a 270 ohm resistor onto the LED and insert it into pin 12 of the Arduino. The sensor is inserted into a cubic tube to give additional mechanical strength.

That's it, the device is ready for calibration and programming. You can download the program from this link.

Video of a homemade tachometer working


Interesting simple design LED cube 3x3x3 on LEDs and microcircuits.

A tachometer is a device designed to measure engine speed while driving and display this information to the driver. The received data is shown to the motorist on the dashboard or, if the device was installed additionally, on the corresponding screen in the cabin. This material will allow you to learn how to build a tachometer at home with your own hands.

[Hide]

Homemade microcontroller device

To make a homemade tachometer on a microcontroller for your car to measure engine speed, you will need the following spare parts:

  • the microboard itself, in this case the Arduino circuit will be used;
  • resistors;
  • to make an LED tachometer, you will need an LED element;
  • infrared and photo diodes;
  • display, in our case it is LCD;
  • shift register 74HC595.

In this case, an optical regulator will be used instead of a slot regulator. Thanks to this, you do not have to worry about the thickness of the rotor; the number of blades will not change the readings. In addition, the optical controller allows you to read the drum revolutions, unlike a slotted one.

To begin the task, prepare all the elements and you can begin:

  1. First of all, you need to sand the LED and photodiode with (fine-grained) sandpaper - you want them to be flat in the end.
  2. After this, you need to put a strip of paper - you need to make two similar elements so that the diodes can be tightly installed in them. Both parts ultimately need to be connected with glue, and then painted black.
  3. After this, the diodes themselves are installed, which are subsequently glued together with glue, then the wires are soldered to them.
  4. It should be noted that the nominal values ​​of the resistors may differ, it all depends on how the photodiode will be used. The potentiometer allows you to reduce or increase the sensitivity of the controller as a whole. The wires from the controller must be soldered as in the photo.
  5. From the circuit for making a car tachometer using LEDs, you can understand that it uses an eight-bit shift register. The tachometer circuit also includes an LCD screen. A small hole should be built in the housing to fix the diode light bulb.
  6. Next, you need to solder a 270 Ohm resistor to the diode element, and then install it in pin 12. The controller itself is inserted into a cubic tube - this will provide the device with additional strength.

A simple device based on a microcalculator

There is another option for making an electronic one for a gasoline or electric motor; in this case, a microcalculator will be used as the basis. This option will be especially relevant for those who have problems with the element base. It should be noted that ultimately the device will not be able to provide 100% accurate readings, and such a device will not show the number of revolutions per minute on the screen. However, the microcalculator itself is an excellent device for counting signals.

Inductive controllers and others can be used as a signal regulator. When the disk rotates, one signal should be shown on the display per revolution. In this case, the controller contacts must be open, and at the moment when the unit passes the disk tooth, these contacts must close. In general, it is optimal to use such a do-it-yourself tachometer in cases where measurements will not be taken frequently. If you want to install regular speed monitoring in your car, then, of course, it is better to use more reliable devices (the author of the video is Alexander Novoselov).

In our case, the contacts simply need to be soldered in parallel to the addition key of the calculator.

When you need to measure the rotation speed, the measurement is done according to the following scheme:

  1. First, you need to turn on the calculator itself.
  2. After this, press the “+” and “1” buttons simultaneously.
  3. After this, the device starts up and the measurement itself is performed on it. To do this, you first need to turn on the stopwatch at the same time as the calculator.
  4. Count until thirty seconds have passed, and then pay attention to the display - it should show the corresponding value.
  5. The resulting value is the number of revolutions the crankshaft made in half a minute. If you double this figure, you get the number of revolutions per minute.

Analog and digital tachometers

An analog tachometer for a diesel or gasoline engine is designed to convert an electronic pulse and output it to an indication device. As for digital devices, they convert an analog pulse into a certain sequence of ones and zeros, which, in turn, are recognized by controllers (video author - Alexander Jung).

Analog options consist of the following components:

  • microboard designed to convert an analog pulse;
  • wires that connect all structural components;
  • a scale where the indicators will be shown and an arrow that shows the desired value;
  • for normal operation of the arrow, a special reel with an axis installed on it is required;
  • any reading element, for example, it could be an inductive controller.

As for digital devices, their purpose is the same, but the design of a digital gadget is based on other components:

  • eight-bit converter;
  • directly the processor itself, which converts the pulse into a sequence of ones and zeros;
  • a screen on which the readings will be shown;
  • speed controller - a chopper device is used with amplifiers, but special shunts can also be used for this purpose, in this case everything depends specifically on the design;
  • an additional microboard that will reset the readings;
  • it will be possible to connect a temperature controller for antifreeze, cabin air, engine fluid pressure, etc. to the processor;
  • For normal operation of the device you will need a special program.

The main task of a tachometer in a car is to help select the correct gear, which has a positive effect on the life of the engine. Most cars already have an analog tachometer and when the needle approaches the red mark, you need to shift into a higher gear.

In addition, car owners use it for adjustment work, both at idle and to control the engine speed while driving.

The physical principle of operation of the tachometer is based on counting the number of pulses that are recorded by the sensors, the order of their arrival, as well as the pauses between these pulses.

In this case, the number of pulses can be counted various methods: forward, reverse and both directions. The results obtained are usually transformed into the quantities we need. This value can be considered hours, minutes, seconds, meters, and the like.

The design of all tachometers allows the obtained values ​​to be reset. The accuracy of these measurement results is quite conditional, about 500 rpm; the most accurate electronic tachometers measure with an error of up to 100 rpm.

Car tachometers come in two types: digital and analog. A digital car tachometer consists of the following blocks:

CPU
ADC 8 bits or more
Liquid temperature sensor;
Electronic display
Optocoupler for idle air valve diagnostics
Processor reset block.

The display of a digital automobile tachometer displays the results of measurements of shaft and engine revolutions. The digital tachometer is very useful during adjustment operations with electronic units ignition of a car engine, with precise setting of economizer thresholds, etc.

Analog car tachometers are more common and understandable to a larger number of car enthusiasts. It shows the measurement results using a moving arrow.

Usually analog tachometer consists of:

chip
magnetic coil
wires for reading information from the crankshaft
graduated scale
arrow

This tachometer works as follows. The signal from the crankshaft is transmitted through wires to a microcircuit, which determines the position of the arrow on a graduated dial.

It is best to have both types of tachometer in your car. So the digital one does an excellent job of adjusting the idle speed, checking the operation of the EPHH control unit (forced idle economizer) and checking the standard tachometer (since the digital tachometer has much higher accuracy). When driving a car, it is much more convenient to use a standard analog tachometer, because the human eye and brain analyzes analog information better and faster than its digital value, and better accuracy while driving vehicle not required at all.

In addition, tachometers are also classified according to the installation method. There are standard and remote car tachometers. The first is mounted directly into the car's dashboard. “He” is simpler and is used in most cars. The remote tachometer is designed for installation on the dashboard. They are used to give the car a more tuning appearance. The design of the remote tachometer has a leg for securing it to the dashboard.

Below is a diagram of a quasi-analog electronic tachometer. The principle of its operation is as follows. Engine speed is displayed on a simplified linear LED scale. The digital tachometer scale consists of nine LEDs. Each of these roughly corresponds to 600 rpm of the engine. At idle, only the first LED lights up. The tachometer is adjusted by selecting resistance R6. Depending on it, you can set the indicators to the required number of cylinders. You can also change the division price.

The source of pulses for the correct operation of the digital tachometer can be a Hall sensor, which is present in electronic system ignition, shaft position sensor and others. The main thing is that the sensor sends pulses to our circuit that change the resistance of resistor R1.

This circuit works as a simple frequency meter. Pulses that constantly come from the engine sensor are sent to the counting input of the K561IE8 decimal counter, and then to the LEDs. The circuit can be powered from a cigarette lighter or.

Diode VD1 KD522 protects the circuit from incorrect connection power polarity. The crankshaft speed sensor sends pulses to the base of transistor VT1. We select resistance R1 depending on the sensor (in the diagram, the resistance is selected for the Hall sensor in the contactless ignition system of a carburetor engine). From the output of VT1, the pulses go to the Schmitt trigger, made on elements D1.1-D1.2. It converts the pulses into the required rectangular shape. Capacitor C2 filters interference, paired with resistor R4 it forms a filter that cuts off pulses high frequency. From Output D1.2, pulses are sent to the counter.

A multivibrator assembled on microcircuit elements D1.3 and D1.4 generates clock pulses with a frequency depending on R6. These pulses go to the C3-R7 chain, which forms a pulse to reset counter D2. Ultra-bright LEDs HL1-HL9 are connected directly to the outputs of the K561IE8 counter. Using R9 you can adjust the brightness of the display.

LEDs 1-4 on printed circuit board connected with an installation wire.

Setting up the design begins with calculating the value of resistor R1 in accordance with the range of incoming pulses. Then we replace R6 with series-connected variable resistors of 1 Ohm and constant resistors of 10 kOhm. Next, we tighten the variable resistor to maximum resistance. Then we turn it so that only two LEDs light up when the engine is idling. We mark this position of the tuning resistor. Then we reduce the resistance so that only one LED lights up. Then we adjust the resistor to the middle position. Next, we measure the resulting resistance R8 with a multimeter.

A week ago, one person approached me with a rather non-standard task - it was necessary to ensure the operation of the ancient TX-193 (VAZ 2106) tachometer with a modern VAZ21126 (Priora) engine, which has an ignition system with individual coils for each cylinder, which means simply connecting the TX-193 to the ignition coil will no longer work. In addition, the customer wanted to improve the performance of the device, leaving it untouched appearance and design. In general, the matter ended with the fact that I undertook to gut the electronic filling of the device and develop my own, with blackjack and whores. The tachometer will now receive information about the crankshaft speed from the January 7.2 ECU, for which the latter has a special output.

Under the cut there are photos, videos, diagrams, sources and a lot of text telling about logarithms and how to correctly scale data and get rid of commas.

Hard
Let's start with the TX-193 device. The mechanical part of the device is a milliammeter of a classical design, with a permanent magnet and a moving coil that moves the needle.

To develop the circuit, it was essentially enough to know about the milliammeter only that at a current of about 10 mA the needle deflects to the limit, and the winding resistance is approximately 180 Ohms. As the brain I chose the ATtiny2313A controller from the famous Atmel company, clocked from an external quartz resonator at 16 MHz. The device is powered from the vehicle’s on-board power supply, which means that according to GOST it must withstand a “beard” of up to 100V and operate stably in the range from 9-15V. Due to the low consumption (several tens of milliamps), it was decided to use a linear stabilizer 7805 with an inductive filter and suppressor to protect against impulse noise. The device was assembled from what was at hand, so the finished product uses a powerful version of the 7805, although the 78L05 at 100mA would have been sufficient.
The controller controls the milliammeter, naturally, using PWM. Why was a 16-bit timer used in Phase and Frequency Correct PWM mode?
Information about the crankshaft speed is transmitted from the ECU in the form of pulses from 0 - 12V. Active level is low. 2 pulses per 1 revolution of the crankshaft. To capture these pulses, an external interrupt INT0 and a corresponding chain of RC filter, pull-ups and protective diodes are used. In general, the circuit design of the device is quite typical and I was surprised to find that I had just written so much about it. But don’t judge strictly, it’s still the first article.


The assembled device without the dial now looks like this:

Software
In fact, even before drawing the diagram, I quickly assembled the whole thing on a breadboard, taking a controller in a DIP package and immediately began waving the arrow))
In general, the software turned out to be a little more interesting than the hard one.

Let's start with the general architecture:
Timer 0 ticks with a frequency of 250 kHz, which means the tick period = 4 µs; the overflow interrupt occurs with a frequency of 250 kHz / 256 = 0.976 kHz
which means the interruption occurs once every 1024 µs. It was possible to get confused and bring this matter closer to one millisecond by updating the timer counter in the interrupt, but there is no point in this task. Those. we can measure time with an accuracy of 4 μs, which is quite sufficient for the given accuracy of the device.
Timer 0 not only counts time, but also sets flags to run certain tasks at a certain frequency.
We have two tasks. Give the go-ahead to the INT0 interrupt to measure the pulse period at the input and change the position of the arrow.

Timer 1 ticks at a frequency of 16 MHz, but since... it is 16-bit and the Phase and Frequency Correct PWM mode is used - the final PWM frequency turns out to be very small and is something around 122Hz. This is because the timer ticks first up and then down. But we have true 16-bit PWM and can steer the needle very accurately! The datasheet contains all the details.
The mechanics, by the way, turned out to be of disgusting quality; it was impossible to move the needle smoothly due to increased friction in the mechanism, which had to be at least lubricated with transmission oil to begin with. But these are already details.
A table of correspondence between instrument readings and corresponding value timer register in PWM parrots.
In the source code, this matter is called GAUGE_TABLE and, out of habit, is placed in a separate file.

Further, it was discovered that if you simply change the current in the ammeter circuit in one fell swoop in order, for example, to move the needle 1000 forward, then it will make two, three, or four oscillations in the area of ​​the target mark, which was completely unacceptable and what the customer pointed out Special attention. The fact is that these tachometers initially have such a problem, and by accelerating several times in time with the vibrations, you can make the needle swing with a significant amplitude (more than half the scale!).
Something had to be done about this. My idea was to move the needle towards the mark in a series of smaller steps, gradually approaching the target. As a matter of fact, this part is the most interesting and useful for beginners, because... requires some skill. After all, when dealing with a microcontroller, calling log2() in a loop is, to put it mildly, not the best idea. In addition, 8-bit architecture imposes even more restrictions. Well, you should completely forget about the “floating point”. But all these difficulties, as always, lead only to a deeper understanding of the processes and calculations performed by the processor.

For some reason there is more and more text, but I simply cannot help but dwell on this point in more detail!
So, it is clear that we need a logarithmic progression. The current change step in the milliammeter circuit should decrease as it approaches the target mark. Resources are worth their weight in gold, which means only the tabular method. There are also as few points as possible.
Let's start by constructing a logarithmic table.
Everything is very simple: we launch Excel and with a few mouse strokes we get 50 base 2 logarithm values ​​for the sequence from 1 to 50. For clarity, we build a beautiful graph.

Wonderful! Exactly what is needed! But firstly, there are already 50 points, and secondly, all numbers are floating point. This doesn't suit us at all!
Therefore, we select 5 points from the existing array with a step of 10. We get something like this:

Already better. Consistent approach to the target is still maintained, but there are 10 times fewer points.
Next you need to normalize the resulting set. Those. make sure that all values ​​are in the range from 0 to 1. To do this, simply divide each element by 5.64385618977472 ( maximum value our array).


Thus, we obtain the same logarithmic dependence, but in a much more convenient form for further calculations. Such a table can already be used quite easily, if not for the dot after the zero. But we can figure this out pretty easily too.
Now I want us to take the nice value of 1024 as one and recalculate our table again. We get

As you can see, the shape of the graph has not changed, but the numbers now fit into the 16-bit range and there are no fractions.
In the source code, the resulting array is called logtable

The scaling factor (if you can call it that) 1024 did not appear here by chance and you need to understand very well why 1024.
Firstly, this is a power of two and it was chosen because the expensive operations of division and multiplication by a power of two can be replaced with a cheap left/right shift and it would be stupid not to use this opportunity.
Secondly, the coefficient must be selected based on the scale of the data to which it will be applied. In our case, these are the values ​​of the 16-bit timer register, which controls the filling of the PWM. It was experimentally revealed that unsatisfactory oscillations of the needle are detected even when it is sharply shifted by 200 rpm. Those. if you need to move the needle by more than ~200 rpm, smoothing will be required. From the GAUGE_TABLE table it can be seen that neighboring cells differ on average by 4000 PWM parrots, which corresponds to approximately 500 rpm on the device scale. It is not difficult to estimate that in numbers, a needle shift of 200 rpm will be 4000 / 2.5 = 1600 PWM parrots.
Therefore, the scaling factor must be chosen so that, firstly, it is as large as possible, because otherwise we lose digits and accuracy, and secondly, as small as possible, so as not to force us to move from 16-bit variables to 32-bit and not waste resources are wasted. As a result, we choose the smallest power of two, which is less than 1600 and provides sufficient accuracy. This will be 1024.
This point is very important. I myself still sometimes have difficulty choosing the right coefficients and variable sizes.

Well, then off we go. We find the implementation of display_rpm() in the code and see that to determine a specific value in PWM parrots, the GAUGE_TABLE table is used and the assumption is that the scale is linear between adjacent marks. To organize the change in current according to the logarithmic law, an array of 5 points pwm_cuve has been introduced, which contains a set of values ​​that must be sequentially subtracted or added (depending on the direction of movement of the arrow) from pwm_ocr1a_cur_val to make the arrow move smoothly and clearly.
each step is formed by multiplying the pwm_delta value by a coefficient from our logtable;
Before multiplication, the value is pre-scaled by dividing by 1024.
The final calculated destination of the arrow target_pwm is written to pwm_cuve as is, because due to rounding problems and due to the limitation of the dimension of variables to 16 bits, the exact value as a result of calculations will not be formed there very often, so it is necessary to provide a guarantee that the arrow will end its path at a given point.
In general, all of the above is essentially contained in one line
pwm_cuve[ table_i ] = pwm_ocr1a_cur_val + (pwm_delta / LOG_TABLE_MAX * logtable[ table_i ]);

Next, the main loop, based on the signal from the timer 0 times in PWM_UPD_PERIOD, scoops up values ​​from pwm_cuve and assigns them to the variable pwm_ocr1a_cur_val, the value of which in the interrupt will be assigned to the OCR1A register, which will immediately lead to a change in the PWM filling and a change in the current in the milliammeter circuit.

That, in fact, is almost all the tricks, with the exception of converting the period represented in timer ticks into the crankshaft rotation speed, which is measured in rpm.
All this has been reduced to engine_rpm = (uint16_t)(15000000UL / (uint32_t)rot_time);
We may or may not talk about how this figure came about next time, because the text was already quite large and obviously not many will even read to this point.

To be honest, there are several more “tricks” used in the code that may not seem entirely obvious to beginners. If anyone wants to understand in more detail, please feel free to comment and PM.

A little video, as promised
Do not pay attention to the accuracy of the readings; the arrow is not properly dressed + the dial is not screwed in.
The needle moves in increments of 1000 rpm in one step.

Smooth current change

The point is clear that in reality there will be no jumps of 1000 rpm and those minor needle movements that can still be observed on video will not become a problem. It’s just that if you eliminate them, you can greatly lose the performance of the device and its readings will lag behind reality.

P.S. Not to say that the archive contains absolutely shitty code, but yes, in some places it could have been made more beautiful. Yes, I know magic numbers are bad and yes, I could do better. On the other hand, it’s quite difficult to get lost in a 200-line source code, so here and there I allowed myself to be a little hacky.
I just wanted to register on the hub for a long time, and writing any detailed article as time passes after the implementation of the project becomes more and more difficult, so I decided that today they will “lead from the field.”
So this is real code from a real device, assembled in a real period of 7 evenings, which tomorrow will be installed on the glorious VAZ 2108 car with the 21126 engine and I hope it will please the owner for a long time, who agreed to pay as many as 100 evergreens for my work.
But you and I know that I came all this way not only and not so much for the sake of money. It’s so nice when you create something and it even works!

The archive contains an Atmel studio project and a schematic + board in Altium designer. The board was manufactured using the LUT method.
UPD: The archive was posted on a free file hosting service and therefore died suddenly. To store the archive on habrastorage, I embedded it in a photo of a tachometer without a dial (it’s at the top of the article). In general, you need to save the jpg and open it with Winrar. You can also simply change the extension to zip.
UPD2: The circuit and board have been redesigned, the pictures have been updated, the archive is still in the picture.
UPD3 The archive is no longer inserted into pictures. PM me here or find me