Skip to main content

ESP32 - Complex Waveform Generator V3

Installing and Using the ESP32 Complex Waveform Generator V3 Application

Screenshot of web interface

image-1683400232715.pngimage-1683400232715.png

Prerequisites

To use this application, you need to have the Arduino IDE installed on your computer. You can download the Arduino IDE from the official website: https://www.arduino.cc/en/software

  1. ESP32 Development Board: You'll need an ESP32 development board, such as the popular ESP32-DevKitC or ESP32-WROOM-32D. These boards typically come with Wi-Fi and Bluetooth capabilities and a variety of GPIO pins for interfacing with peripherals.

  2. Rotary Encoders: To adjust the waveform parameters, you will need a total of 7 rotary encoders. You can use KY-040 rotary encoder modules or any other type of incremental rotary encoder with built-in push buttons. Ensure that the rotary encoders you choose have a CLK, DT, and SW (push button) pinout.

  3. Breadboard and Jumper Wires: A breadboard and jumper wires are required to make the necessary connections between the ESP32 development board and the rotary encoders.

  4. Power Supply: You will need a power supply to power the ESP32 development board. This can be a USB power supply, a battery, or any other suitable power source that meets the board's voltage and current requirements.
  5. Oscilloscope (optional): To visualize the generated waveform, you can use an oscilloscope. Connect the output pins (channel1OutputPin and channel2OutputPin) from the ESP32 development board to the oscilloscope's input channels.

Installing required libraries

  1. ArduinoJson: To install the ArduinoJson library, follow these steps: a. Open the Arduino IDE. b. Click on Tools in the menu bar, then Manage Libraries. c. In the Library Manager window, search for "ArduinoJson" in the search bar. d. Find "ArduinoJson by Benoit Blanchon" in the search results and click on the Install button.

  2. ESP32Encoder: To install the ESP32Encoder library, follow these steps: a. Open the Arduino IDE. b. Click on Tools in the menu bar, then Manage Libraries. c. In the Library Manager window, search for "ESP32Encoder" in the search bar. d. Find "ESP32Encoder by Gil Mora" in the search results and click on the Install button.

Uploading the Application

  1. Download the source code for the ESP32 Complex Waveform Generator V3 application or copy it to a new file in the Arduino IDE.
  2. Connect the ESP32 development board to your computer using a USB cable.
  3. In the Arduino IDE, select the appropriate board and port under Tools > Board and Tools > Port.
  4. Click on the Upload button (right-facing arrow icon) in the Arduino IDE to compile and upload the application to the ESP32 development board.

Hardware Setup

  1. Wire the rotary encoders and other components according to the pin assignments defined in the source code.
  2. Make sure the connections are secure and verify the CLK/DT pins for each encoder are wired correctly.

Using the Application

  1. Power on the ESP32 development board.
  2. Use the rotary encoders to adjust the following parameters:
    • Pulse count
    • Pulse width
    • Pulse spacing
    • Off-time
    • Width modifier
    • Spacing modifier
    • Off-time modifier
  3. The application will generate a complex waveform based on the adjusted parameters.
  4. Connect the output pins (channel1OutputPin and channel2OutputPin) to an oscilloscope to visualize the generated waveform.
  5. Fine-tune the parameters using the rotary encoders to achieve the desired waveform shape and characteristics.

Troubleshooting

  1. If the waveform does not match the expected output, verify the wiring connections and ensure the rotary encoders are functioning correctly.
  2. If the application does not upload to the ESP32 development board, double-check the board and port selection in the Arduino IDE.
  3. If the rotary encoders behave unexpectedly (e.g., adjusting one parameter affects another), check the CLK/DT pin assignments and wiring.

For further assistance or to report any issues, contact the application's support team or refer to the community forums.