Recently, the microcontroller obtained a coil and conducted a coil induction experiment using ESP32 and Phyphox. Due to the small inductance of the coil, the induction phenomenon was not very obvious, but the technical solution has been validated. If a coil with more turns and an iron core can be obtained, the experimental effect should be more ideal.
The inductive coil is connected in series with a sampling resistor, powered by the 5V supply on the ESP32. The voltage across the sampling resistor is measured using pin IO33, and the current value is calculated using Ohm’s law. The data is transmitted via Bluetooth, and Phyphox is used to plot the current-time graph of the coil.
During the experiment, first connect Bluetooth, run the Phyphox program, and then connect the circuit. Phyphox will automatically record the current-time relationship graph of the coil.
Due to the small self-induction coefficient of the coil, the induction phenomenon was not very obvious, but the technical solution has been validated. Once a coil with a larger self-induction coefficient is obtained, the experiment will show a more ideal effect.
Experimental Source Code
/*
Induction: Connect the coil in series with the sampling resistor, powered by the 5V supply of the ESP32. Use pin IO33 to read the voltage value of the fixed resistor, calculate the current value of the sampling resistor using Ohm’s law, and transmit it to Phyphox via Bluetooth to plot the current image at the moment the coil is powered.
*/
#include <phyphoxBle.h>
int Pin = 33;//Specify data acquisition pin
int iV = 0;//Initial voltage value
void setup()
{
PhyphoxBLE::start(“Phyphox Experiment”);//Bluetooth device name
PhyphoxBleExperiment plotCapacitor;
plotCapacitor.setTitle(“Coil Induction Experiment”);//Mobile experiment name
plotCapacitor.setCategory(“Phyphox Bluetooth Experiment”);//Mobile experiment category
plotCapacitor.setDescription(“Zhang Huaihua: Connect the coil in series with the sampling resistor, powered by the 5V supply of the ESP32. Use pin IO33 to read the voltage value of the fixed resistor, calculate the current value of the sampling resistor using Ohm’s law, and transmit it to Phyphox via Bluetooth to plot the current image at the moment the coil is powered.”);
//View
PhyphoxBleExperiment::View firstView;
firstView.setLabel(“MyView”); //Mobile experiment page
//Graph
PhyphoxBleExperiment::Graph firstGraph;
firstGraph.setLabel(“Coil Induction Experiment”);//Mobile experiment image name
firstGraph.setUnitX(“s”);//Mobile experiment image x-axis unit
firstGraph.setUnitY(“A”);//Mobile experiment image y-axis unit
firstGraph.setLabelX(“Time”);//Mobile experiment image x-axis physical quantity
firstGraph.setLabelY(“Current”);//Mobile experiment image y-axis physical quantity
firstGraph.setChannel(0, 1);
firstView.addElement(firstGraph);
plotCapacitor.addView(firstView);
PhyphoxBLE::addExperiment(plotCapacitor);
}
void loop()
{
iV = analogRead(Pin);
float Ic = iV * 5.0 / 4096.0 / 10.0;//Current calculation formula for the sampling resistor
PhyphoxBLE::write(Ic);//Bluetooth transmission of the sampling resistor current data
delay(10);//Delay time
PhyphoxBLE::poll();
}
| Maker Jiaozuo |
HenanMaker Jiaozuo is the WeChat public platform of the Maker Education Master Studio in Jiaozuo City, mainly focusing on maker education, sharing maker cases, explaining innovative methods, inspiring creative design, conducting scientific inquiry, organizing social surveys, guiding thesis writing, participating in maker competitions and patent applications, 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 enter the “Maker Jiaozuo” WeChat platform
– END –