ESP32 Counter

The ESP32 counts the number of pulses during a fixed time frame. The device is controlled via USB over a GUI that runs on a PC. The ESP32 program is developt with an Arduino IDE. The GUI is written in python and uses PyQT5.

The ESP32 program is based on the ESP Frequency Meter by  Rui Viano and Gustavo Murta or en. Thanks to PyShine for the installer instruction and the tutorials.

The frequency meter developt by Rui Viana Gustavo Murta has a lot of interesting features. It has a high accuracy from 1 Hz to 40 MHz and includes an oscillator to test the device. My goal was to include a level converter for the 5V pulses and to develop a grafical user interface to control and store the measurement. The ESP32 counter is serial connected with a rate of 115000 baud via USB. The GUI controls:

  • selecting | open | close the port
  • start and stop the measurement  | clearing the display
  • setting the frequency of the oscillator
  • setting the timebase for the counter
  • self-check

the build-in functions of pyqtgraph have a lot of options.

First Usage

After installation the software on the PC and connecting the ESP32 via USB. You can run the first test:

  • Connect input and output of the divice with a BNC cable.
  • Select the COM port and open it.
  • Select the timebase or 100ms is default.
  • Hit start.
  • Check Testlauf [on] and the oscillator will increment the output frequency.
  • To adjust the display hit [clear Display].
  • After a while hit [stop].
  • With pressing the right mousebutton over the display you can select from a lot of options thar are included.

Parts

  • ESP32-S WiFi Bluetooth Development Board 0,96 OLED Display WROOM 32 NodeMCU
  • Pegelwandler 4 Kanal I2C Level Converter 5V-3.3V
  • BNC Connector | Board  | IC socket
  • STL – Files are available from github

Schema

Case

Software for the ESP32

The picture on the right side is a screenshot with the actual conditions for compiling the code.

The software is available from github

Software for the PC

In order to compile the source here is the output of pip freeze:
         Package                   Version
   ------------------------- ---------
   altgraph                  0.17.2
   future                    0.18.2
   numpy                     1.24.3
   opencv-python             4.6.0.66
   pefile                    2022.5.30
   pip                       22.2.1
   pyinstaller               5.9.0
   pyinstaller-hooks-contrib 2022.8
   PyQt5                     5.15.7
   PyQt5-Qt5                 5.15.2
   PyQt5-sip                 12.11.0
   pyqtgraph                 0.13.1
   PyQtWebEngine             5.15.6
   PyQtWebEngine-Qt5         5.15.2
   pyserial                  3.5
   pywin32-ctypes            0.2.0
   setuptools                63.2.0
   wheel                     0.37.1
   

The software is developt and compiled using Visual Studio.

The software is available from github

Please compile: conter.py
 
 

License

Nach oben scrollen