Note
The project was built on top of the template project provided by ESP-IDF. The example is used by command idf.py create-project
that copies the project to user specified path and set it's name. For more information follow the docs page
The project was developed with the VSCode IDE using the ESP-IDF extension. The project can be built and flashed to the ESP32-C3 using the ESP-IDF tools. The web server can be accessed by connecting to the ESP32-C3's Wi-Fi network and navigating to the IP address of the ESP32-C3 in a web browser.
A good starting point is:
Copy the settings file for VSCode to enable ESP-IDF extension features:
cp .vscode/settings.json.example .vscode/settings.json
Then choose the esp32c3
target by clicking on the target in the bottom bar of VSCode, or by pressing Ctrl+Shift+P and typing ESP-IDF: Set Espressif device target
.
The project was developed with ESP-IDF version 5.5.1, so make sure to use the same version or a compatible one. You can set the ESP-IDF version by clicking on the ESP-IDF version in the bottom bar of VSCode, or by pressing Ctrl+Shift+P and typing ESP-IDF: Select Current ESP-IDF Version
.
By doing this, the ESP-IDF extension will use the correct toolchain and settings for the ESP32-C3.
To connect to the ESP32-C3's Wi-Fi network, the default SSID is "ESP32_PLOT"
with no password. Then navigate to http://192.168.4.1
in a web browser and the web interface should load. The /data
endpoint is used to fetch the data for the chart, it returns a JSON object with the voltage and current data as a list of x,y points.
The Circuit is based on an ESP32-C3 microcontroller, INA219 current sensor, and an op-amp based voltage controlled current source (VCCS) to load the solar panel. The ESP32-C3 reads the voltage and current from the solar panel using the INA219 sensor, and adjusts the load using PWM to control the VCCS. The data is then sent to a web server hosted on the ESP32-C3, where it can be visualized in real-time.
A prototype PCB was mounted on a perfboard, and the firmware was developed using ESP-IDF. The web interface is built using HTML, CSS, and JavaScript, and uses the Chart.js library for data visualization. For more information about the circuit design and implementation, please refer to the notebook.
The solar panel used is a Luxen 10W 12V panel. LN-10P
- Rashid, M.H. (2013) Power Electronics: Devices, Circuits, and Applications. 4th Edition, Pearson Education, Harlow. Chapter 16 - Introduction to Renewable Energy.
- Practical Guide to Implementing Solar Panel MPPT Algorithms - 00001521a.pdf
- Modeling Photovoltaic Cells - Theory 1/2 - YouTube
- Modeling Photovoltaic Cells - LTspice model part 2/2 - YouTube
- INA219 Zerø-Drift, Bidirectional Current/Power Monitor With I2C Interface datasheet (Rev. G) - ina219.pdf
- Using An Op Amp for High-Side Current Sensing (Rev. A) - sboa347a.pdf
- operational amplifier - High voltage adjustable constant current source controlled by MCU - Electrical Engineering Stack Exchange
- An_Easy_Solution_to_Current_Limiting_an_Op_Amp - sbva011.pdf
- Implementation_and_Applications_of_Current_Sources_and_Current_Receivers\ - sboa046.pdf
- operational amplifier - MOSFET - OPAMP circuit - Electrical Engineering Stack Exchange
- voltage - Driving an IRLZ44N Logic MOSFET with a 2N2222 NPN Transistor from an ESP32 - Electrical Engineering Stack Exchange
- microcontroller - Micro-controller controlled current source - Electrical Engineering Stack Exchange
- Unstable Feedback in Opamp+MOSFET circuit for Voltage Controlled Current Source - Electrical Engineering Stack Exchange
- Power MOSFET gate driver fundamentals - AN90059.pdf
- PWM DAC (Rev. A) - slaaec5a.pdf
- Using PWM Output as a Digital-to-Analog Converter on a TMS320F280x (Rev. A) - spraa88a.pdf
- Using PWM Timer_B as a DAC (Rev. A) - slaa116a.pdf
- Dual-Output 8-Bit PWM DAC Using Low-Memory MSP430â„¢ MCUs - slaa804.pdf