A portable oscilloscope based on the ESP32 microcontroller, enhanced with additional features for improved usability and functionality.
- Introduction
- Features
- Hardware Requirements
- Circuit Diagram and Connections
- Simulation
- Setup and Installation
- Usage
- CAD and designs
- Modifications and Enhancements
- Acknowledgements
- License
This project is a portable oscilloscope built using the ESP32 microcontroller. It is a modification of the original Esp32_oscilloscope by BojanJurca. The oscilloscope interfaces with a web browser via Wi-Fi, providing a convenient and accessible way to visualize analog signals.
- Wi-Fi Connectivity: Access the oscilloscope interface through any web browser without the need for additional software.
- OLED Display with QR Code: An onboard OLED display shows a QR code for easy access to the oscilloscope web interface.
- Probe Control via 3-Way Switches: Special 3-way switches have been added to control probe usage, allowing for quick and precise adjustments.
- Updated Web Interface: The HTML interface has been updated for better user experience and functionality.
- Portable Design: Compact and portable, suitable for fieldwork and on-the-go diagnostics.
- ESP32 Development Board
- OLED Display Module (128x64 pixels recommended)
- Analog Probes
- 3-Way Switches for probe control
- Battery Pack (optional, for portable power)
- Additional Components:
- Breadboard or custom PCB
- Connecting wires and jumpers
- Enclosure (optional, for portability and protection)
A schematic of the circuit connections is essential for assembling the oscilloscope. The circuit diagram can be found below:
(If you're viewing this document on GitHub, you can find the circuit diagram image in the images folder. If the image is not available, refer to the connection details provided.)
| OLED Pin | ESP32 Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SDA | GPIO 21 |
| SCL | GPIO 22 |
Assuming two probes, each with a 3-way switch:
-
Probe 1 Switch:
- Connect the common pin (C) to GND.
- Connect one side (Position 1) to GPIO 2 on the ESP32.
- Connect the other side (Position 2) to *GPIO 32 on the ESP32.
-
Probe 2 Switch:
- Connect the common pin (C) to GND.
- Connect one side (Position 1) to GPIO 4 on the ESP32.
- Connect the other side (Position 2) to *GPIO 35 on the ESP32.
These switches allow you to change the probe settings without using the web interface.
- Power Supply:
- The ESP32 can be powered via the USB port or an external battery pack connected to the VIN pin (ensure the voltage is appropriate).
To help you understand and test the oscilloscope without physical hardware, a simulation is available on Wokwi, an online electronics simulator.
Portable Oscilloscope Simulation on Wokwi
- Access the Simulation: Click the link above to open the simulation in your web browser.
- Interact with Components: You can click on the components to see their properties and adjust parameters.
- Run the Simulation: Press the "Start Simulation" button to run the code and see the oscilloscope in action.
- View the Serial Monitor: Use the serial monitor within Wokwi to view debug messages or outputs.
- Test Code Changes: Modify the code and instantly see the effects without hardware.
- Visualize Connections: Helps in understanding how components are connected.
- Learning Tool: Great for educational purposes to learn about microcontrollers and electronics.
Follow these instructions to set up and install the Portable Oscilloscope on your ESP32.
Copy all files from this package to the Esp32_oscilloscope directory on your computer.
- Open
Esp32_oscilloscope.inowith the Arduino IDE.
-
Find and open the
Esp32_servers_config.hfile. -
Locate the following lines:
#define STA_SSID "YOUR-STA-SSID" #define STA_PASSWORD "YOUR-STA-PASSWORD"
-
Replace
"YOUR-STA-SSID"with your Wi-Fi network's SSID. -
Replace
"YOUR-STA-PASSWORD"with your Wi-Fi network's password.
The oscilloscope uses the LittleFS file system, so you need to select an appropriate partition scheme.
- In the Arduino IDE, go to Tools > Partition Scheme.
- Select one of the SPIFFS partition schemes (e.g., "Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)").
Some ESP32 boards do not have a flash disk. If your board lacks flash storage:
-
Open
Esp32_servers_config.h. -
Comment out the line:
#define FILE_SYSTEM FILE_SYSTEM_LITTLEFS
-
This will make the oscilloscope use program memory (progmem) instead of the file system to store the
oscilloscope.htmlfile.
- Compile the sketch by clicking the Verify button in the Arduino IDE.
- Upload the sketch to your ESP32 by clicking the Upload button.
- When you run the sketch on your ESP32 for the first time, it will format the flash disk with the LittleFS file system.
- Warning: This will erase all data previously stored in the ESP32's flash memory.
To serve the web interface and icons, upload the required files to the ESP32:
oscilloscope.htmlandroid-192-osc.pngapple-180-osc.png
-
Connect to ESP32 via FTP:
- You can use the command-line FTP utility or a GUI FTP client like FileZilla.
- No username or password is required.
-
FTP Command-Line Example:
ftp YOUR-ESP32-IP
Replace
YOUR-ESP32-IPwith the IP address of your ESP32 (e.g.,192.168.1.100). -
Upload Files to
/var/www/htmlDirectory:ftp> put android-192-osc.png /var/www/html/android-192-osc.png ftp> put apple-180-osc.png /var/www/html/apple-180-osc.png ftp> put oscilloscope.html /var/www/html/oscilloscope.html
Example Session:
C:\esp32_oscilloscope>ftp YOUR-ESP32-IP Connected to 192.168.1.100. 220-ESP32 FTP server - everyone is allowed to login User (192.168.1.100:(none)): 331 enter password Password: 230 logged on, use "/" to refer to your home directory "/" ftp> put android-192-osc.png /var/www/html/android-192-osc.png 226 /var/www/html/android-192-osc.png transfer complete ftp> put apple-180-osc.png /var/www/html/apple-180-osc.png 226 /var/www/html/apple-180-osc.png transfer complete ftp> put oscilloscope.html /var/www/html/oscilloscope.html 226 /var/www/html/oscilloscope.html transfer complete ftp> bye -
Using Windows Explorer (Optional):
- Open Windows Explorer.
- Enter
ftp://YOUR-ESP32-IPin the address bar. - Copy the files into the
/var/www/htmldirectory.
- Open a web browser on your computer or smartphone.
- Navigate to
http://YOUR-ESP32-IP/oscilloscope.html. - Replace
YOUR-ESP32-IPwith the actual IP address of your ESP32. - The oscilloscope interface should load, and you can start using it.
-
Power On the Device:
- Connect the ESP32 to a power source (USB cable connected to a computer or a battery pack).
-
Connect to Wi-Fi:
- The ESP32 will initialize and connect to your specified Wi-Fi network.
- The OLED display will show a QR code and the IP address.
-
Access the Web Interface:
- Scan the QR code with your smartphone, or enter the IP address into a web browser.
- The oscilloscope interface will load, displaying real-time waveform data.
-
Using the Oscilloscope:
- Connect Probes:
- Attach the probes to the signals you wish to analyze.
- Adjust Probe Settings:
- Use the 3-way switches to select probe modes (e.g., attenuation, coupling).
- Interact with Web Interface:
- Adjust time base, trigger settings, voltage scale, and other parameters through the web interface.
- Start/Stop Acquisition:
- Use on-screen controls to start or stop signal acquisition.
- Connect Probes:
-
Diagnostics and Troubleshooting:
- No Waveform Displayed:
- Check probe connections and ensure they are properly attached to the signal source.
- Verify that the switches are in the correct positions.
- Network Issues:
- Ensure that the ESP32 is connected to the correct Wi-Fi network.
- Check the OLED display for the IP address and ensure your device is on the same network.
- No Waveform Displayed:
This project includes several key modifications from the original:
-
Updated HTML File:
- The web interface has been improved for better usability.
- New features and controls have been added to enhance functionality.
-
OLED Display with QR Codes:
- An OLED display has been integrated to show the device status.
- Displays a QR code for quick access to the oscilloscope interface.
- Provides visual feedback without the need for additional devices.
-
Special 3-Way Switches for Probe Control:
- Physical 3-way switches have been added to control the probes.
- Allows for immediate and precise adjustments without navigating the web interface.
- Enhances the user experience during hands-on diagnostics.
- BojanJurca: Original creator of the Esp32_oscilloscope.
- Wokwi Community: For providing the simulation platform and resources.
- Open Source Community: For libraries and tools that have made this project possible.
The project includes cad and stl files to be used as a casing for the deivce
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to contribute to this project by submitting issues or pull requests. Your feedback and improvements are greatly appreciated!
If you have any questions or need assistance with setting up or modifying the oscilloscope, please don't hesitate to reach out via the project's issue tracker on GitHub.
Note: Always exercise caution when working with electronic components and circuits. Ensure that all power sources are appropriate for your project to prevent damage to components or injury.
Happy tinkering!
If you encounter issues during setup or usage, consider the following tips:
-
Compilation Errors:
- Ensure all required libraries are installed and up to date.
- Double-check that the correct board and partition scheme are selected.
-
FTP Connection Problems:
- Verify that the ESP32 is connected to the Wi-Fi network.
- Make sure you are using the correct IP address.
- Check firewall settings that might block FTP connections.
-
Files Not Serving Correctly:
- Ensure that the files are uploaded to the correct directory (
/var/www/html). - Confirm that the filenames are correct and match those referenced in the code.
- Ensure that the files are uploaded to the correct directory (
-
OLED Display Not Working:
- Check the wiring connections between the OLED display and the ESP32.
- Ensure that the I2C address in the code matches your OLED display's address.
By following these instructions, you should have a fully functional portable oscilloscope based on the ESP32 microcontroller. This project not only provides practical functionality but also offers an opportunity to learn and experiment with microcontrollers, networking, and web technologies.