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.
Mikhail Belkin
muzi
numero_trey
NNNI