Line and load regulation: a microcontroller-based experiment

Voltage regulators, the most common application of Zener diodes, are included in many electronic devices we use in our daily lives. Therefore, students need to learn about regulators to understand the place of Zener diodes in modern electronic technologies. This study focuses on a microcontroller-based experiment that can be used to teach line and load regulation with real-time graphics. The main advantage of the designed experiment over its classical equivalent is its ability to display autonomous and real-time data display. It also eliminates the problem of determining the load resistance, which is the main difficulty of the classical experiment.


Introduction
Starting a high-powered vehicle or a sudden power failure causes voltage fluctuations in the electrical grid due to induction currents.Because these fluctuations are dangerous to electronic equipment, voltage regulators are found in many of the electronic devices we use in our daily lives.Voltage regulators, the main application of Zener diodes, are simple circuits that protect electronic devices from changes in input voltage.The fact Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence.Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI. that students learn the working principle of regulators will affect their perspective on the place of diodes in current technology.This study focuses on an Arduino-based experiment that allows students to observe line and load regulation with realtime graphics.
Arduino is an open-source hardware and software platform that uses ATmega series microcontrollers [1,2].All its design files, schematics, source code, and libraries are available for free.Its low cost and easy-to-program structure make Arduino an effective electronic tool for physics experiments.It can be seen that the Arduino platform is frequently used in the literature, especially in studies on mechanical [3][4][5][6][7] and electrical experiments [8][9][10][11].In recent years, studies on electronic topics such as diodes F Önder [12] and transistors [13,14], which are part of university physics programs, have started to take place in the literature.

Theory
Although Zener diodes behave like ordinary diodes in the forward bias region, they exhibit a unique characteristic under the reverse bias.When the potential difference across the terminals of a Zener diode reaches the breakdown voltage, it remains almost constant even as the current through the diode increases (figure 1).This makes Zener diodes an ideal electronic component for voltage regulators.Voltage regulation is studied under two headings: line regulation and load regulation.

Line regulation
In the circuit in figure 2(a), although the input voltage changes while the load resistance remains constant, the potential difference between the ends of the Zener diode remains constant within a certain range (between i zmax and i zk ).In this case, since the potential difference between the ends of the resistor R L will be equal to V z , the current passing through the load resistor can be written as; According to Kirchhoff's Laws; Since the Zener current must be between i zmax and i zk for the voltage regulation (see figure 1), i smax and i smin can be written as follows; If equations ( 4) and ( 5) are substituted in equation ( 2) sequentially, the following equations are obtained for V imax and V imin V imin = (i L + i zk ) .R s + V Z (7) In this case, regulation is provided through the load resistor in the range of V imin and V imax (V imin < V i < V imax ).The relationship between voltage across the load resistor (V O ) and input voltage (V i ) becomes as in the graph (figure 2(b)).

Load regulation
Although the R L resistance changes when V i is constant, the potential difference between the ends of the Zener diode remains constant within a certain range (between i zmax and i zk ).Therefore, the potential difference between the ends of the load resistor will be equal to the Zener voltage during regulation.According to Ohm's law and Kirchhoff's laws, equations (1)-( 3) are written exactly.As V i is constant, i s does not change.This time, the current through the load resistor changes depending on R L .Considering that the Zener current should be between i zk and i zmax for regulation, the variation range of i L could be written as; The variation range of R L could be written substituting R L and i s from equations ( 1) and ( 2), respectively, on equations ( 8) and ( 9) as;  The relationship between the voltage across the load resistor (V O ) and the value of the load resistance (R L ) becomes as in figure 3.

Line regulation with Arduino
In this study, the circuit shown in figure 4 was established by using the BZX55C3V0 Zener diode (i zk = 1 mA, i zmax = 125 mA, and V z = 3 V) [15].During the initial phase of the experiment, the potentiometer was fixed to 1 kΩ to observe the effect of the input voltage on the output voltage.Calculations, based on equations ( 6) and ( 7), indicate that the Zener diode can theoretically regulate input voltage values ranging from 4.87 V to 63.14 V.The power supply used in this experiment can produce a potential difference in the range of 0-30 V. Since this value is above the range that the Arduino can read (0-5 V), a voltage divider was added to the input of the circuit.
Using the A0 pin, the potential difference between the ends of the 100 Ω resistor is read.The A0 pin actually reads the electrical potential at the point to which it is connected.As the other leg of the resistor is connected to the GND pin, it can be said that the value read by the A0 pin is equal to the potential difference.The input voltage (V i ) applied to the regulator is calculated by multiplying the voltage read from the A0 pin by 11, as shown in the codes given in the appendix.The potential difference across the load resistor (V O ) is read with the A1 pin.
In this study, the PLX-DAQ macro was used to display the data in real-time.Before collecting data, the macro is run and port settings are made.Then the voltage of the power supply is increased from 0 to 30 V. The macro transfers the data from the Arduino to the Excel spreadsheet and the V O -V i graph is displayed in real-time (figure 5).

Load regulation with Arduino
During this stage of the experiment, the input voltage is held constant at a specific value to observe the effect of the load resistor on the output voltage.In this study, the V i voltage is fixed at 14 V and the i s current is calculated as 23.40 mA.When the datasheet is examined, it is seen that the maximum Zener current is 125 mA.In this case, there is no limit to the upper value of R Lmax .Using equation (11), the R Lmin value is calculated as 133.93.According to this data, the voltage regulation theoretically takes place in the range of 133.93 < R < ∞.A 1kΩ potentiometer and F Önder  a 10 Ω resistor connected in series are used as the load resistor in the circuit.The purpose of connecting the 10 Ω resistor is to allow the resistance value of the potentiometer to be read by the Arduino.In the circuit, while A1 pin determines the potential difference across the load resistor (V o ), A2 pin determines the potential difference between the ends of the 10 Ω resistor (V R ).Since the 10 Ω resistor is constant, the current through the resistor (i R ) can be calculated by dividing the V R value by 10. i R current also flows through the potentiometer.After calculating the voltage between the ends of the potentiometer (V pot = V o − V R ), the obtained value is divided by the i R current in the code sequence.So the Arduino can calculate the resistance of the potentiometer in real-time.When 10 Ω is added to this value, the total load resistance (R L ) is calculated as seen in the appendix.
To reach the load regulation curve the PLX-DAQ macro is rerun.Then the potential difference of the power supply is fixed and the resistance value of the potentiometer is increased starting from zero.Arduino reads the resistance value of the potentiometer and the potential difference between the ends of the load resistor at every 300 ms.The data is transferred to the Excel spreadsheet via the macro and the V o -R L graph shown in figure 6 is obtained.

Conclusion
The experimental setup designed for this study offers three significant advantages over classical setups used in electronics labs.Firstly, it allows students to generate real-time graphs.The realtime graphs support the experiment process with visual stimuli and facilitate the learning of concepts related to the subject.Secondly, the experimental setup allows for data collection with a delay of only 300 ms, resulting in a much larger amount of data being accessible in a shorter amount of time.This feature reduces the time spent collecting data, allowing students more time to interpret and discuss experimental results.Another advantage of the experiment is that data can be collected without disconnecting the potentiometer during the load regulation process.In the classical equivalent of the experiment, changing the resistance value of the potentiometer requires removing the load resistor from the circuit and reconnecting it after measuring with an ohmmeter.This procedure significantly increases both the data collection process and the potential for user-based errors in the experimental data.The major drawback of the experimental setup is the inability to determine the V o value for zero load resistance.To calculate the resistance of the potentiometer, it is necessary to connect a fixed resistor in series with it.This situation causes a load resistance equal to a constant resistance value in the circuit.The picture of the experimental setup can be found in the supplementary materials section.

Figure 2 .
Figure 2. (a) Classical experimental setup used in electronic laboratories.(b) Theoretical line regulation graph.