We implemented a simplified version of the 555 Timer to measure capacitance on an EFM8LB81 (8051 family) microcontroller, followed by an improved version on the STM32 (ARM Cortex M0 family) microcontroller. We also built a resistance meter in parallel to the main circuit.
We have attached here the circuit of interest for V1 of this meter using the EFM8 microcontroller.
The firmware was developed in the C programming language. We are using a Makefile
to compile main.c
and flash the program onto the respective microcontroller.
We are using the 555 Timer circuit in its astable mode to generate a square wave. We measure the number of clock cycles for an entire wavelength and use this to calculate the period of the generated signal.
We use the formula with the designed
We are using a voltage divider comprised of a known
V1 was built using the EFM8LB81 microcontroller, whereas V2 of this meter was built using the STM32 microcontroller. In this improved version, we have the ability to switch between capacitances with hardware pushbuttons.
The firmware source code was adapted for the ARM Cortex M0 family. The timers, ADC, LCD initialization and functions were modified for this in main.c
.
We developed a Python application with a Tkinter user interface to display the incoming data stream of the 555 Timer frequency (Note that
This app also has an embedded calculator with the actual capacitance and resistances used in the Capacitance Meter. We used this to display the expected values and validate it with the incoming data. Test data was saved to .csv
files in the Logbook
directory.
We have uploaded our Final Demo on Youtube and have embedded a low resolution compressed version below.
Capacitance_Resistance_Meter_Demo.mp4
This was completed as part of the ELEC 291 - Design Studio project course in the The University of British Columbia Electrical and Computer Engineering undergraduate program. We received tremendous support and guidance from Dr. Jesus Calvino-Fraga.
We have read and understood the plagiarism policies at https://ece.ubc.ca/graduate/policies-and-procedures/student-responsibilitiesdeclaration/ and we understand that no excuse for plagiarism will be accepted.