With this source code, an ESP32 module and a 3.3v power source, build a network WiFi oscilloscope (26Ksps*12bit Analog, 5.5Msps Digital) with network volt meter
Price:
Other projects from this group
This project is an ESP32 WiFi Oscilloscope and Volt Meter firmware with Chain Network feature. The “Chain Network” is a local network which the devices one by one are connected to the each other.
This project is based on the “ESP32 WebApp Builder” project which is a base source code with the chain network feature.
There are the following files in this project:
First open one of the files with Arduino program, then set the settings as the following image (Board and Flash Frequency)
Then put the ESP32 module on the “download mode” and upload the program.
After upload, run the program in “normal mode”.
Then in case you are using “DO IT ESP32 DEVKIT V1”, the blue LED on the board would be turned on and you’ll be able to see the module’s hot spot SSID via the WiFi networks in your PC or smart phone.
The default SSID is “WiCardOSC” and the default password is “12345678”. Connect and go to http://192.168.4.1 with a web browser.
The GPIO 33 pin of ESP32 module is the analog input as the default and the default digital input pin is GPIO 05.
The input range of analog signal for the ADC pin is between 0-3.3V.
With the suggested circuit, the input signal voltage can be vary between 0-12V:
The input of digital signal should be 0V (LOW) or 3.3V (HIGH). If your digital “High” voltage may be up to 5V, you can use the suggested circuit in the manual file as the voltage divider:
The WiFi oscilloscope project has a nice and responsive web application which is placed in the root page address (192.168.4.1 by default and can be set to 192.168.5.1 or you can use the router’s DHCP IP).
If you are going to use the network feature, you can select the target device for the oscilloscope.
The screen resolution is 12288x4096 pixels. By click on the screen you can download the Graph file in .png format and the zoomed result would be like this:
There are 4 toggle buttons under the scope screen:
And 8 push buttons under the scope screen:
This web application is also compatible with cell phone and mobile device browsers:
The Web Application is divided to 3 menus. The menus can be selected by click on the menu button.
“Oscilloscope” refers to the WiFi Oscilloscope page, “Volt-Meter” refers to the Network Volt Meter page and “Settings” refers to the settings page.
In the “Volt-Meter” page, there are 16 channel rows of the volt meters result. That means you can add up to 16 devices to the chain network and see the values.
In the above picture, only two devices (CH0 and CH1) are connected to the network.
The “Volt Meter’s Network Channel” can be set in the settings menu.
The web application’s settings menu has been divided to 5 parts:
For the programming, use the pre-defined functions in the files which start with “user”.
Add your start-up script to the “userInit()” function in user_init.ino file. No need to do wifi or server configuration. This configuration already have done in the firmware system files (e.g. systemInit() and setup()).
The “userLoop()” function (user_loop.ino) calls repeatedly (like arduino “loop()” function), If your program needs to execute a statement repeatedly (e.g. reading a sensor’s data), insert your script in this function.
The “webapp.h” file is the root page’s script. You can customize sWebApp variable in that file if you’re going to make changes in the Web UI.
Also you can customize the “userGetSettings()” function (user_settings.ino), for adding more settings to the firmware. The WebApp execute this function when you click on the Settings menu.
After you click on the SAVE button of the user-defined settings, the “userSetSettings()” functions will be called.
The “userMainInit()” in the “user_main.ino” file, calls once and only just in the network starter when you click on the “Oscilloscope”menu (or initially after loading the root page). You can initiate the uiAppData in this function.
The “userMain()” in the “user_main.ino” file, calls intervally or by clicking on the “Oscilloscope” menu elements. The WebApp will send the uiAppData to this function and then it can be transferred in the chain network.
The “userSubInit()” in the “user_sub.ino” file, calls once and only just in the network starter when you click on the “Volt-Meter” menu.
The “userSub()” in the “user_sub.ino” file, calls intervally or by clicking on the menu elements. The WebApp will send the uiAppData to this function and then it can be transferred in the chain network.
The “userGlobal()” function in the “user_global.ino” file calls at the same time in all of the devices in the chain network after the “CMD delay” time.
In the AC.h file, if you remove “#define LOG_ENABLE”, the logs will not be shown and the log memory would be released.
In the user_global.h file, you can set the default digital channel by the following “define” variable:
#define%26nbsp;%26nbsp; DIGITAL_CH_PIN%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp; 5
And you can set the analog raising and falling detection threshold value by the following variables:
#define%26nbsp;%26nbsp; ADC_R_THR%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp; 20
#define%26nbsp;%26nbsp; ADC_F_THR%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp;%26nbsp; 20
1.2
-Sample rate increased to 70Ksps
-Digital channel added (3Msps)
-Screen resolution increased to 4096*12288
-12 Buttons and features added
-Network volt meter added
1.1
-The Web Ui upgraded
1.0
-256x1000 pixel screen
-Sample speed button
-Internal pages secure link
-Shop MAC and IP in config page
-Set module hotspot and modem’s ssid and password
-Automatically connection to the modem
-Config page
-Hidden hotspot button
-Disable hotspot button