# Use Arduino to study electromagnetic induction

## Using Arduino, it is straightforward to investigate the Faraday-Neumann-Lenz Law

Apr 20 · 5 min read

The pandemic has severely restricted the possibilities to attend practicals at schools and university. Arduino can be exploited, not only to mitigate the effects of the lockdowns, but to introduce a new way of engaging students in laboratory activities. One you start using Arduino for teaching, you will never return to traditional instruments and methods.

The first observation of electromagnetic induction, consisting in the development of a current in a coil when the magnetic flux varies through a surface that has the coil as a boundary, is credited to Michael Faraday, who reported it in 1831, formulating the law that today bears his name.

The experiments made by Faraday should be easily reproducible: on the other hand, one needs just a coil, a magnet and a device to measure the current developing in the coil when the magnet passes through it. As a matter of fact, however, the experiment is not so straightforward. First of all, a very sensitive galvanometer is required. It should also be quite fast in its response. Common multimeters, certainly, are not going to show any signal. Moreover, in order to spot a current of sufficient intensity, the variation of the magnetic flux must be large enough. This is usually achieved using a coil made of N turns, where N is large (often of the order of few hundreds).

With Arduino you can make this experiment seamlessly. Get a plastic or cardboard tube, like those used to hold posters. Wrap few turns of a common electrical cable, such as those used in home installations (20 or 30 turns will be enough), close to the end the tube. Be careful in keeping the turns close to each other, that can even be wound on top of each other superimposing more turns.

Using alligator clip jumpers, connect one end of the wire to one of the Arduino’s analog pins (e.g., A0) and the other one to the 3.3V pin. Write the following code in the Arduino IDE.

`void setup() {  Serial.begin(9600);}void loop() {  Serial.println(analogRead(A0));}`

The above sketch sets the communication speed of the USB port to 9600 bauds (a unit for serial communication speed) at the beginning of the run, with `Serial.begin(9600)`. Then, it repeatedly measure the voltage on A0 (`analogRead(A0)`). The function`analogRead()` returns the digitised voltage as an integer number between 0 and 1023 for voltages ranging from 0V to 5V. The digitised value is used as an argument of `Serial.println()` that sends its value to the USB port to which Arduino is connected. Using the Arduino’s Serial Monitor you can extract its value from the USB port and print it on the screen. This way, Arduino works like a voltmeter.

Change the speed of the port (9600) and the analog pin to be used (A0) according to your specific setup, if needed.

This sketch just measures the voltage of the A0 pin in units of ADC counts and prints it on the screen of the Arduino’s Serial Monitor. Since 1023 corresponds to 5V, the above setup should give 3.3×1023/5≃677. As a result you will see numbers close to 670–680 rapidly scrolling on the screen (the actual value may vary due to limited accuracy, while numbers may slightly change of ±1 due to statistical fluctuations). Opening the Serial Plotter you will see the same information plotted against time. In these conditions, the graph of voltage as a function of time is an horizontal line.

Keeping the Serial Plotter running, put the tube inclined at a relatively large angle (from 20° to 70°), such that the coil is at its lower end, and put a magnet inside it at the upper end. Leave the magnet slide along the internal of the tube and look at the Serial Plotter. You are going to see something like this.

As time progresses, the voltage measured on the Arduino pin is stable but, as soon as the magnet passes inside the coil, the variation of the magnetic flux suddenly induces an emf that is detected as a voltage increase (when the magnet approaches) and decrease (when it exits). The induced voltage, in fact, acts as a voltage source in series to the coil.

With such a setup, it is easy to show the validity of the Faraday Law: it is enough to measure the height of the peak V for various angles 𝜗. The larger 𝜗, the bigger V. In fact, the induced voltage is proportional to the speed v of the magnet and the latter can be estimated, exploiting energy conservation, as the square root of 2gh, g=9.8 m/s² being the gravitational acceleration, and h the starting height of the magnet (see the figure above). A plot of V as a function of v should appear as a straight line as below, where the last point does not lie on the line because the speed was too high, and Arduino could not cope with it, so the measurement is affected by a large systematic error.

A very simple and fast way to measure the height of the signal consists in recording the screen during the experiment, and looking at the movie, finding the frame in which it can be clearly seen.

As you can see, with Arduino and few cheap components you can perform, even at home or in the classroom, an experiment that usually requires dedicated (and sometimes expensive) instruments, as well as a dedicated space. Students can do the experiments by themselves, instead of just assisting at it. The activities can be modulated such that they can be just qualitative or quantitative, as in this case. Besides these advantages, with Arduino you can also teach some programming language: a fundamental skill for young students. Not to mention that the ability in using Arduino is a big advantage when looking for a job (in fact, you can be surprised about the number of jobs that will benefit from Arduino).

## CodeX

Everything connected with Tech & Code

Written by

## Giovanni Organtini

Professor of Physics at Sapienza Università di Roma. Member of the CMS and PADME collaborations. Arduino advocate and phyphox ambassador.

## CodeX

Everything connected with Tech & Code

Written by

## Giovanni Organtini

Professor of Physics at Sapienza Università di Roma. Member of the CMS and PADME collaborations. Arduino advocate and phyphox ambassador.

## CodeX

Everything connected with Tech & Code

## Speculation about the future of Apple silicon

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app