Steven Engel: Engineering Portfolio
Embedded Microcontrollers II Table of Contents
Course Description
Final Project: Accelerometer Theremin
​
Undergraduate Table of Contents
Main Table of Contents

Embedded Microcontrollers II
Spring 2023, Professor Will
Course Description:
This project-based course taught more advanced concepts in embedded microcontrollers at a higher level of abstraction, using C programming with plenty of libraries and a NUCLEO STM32 board. Additionally, the external peripherals themselves became more advanced, interfacing with LCDs, accelerometers, and motors without libraries/drivers.
Final Project: Accelerometer Theremin
Video: https://youtu.be/JyYWw6YjnkI
As an example of the work completed in this course, the final project is described below. This particular project was open-ended, with some hard specifications to follow: students had to work alone, using two "inputs" (push buttons/switches did not count) and two "outputs", one of which had to be an actuator (no LEDs). In addition, the project had to combine concepts from 5 out of the 7 lab sessions of the course!
For my project, with my love of music, I decided to create an "accelerometer theremin": based on the musical instrument where one hand holds a receiver that controls pitch and the other controls volume based on distance to a source, this modified theremin instead used the tilt of a breadboard on the y-axis to control pitch, and the x-axis to control volume. Additionally, a potentiometer was added as a master volume control, and speakers were used as the "actuator". Pulse-width modulation (PWM) was used with a digital output, a lowpass filter, an op-amp, and an array of sine values to produce an analog sine wave (all from a 5V digital signal). This sine wave produced a sound at a frequency varying from 20-999Hz, with this value being controlled by the accelerometer.
​
Some additional functionality included the ability to press a button to both a) mute the audio (for rhythmic purposes, perhaps) and b) record the current pitch, and display it on an LCD screen, without using any external libraries. This required me to write a custom algorithm which converted the raw frequency of the note to a string of the format "C#4", for example, where C is the note name, #, b, or a space can be appended to specify half steps, and 4 is the octave. A similar version of this algorithm was used to allow the user to override the note being played by the theremin by typing a note of this format into a UART terminal, which could serve as a tuning function.
​
This was an exciting project that allowed me to combine my passion for music with engineering, and utilized a lot of the concepts learned in this class: PWM, LCDs, advanced external peripherals and hardware, serial communication, extra careful consideration for data typing, and more.