Asee peer logo

Incorporating the Raspberry Pi into laboratory experiments in an introductory MATLAB course

Download Paper |


2017 ASEE Annual Conference & Exposition


Columbus, Ohio

Publication Date

June 24, 2017

Start Date

June 24, 2017

End Date

June 28, 2017

Conference Session

Software Engineering Concepts

Tagged Division

Computers in Education

Page Count




Permanent URL

Download Count


Request a correction

Paper Authors


Naji S Husseini Biomedical Engineering at NCSU and UNC-CH

visit author page

Naji Husseini is a lecturer in the Joint Department of Biomedical Engineering at the University of North Carolina at Chapel Hill and North Carolina State University. He received his B.S. and M.Eng. in Engineering Physics from Cornell University and his M.S. in Electrical Engineering and Ph.D. in Applied Physics from the University of Michigan, Ann Arbor. He teaches classes in materials science, biomaterials, MATLAB programming, and biomechanics for undergraduate and graduate students at both UNC and NCSU. His primary interests are in engineering education, materials physics, and x-ray imaging.

visit author page

author page

Ian Kaszubski North Carolina State University

Download Paper |


In our sophomore-level introductory programming class at University A, we teach basic MATLAB (The MathWorks, Inc.) and applications for later classes in signal analysis, instrumental interfacing, and multidimensional image reconstruction. In the past, and as many programming classes do, our weekly two-hour lab session involved simulated data and outputs in windows on the computer. While our students were prepared for their later classes with their MATLAB skills in artificially-created situations, they were unprepared to acquire or process real-world data interface with devices. Moreover, students’ feedback on labs was tepid and often mentioned labs were little more than in-class homework assignments.

Recently we have incorporated a series of six activities involving the Raspberry Pi (RPi, Raspberry Pi Foundation), a small single-board computer that, though not able to run MATLAB alone, can interface with MATLAB for relatively easy data input and output for less than $75 worth of parts. The two-hour partner labs and some additional outside coding reinforce and extend the fundamental MATLAB concepts from class through data collection and external-device triggering. Unlike some of the RPi experiments available online, ours focus mostly on MATLAB and pedagogy rather than involving advanced circuitry or programming in the Unix-based native operating system. The ultimate goal is to create an engaging and enjoyable learning environment that piques students’ interest while simultaneously teaching them advanced program design.

Each week’s lab has a particular focus.For example, the first week is an introduction to the RPi, and students use simple loops and conditionals, along with a buzzer and colored LEDs, to make a traffic light, visual/audio Morse-Code transmitter, and a trivia game. Two labs involve a 4x4 LED array to display scrolling letters and let a user play a memory game and a puzzle. Students create a chromatic tuner in one lab that reads an audio signal through a USB microphone, finds the dominant frequency via Fourier transform, compares it to a table of musical notes’ frequencies, and then triggers LEDs if the primary frequency is too flat/sharp. The last two labs focus on image processing, including creating a motion detector by comparing changes in two sequential images and calculating the coefficient of restitution of a bouncing ball. The image processing teaches concepts like thresholding, binarization, and filtering, along with mathematical operations like numerical derivation and centroid calculation. Because of the RPi’s simplicity and versatility, we anticipate adding new functionality like digital-to-analog conversion for electromyography sensors and other biomedical-engineering applications.

We are currently teaching the second semester with this new lab sequence. Student feedback has been very positive, as demonstrated in course evaluations. Last year’s students have said that the RPi-based labs prepared them for their later instrumentation classes and even summer internships working with RPis. Anecdotal reports and project- and exam-based assessment metrics from instructors of MATLAB- and instrumentation-heavy upper-level classes show better prepared and more successful students, validating our new labs’ pedagogical benefits.

Husseini, N. S., & Kaszubski, I. (2017, June), Incorporating the Raspberry Pi into laboratory experiments in an introductory MATLAB course Paper presented at 2017 ASEE Annual Conference & Exposition, Columbus, Ohio. 10.18260/1-2--28514

ASEE holds the copyright on this document. It may be read by the public free of charge. Authors may archive their work on personal websites or in institutional repositories with the following citation: © 2017 American Society for Engineering Education. Other scholars may excerpt or quote from these materials with the same citation. When excerpting or quoting from Conference Proceedings, authors should, in addition to noting the ASEE copyright, list all the original authors and their institutions and name the host city of the conference. - Last updated April 1, 2015