1 Introduction
After conducting the experiment “Plotting the P-R Characteristic Curve of the Power Supply,” using the existing circuit and making a few modifications to the experimental source code, the microcontroller successfully performed the experiment “Plotting the Relationship Curve between Power Supply Output Voltage and External Resistance.”
2 Circuit Setup for the Experiment
Connect a 10-ohm fixed resistor in series with a potentiometer with a total resistance of 200 ohms to the 5V power pin and GND pin of the ESP32 development board, following the schematic to set up the experimental circuit.
3 Code Writing and Uploading
Use pin IO33 to collect the voltage across the potentiometer as the terminal voltage; use the difference between the 5V voltage and the voltage across the potentiometer to obtain the voltage across the fixed resistor r, and apply Ohm’s law to calculate the current through the fixed resistor r, which is the power supply current; using the terminal voltage and current, the power supply output power and external resistance can be calculated.
Upload the following Phyphox mobile experimental source code to the ESP32.
/*
Plotting the U-R characteristic curve of the equivalent power supply.
*/
#include <phyphoxBle.h>
int Pin1 = 33;//Read the terminal voltage of the equivalent power supply
float It = 0;//Current of the equivalent power supply
float Vt = 0;//Terminal voltage to be measured
float R = 0;//External resistance to be measured
float r = 10.0; //Internal resistance of the equivalent power supply
void setup()
{
PhyphoxBLE::start(“Phyphox Bluetooth Experiment”);
PhyphoxBleExperiment plotPhotoResistor;
plotPhotoResistor.setTitle(“Plotting the U-R Characteristic Curve of the Power Supply”);
plotPhotoResistor.setCategory(“Phyphox Bluetooth Experiment”);
plotPhotoResistor.setDescription(“In this experiment, a fixed resistor r is connected in series with the 5V power supply of the ESP32 to form an equivalent power supply, measuring the external resistance and terminal voltage of the equivalent power supply, and plotting the U-R characteristic curve of the terminal voltage.”);
//View
PhyphoxBleExperiment::View firstView;
firstView.setLabel(“MyView”); //Create a “view”
//Graph
PhyphoxBleExperiment::Graph firstGraph;
firstGraph.setLabel(“U-R Characteristic Curve of the Power Supply”);
firstGraph.setUnitX(“R”);
firstGraph.setUnitY(“U”);
firstGraph.setLabelX(“Ω”);
firstGraph.setLabelY(“V”);
firstGraph.setChannel(1, 2);//Enable the 1st and 2nd Bluetooth channels
firstView.addElement(firstGraph);
plotPhotoResistor.addView(firstView);
PhyphoxBLE::addExperiment(plotPhotoResistor);
}
void loop()
{
float iVe = analogRead(Pin1) * 5.0 / 1024.0 / 4.0;//Read the terminal voltage of the equivalent power supply
if (iVe != 0.0)
{
Vt = iVe;//Calculate the terminal voltage of the equivalent power supply
It = (5 – iVe) / r ;//Calculate the internal current of the power supply
R = Vt / It ;//Measure the external resistance of the equivalent power supply
PhyphoxBLE::write(R,Vt);//Send via Bluetooth
};
delay(50);
PhyphoxBLE::poll();
}
4 Data Collection and Analysis
Connect the smartphone’s Bluetooth to the ESP32, load the experiment into the Phyphox system, run the program, and carefully adjust the potentiometer’s resistance with a screwdriver; the smartphone screen will automatically plot the curve of the terminal voltage of the equivalent power supply as it varies with the external resistance.
Experimental Image
Expand to Full Screen
It is very evident that the terminal voltage of the power supply increases with the increase of external resistance and eventually approaches the electromotive force of the power supply.
| Maker Jiaozuo |
Henan Maker Jiaozuo is the WeChat public platform of the Maker Education Master Studio in Jiaozuo City, focusing on Maker education as the primary research direction, sharing Maker cases, explaining innovative methods, inspiring creative design, conducting scientific inquiries, organizing social surveys, guiding thesis writing, participating in Maker competitions and patent applications, and discovering, cultivating, and achieving a group of students with innovative potential.
HenanPublic Number: chuangkejiaozuo
HenanMaster Blog: http://blog.sina.com.cn/updays
Long press to identify, follow, and share
– END –