A device that can be used to measure Alternating Current (AC) voltage level generated from a triboelectric device by rectifying the current to a Direct Current (DC) and read the voltage level through an Analog-Digital Converter (ADC) pin of the microcontroller Espressif ESP32-WROOM-32E. The hardware will be accompanied by a web server which visualises and handles recorded data.
Project Managers: Dr Ramyah Gowrishankar, Prof Yu Xiao
Project Owner: Nghia Tran
- Prototype version 1: 24.09.2023.
- Prototype version 2: 08.10.2023.
- Final product: 15.10.2023
- Documentation and Learning Log: 20.10.2023.
The scope of this project includes creating a fully functional prototype and a printed circuit board (PCB) schematic for further development.
- Prototype version 1: Develop a fully functional embedded prototype.
- Objective 1.1: The device can read the voltage level accurately.
- Objective 1.2: The device can operate within a desired response time.
- Prototype version 2: Develop a fully functional web server that can handle recorded data.
- Objective 2.1: The web server can visualise the recorded data.
- Objective 2.2: The web server can instruct the microcontroller to start/stop recording data.
- Objective 2.3: The web server can control the microcontroller recording speed.
- Objective 2.4: The web server can download the recorded data.
The process of developing the Objective step-by-step.
To read the voltage, we use Arduino analogRead() function. The ESP32 returns a range from 0 - 4095 for the raw analogRead() values, and we need to map those discrete values to volts. According to the manufacturer Espressif, ESP32-WROOM-32E can read from 0 – 3.3V maximum (https://docs.espressif.com/projects/esp-idf/en/v4.2/esp32/api-reference/peripherals/adc.html), so we are mapping 0 - 4095 to 0 – 3.3 by dividing the received value by
Figure 1: Rectifying circuit and microcontroller pinout schematic
Figure 2: The model PCB 3D model
We must use a capacitor to stabilise the current, otherwise there would be too much noise to read from. The problem with response time is if we use a capacitor that is too high of a Farad value, it will take longer time to charge and discharge. On the other hand, too low of a Farad value would cause the microcontroller to read in more noise. The aim here is to find which capacitor works best. The triboelectric device voltage level can be varied vastly according to when we try to record, so the most practical way to find the best capacitor is by experimenting with a wide range of them. Finally, the best capacitor for this triboelectric device is 1nF capacitor.
For Objective 2.1, we use highcharts.js library for making the graph and html for web page template. The code in the appendices follows a guide from https://randomnerdtutorials.com/esp32-esp8266-plot-chart-web-server/ with some modifications for reading the voltage. The following Objectives are done using ESPAsyncWebServer library for the web server for Arduino frame and JavaScript + HTML for the client. Details can be found in the code appendices.
Espressif ESP32-DevKit-V4 microcontroller: 1 piece
1N4148 diode: 4 pieces
4700 Ohms resistor: 1 piece
1nF capacitor: 1 piece
Jumper wires
Breadboard: 1 piece
Alligator clips: 2 pieces
- VSCode with Platform.io plugin
- Arduino IDE with
- LittleFS.h library for file handling
- Wifi.h and ESPAsyncWebServer.h libraries for WiFi AccessPoint/Station handling
- time.h library for time managing
- Arduino.h library frame to handle ESP32 microcontroller