54798 - Lab-based Course on Electromagnetism and Optics

Course Unit Page

Academic Year 2021/2022

Learning outcomes

Modules 1, 2 and 5. The student will perform experimental measurements on electrical circuits in both sinusoidal and transitory regimes, on electromagnetic induction and on physical optics; he/she will acquire basic skills in written and oral presentation of experimental results.
Module 3. The student will have in depth knowledge on programming in C++ and on Monte Carlo methods for the simulation of physical processes.
Module 4. The student will have an intermediate knowledge of the LabVIEW programming language, including its use for the development of data acquisition and analysis applications

Course contents

The course is divided in five modules which cover in an integrated fashion different aspects of data acquisition, analysis and presentation (both in written and oral form), with reference to the topics covered in the second year of the first level physics degree.

Module 1 (Fundamentals and methods of electromagnetism, circuits and optics laboratory), Prof. Federico Boscherini, 2nd semester

In this module, the main experimental methods used in the electromagnetism, circuits and optics laboratory will be described, with reference to the laboratory sessions. The methods to be used when writing a report and when giving a talk reporting scientific results will be described, with reference to the customary standards of the international scientific community. Finally, some complements necessary to perform the laboratory sessions on electrical circuits in the transient and sinusoidal regime will be given.


  • Characteristics of laboratory instruments. Function generators. Digital multimeters. Oscilloscopes. Lasers. Light detectors, photodiodes. Reference: Boscherini Strumenti
  • Reports. Methods and standards used when writing a laboratory report and when presenting experimental results in a talk. Linear and non linear fits.
  • Oscilloscopes. Analogue and digital oscilloscopes. Static and dynamic sensitivity, band pass. Vertical gain, horizontal deflection and saw tooth time scan. Trigger. Digital oscilloscopes. Reference: Bava, Galzerano, Norgia, Ottoboni e Svelto
  • Complements on circuits in the transient and sinusoidal regime. Capacitors and inductors. First order circuits. Second order circuits. RLC circuits in the sinusoidal regime and phasors. Frequency response. Low pass, high pass, band pass circuits and resonant circuits. Reference: Perfetti, chap. 6, 7, 8 and 13 (part). Copy of lecture slides available on virtuale.unibo.it

Module 2 (Electrical circuits laboratory), Dr. Nicoletta Mauri, 2nd semester

Module 2, consisting exclusively in laboratory sessions, consists in designing a simple circuit on ELVIS breadboard, writing a data acquisition program in LabVIEW, performing measurements and analyzing and discussing the results.

Module 5 (Optics laboratory), Dr. Matteo Franchini, 2nd semester

Module 5, consisting exclusively in laboratory sessions, consists in designing a simple physical optics measurement, writing a data acquisition program in LabVIEW, performing measurements and analyzing and discussing the results.

Module 3(ROOT), Prof. Silvia Arcelli, 1st Semester

  • Recap on the main concepts of Object Oriented Programming in C++: coding conventions, classes, member functions and data members, encapsulation, aggregation and inheritance, polymorfism.
  • Applications of the ROOT Data Analysis framework Usage for the data simulation and analysis with examples connected to the laboratory sessions which will be held during Module I:
  • Further fuctionalities, with examples, of histograms (THx), graphs (TGraph), functions (TFx), ROOT persistency (TFile).Fitting data with ROOT (linear and non linear fits).
  • the ROOT Monte Carlo utilities for the generation of physics distributions and for the simulation of experimental effects (resolution,efficiency)
  • Advanced ROOT applications: The ROOT Collection Classes (TList) and ROOT n-tuple type data (TTree)

Module 4 (LabVIEW), Prof. Luca Pasquini, 1st semester

  • The LabVIEW Graphical programming language. Introduction to LabVIEW: Virtual Instruments and dataflow paradigm. Front panel, block diagram, controls, indicators, constants and functions. Data types: numeric, Boolean, string. Arrays, Clusters and Type definitions. Using loops: While loops, For loops, Tunnels and Shift Registers. Decision-making structures: Case Structure, Event Structure. Polling vs Event-drive programming. SubVIs and modularity. Accessing file sin LabVIEW. Sequential and state-machine programming. Local and Global variables, race conditions. Communicating data between parallel loops: queues and notifier functions.
  • Data acquisition. General architecture of a data acquisition (DAQ) device. The measurement chain. Analog to Digital Converters (ADCs). Communication buses. Signal-device connection. Signal sampling: aliasing and Nyquist theorem. Buffered data acquisition. The DAQ-mx library in LabVIEW.
    Introduction to the Arduino Uno microcontroller. Programming of Arduino in C++ and LabVIEW


Modules 1, 2 and 5 (Electromagnetism, circuits and optics laboratory)

  • Renzo Perfetti, Circuiti Elettrici, Zanichelli, 2013.
  • Copy of lecture slides are available at iol.unibo.it (search with “Federico Boscherini”)
  • Elio Bava, Gianluca Galzerano, Michele Norgia, Roberto Ottoboni e Cesare Svelto, Misure elettroniche di laboratorio, Pitagora Editrice, 2005.
  • R. Bartiromo e M. De Vincenzi, Electrical Measurements in the Laboratory Practice, Springer

    Module 3 (Root)
  • Available on virtuale.unibo.it (search with “Silvia Arcelli ”)
  • Official ROOT material (User guide, Reference guide) from http://root.cern.ch [http://root.cern.ch/] ; The ROOT primer: https://root.ern.ch/root/htmldoc/guides/primer/ROOTPrimer.html
  • Slides of the lectures and ROOT code examples written during the lectures

Module 4 (LabVIEW)

  • National Instruments LabVIEW online courses

  • Slides on DAQ devices and Arduino are available on Virtuale

  • Guides for the laboratory sessions and templates for drawing up the reports

Teaching methods

Lectures and laboratory (compulsory). Below are some details on the laboratory sessions for each module

Note: Laboratory and general safety: All students must attend Modules 1 and 2 [https://www.unibo.it/en/services-and-opportunities/health-and-assistance/health-and-safety/online-course-on-health-and-safety-in-study-and-internship-areas] online, while Module 3 on health and safety is to be attended in class. Information about Module 3 attendance schedule is available on the website of your degree programme


Modules 1, 2 and 5 (Electromagnetism, circuits and optics laboratory)

Each student will perform one experiment, either circuits or optics, working in couples; three laboratory sessions are planned. A written report is required, using a given template. The experiment will also be the subject of an oral presentation using PC and beamer.

Module 3 (Root)

The students will perform three laboratory sessions and each student individually will write a C++ program to simulate physics data and perform their analysis using the ROOT functionalities, making practice of C++ Object Oriented programming. A written report of the laboratory sessions is required, using a given template and including the C++/ROOT code listing; the report, in PDF format, must be sent by e-mail to a specific e-mail address within 30 days after the completion of the laboratory sessions.

Module 4 (LabVIEW)

The students will attend three lab sessions, which include the realization of simple electrical circuits on DAQ device ELVIS II and the implementation of a LabVIEW program for data acquisition and analysis. The subjects of the experiments are: 1) Measurement of the code width and noise of ELVIS II, buffered data acquisition and Nyquist sampling theorem; 2) Ohm’s law and resistive circuits in direct current; 3) transient regimes in RC circuits. During the first two sessions the students will work in couples, while the third session will be carried out individually.

Assessment methods

The final mark is an overall evaluation related to the topics covered in the course and is equal to the weighted average of the marks of the five modules, according to the formula:

V(fin)= 0.5 × V(mod1&2&5) +0.192 × (mod3) + 0.308 × V(mod4).

In order to attribute an overall “cum laude”, it must have been attributed to at least two modules. 

The exam for different modules can take place in any order.

For all modules, presence during laboratory sessions is compulsory.

Oral exams can be performed in English upon request.

Modules 1, 2 and 5 (Electromagnetism, circuits and optics laboratory)

The joint mark for modules 1, 2 and 5, V(mod1&2&5), takes into account the evaluation of:

 A) A written report, maximum length 6 pages, on the circuits or optics experiment.

B) An oral presentation with computer and beamer on the circuits experiment, maximum time 10 minutes, and subsequent discussion. The oral exam can be booked via almaesami, 3 students every hour and a half slot, 12 students a day.

In all evaluations there is a great emphasis on the assesment of critical thinking and communication abilities.

Each of these activities is evaluated with a mark in the range 0 – 6. The final mark, on condition that each activity is judged positively, is V(mod1&2&5) = 18+1.1x(2A+4B)/3, with a maximum of 30. “Cum laude” can be attributed if the mark is >30.

Module 3 (Root)

During the second and third laboratory sessions, the students write a report using a pre-defined template. The reports of the laboratory sessions receive a score A ranging from 0 to 5. The final assessment consists in a written exam with 4 questions, requesting the student to write C++code using the ROOT functionalities illustrated during the module. To the written exam a maximum score B of 28 is given. The final score of the module is given by C=A+B. The exam is passed if C>=18. “Cum laude” is attributed if C>30.

The score of the written exam and report will be based on the assesent of the student's knowledge of C++ and ROOT, with particular emphasis on data fitting and Monte Carlo simulations.

Module 4 (LabVIEW)

During the three laboratory sessions, the students write a report using a pre-defined template. The reports must be delivered in PDF format at the end of the sessions. The score obtained in the report on the third lab session (the only one carried out individually) constitutes the exam’s score. The score will be based on the assesment of the student's ability to write a LabVIEW code for data acquisition relative to electrical circuits.

Teaching tools

Well equipped computer, optics and electronics laboratories.

Office hours

See the website of Federico Boscherini

See the website of Nicoletta Mauri

See the website of Silvia Arcelli

See the website of Luca Pasquini

See the website of Matteo Franchini