Project from my internship at Trio Mobil that measures current and graph this measurement.
The current measuring circuit (see the image) is built using an Esp32 module. The power is connected to 3.3 Volts and the resistor on the right is 1 kOhm. The current on the resistor in the left is read through pin 34 with the code written using Arduino (ReadAnalogCurrent). The code measures the average voltage at every 100 values and then calculates the current.
The GetValue file is written to read the data and store it in a .json file every second. Flask is also set up inside to serve an API that displays the data collected previously in a graph.
The graph code is originally downloaded from this website and extracted. The modified version is a line graph where you can choose a spesific time interval using the scrollbar and view the data measured.