1 Introduction
After conducting the “Plotting the Power Supply Volt-Ampere Characteristic Curve” experiment, the microcontroller successfully replicated Teacher Mei’s experiment on “Plotting the Relationship Curve Between Power Output and External Resistance” using the existing circuit with only minor modifications to the source code.
2 Circuit Experiment Setup
Connect a 10-ohm fixed resistor in series with a potentiometer of total resistance 100 ohms, connecting the ends to the 5V power pin and GND pin on the ESP32 development board, as illustrated in the reference diagram.
3 Code Writing and Uploading
Use pin IO33 to collect the voltage across the potentiometer as the load voltage; calculate the voltage across the fixed resistor r using the difference between the 5V supply voltage and the potentiometer voltage, and use Ohm’s law to obtain the current through the fixed resistor r, which is the supply current. With the load voltage and current, you can calculate the external resistance and output power.
Upload the following Phyphox mobile experiment source code to the ESP32.
/*
Plot the P-R characteristic curve of the equivalent power supply.
*/
#include <phyphoxBle.h>
int Pin1 = 33;//Read the load voltage of the equivalent power supply
float It = 0;//Current of the equivalent power supply
float Vt = 0;//Load voltage
float R = 0;//External resistance
float P = 0;//Output power
float r = 10.0; //Internal resistance of the equivalent power supply
void setup()
{
PhyphoxBLE::start(“Phyphox Bluetooth Experiment”);
PhyphoxBleExperiment plotPhotoResistor;
plotPhotoResistor.setTitle(“Plotting the P-R Characteristic Curve of the Power Supply”);
plotPhotoResistor.setCategory(“Phyphox Bluetooth Experiment”);
plotPhotoResistor.setDescription(“This experiment uses a fixed resistor r in series with the 5V power supply of the ESP32 to form an equivalent power supply, measuring the external resistance and output power of the equivalent power supply, and plotting the P-R characteristic curve of the power output.”);
//View
PhyphoxBleExperiment::View firstView;
firstView.setLabel(“MyView”); //Create a “view”
//Graph
PhyphoxBleExperiment::Graph firstGraph;
firstGraph.setLabel(“Power Supply P-R Characteristic Curve”);
firstGraph.setUnitX(“Ω”);
firstGraph.setUnitY(“W”);
firstGraph.setLabelX(“Resistance”);
firstGraph.setLabelY(“Power”);
firstGraph.setChannel(1, 2);//Enable the first and second 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 load voltage of the equivalent power supply
if (iVe != 0.0) {
Vt = iVe;//Calculate the load 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
P = Vt * It ;//Measure the output power of the equivalent power supply
PhyphoxBLE::write(R,P);//Send external resistance and output power data 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 equivalent power supply’s output power as a function of external resistance.
Experimental Image
Expand to full screen
5 Conclusion
Data analysis shows that the plotted curve of the relationship between the power output and external resistance indicates that the maximum output power of the equivalent power supply is 0.625 watts, which corresponds to an external resistance of 10 ohms.
The experimental conclusion is completely consistent with the parameters of the equivalent power supply built in the circuit.
6 Reflection
Science and technology are the primary productive forces. With the modernization of educational technology, we can truly welcome the spring of student-led experimental exploration activities.
| Maker Jiaozuo |
HenanMaker Jiaozuo is the WeChat public platform of the Jiaozuo City Maker Education Teacher Studio, focusing on maker education, sharing maker cases, explaining innovative methods, inspiring creative design, conducting scientific exploration, organizing social investigations, 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
HenanFamous Teacher Blog: http://blog.sina.com.cn/updays
Long press to recognize, follow, and share
– END –