Close
0%
0%

Tachometer 6-in-one

Hall sensor, IR optocouple, ignition coil inducted tachometers. Also clock, voltmeter, DS thermometer.

Similar projects worth following
103 views
0 followers
I needed a simple turn counter to made a coil for hand made generator. It was an idea in theme of green power contest. By the mean, what does mean green energetics: are they energy faculty graduates on theme of solar batteries; or it is energy drinks with green colourant? Oh, i think it is just DIY. For this project I get almost minimal config. It is 16GPIO F030 with TM1637 for 7-segment LEDs. But when I connected to the first variant of board AH49 hall sensor, leftover free ports wouldn't let me calm down. That is why I added some another functions (list below). I like compact minimal designs without unuserful functions, but even less I like unused ports. * Clock on built in RTC (clocked by 8MHz system qrystal oscillator, F0 haven't got 32k OSC in). * Pins for DS18B20 thermometer. * Voltmeter 0-30V with LM321 op amp buffer * Yet another way to measure turns with TL331 comparator and IR LED/phototransistor pair * TLC555 timer in monostable mode to measure RPM of petrol tools

Hall sensor.

First of all it is li-ion powered (3.3V). And here is the problem follows from that. There is'nt any cheap and popular 3V hall sensors. All typical (A3144) are 4.5V minimal ones. Only AH49 can work on 3V, but it is with voltage output, not trigger switch. I just skipped it and connected 4,5V A3144 to 3.3V. Yep, it works below the guaranteed voltage, but this is not scientific. Also I have the functions for both variants (for voltage and trigger halls), both are connected to the same port. It's clear that both are showing 3000RPM of my drill.

Power supply.

Power system is trivial, LTC4054 charger + XC6026P332 3.3V linear stabilizer. Very compact (sot23-3 and SOT23-5 cases), low woltage dropout. 

Clock.

All of STM32 have built in RTC, but not every have input pins for clock crystal. In all of them with pin count less than 48 there isn't. But we still may clock it from system one. Also we need this system oscillator crystal for better turn count accuracy. With this kind of clocking, clocks may have less precision. Hence I will report, how many minutes it is gone next year. Software details: display updates 10 times a second, separator dots switches due to seconds divider value with half second period.

Voltmeter.

Just analogue ADC input. Also there are buffer on the SMD single channel sot-23 op amp (LM321); resistor divider and zener. To protect microcontroller input.

Thermometer sensor.

Just DS18B20. I have my own library for this omnipresent sensor. It is compact (300 lines) and uses timer for delays and 0/1 recognition. The sensor is on wires, connected to pins.

Optical tachometer.

Simply repeated scheme of arduino comparator-based IR obstacle sensor module. Differ with compact 1-channel sot23-5 TL331 comparator, and IR led, controlled by GPIO through the mosfet. Checked for my drill too.

Ignition coil tachometer.

Tachometer for Internal Combustion Engine. In russian blogs there is a typical schematic, uses NE555 timer in monostable mode. To filter out jitter and protect microcontroller input. The pulse duration is set to measure up to 14000 RPM (4ms). Also there are decoupler capacitor, diodes and RC filter, they are input protection, and low pass filter. Note, that in my schematic there is rare 3V SOP8 version of 555 timer, TLC555. 

I tried it with my string trimmer. All modes from idle speed 2800 RPM to the 8500 RPM of cutoff successfully measured.

Menu.

3 buttons, connected to the GPIOs, left-right and submenu/ok. Menu points are in simple switch case functions. Modes:

  • Hall turn counter, push OK, or re choose to reset the counter.
  • Hall tachometer. Just show RPM, using hall sensor.
  • Optical tachometer. Works on reflection of white tape on a shaft. Have a submenu for comparator reference voltage tuning.
  • Ignition tachometer. Clip the tester wire to the spark plug wire. May need the input resistor.
  • Voltmeter. Just lotage, up to 30 volts.
  • Thermometer. DS18B20 temperature in °C.
  • Clock. Push the middle button to set time.

Also all of the tachometers uses the same function and timer, while calling by several GPIOS. Just in case there is divider of RPM, which you can set in for every mode. For case of several pulses per full rotation. Settes through the middle button, saved to the flash, equal to 1 by default.

  • Sensors.

    Mikhail Belkin • 09/15/2026 at 13:11 • 0 comments

    As I mentioned, in my box there are trigger type A3144 and voltage type AH49E sensors.

    If program for the trigger variant is trivial. Just simply null counter on GPIO interrupt and measure period between them. The voltage sensor variant met the noises and it is hard to find the voltage level shift. My a bit complicated algorithm uses median filter to find the mean voltage level. And hand-picked coefficients for addition and division in cases when voltage is differs and equal to mean. At magnet the voltage is differs from mean, then we waiting until it will be established, then the update the turn count variable. The coefficients helped to regulate the time of picking and establishing voltage to make it algorithm adaptive to different distances to the magnet and prevent double count on the low speed. So, this algorithm do not need an hardware comparator and works with both sides of sensor, but only for low speed (up to 3000 RPM). Due to this problems (need to pick up coefficients manually and hail on the high speed). In the final variant trigger hall is used, but you can build the firmware for voltage fariant.

    Also I saw the video with drone optical tachometer, which uses photoresistor. So mainstream photoresistors are unsuitable. They are have slow switching characteristic is (5-10Hz). Unfortunately, I tried them first, before datasheet reading.

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates