STM32L051 Capacitance Meter and Ohmmeter
03-2025This project uses STM32L051 microcontroller, programmed in C, to determine the capacitance of any capacitor between 1 nF and 1 uF. This is done using a 555 timer in the astable configuration, which will have it's output frequency affected by the capacitor chosen. The period of the timer's output can be measured through a GPIO pin and one of the microcontroller's internal timers, from which we calculate the approximate capacitance.
The device also determines the resistance of a resistor using a simple voltage divider. Using the internal ADC, it reads the voltage between two resistors (one predetermined one connected to a known Vcc, and the other unknown resistor connected to ground) and uses this value to calculate the unknown resistor.
The capacitance and resistance values are displayed on both an LCD screen as well as the serial port simultaneously.