FINAL REPORT REV. 1.10 PAGE 10

TEAM COUCH STREET

University of Portland

School of Engineering Phone 503 943 7314

5000 N. Willamette Blvd. Fax 503 943 7316

Portland, OR 97203-5798

Final Report

Frequency Response Audio Visualizer

Team Members:

Jake Nylund (Fall Team Lead)

Kevin Ratuiste (Spring Team Lead)

Alex Arlint (Treasurer)

Robert Rodriguez (Secretary)

Industry Representatives:

John Turner – Impinj, Inc.

Faculty Advisors:

Dr. Joseph Hoffbeck

Clients:

Will Taylor – Student

REVISION HISTORY

Rev. / Date / Author / Reason For Changes
0.9 / 21 Mar 2014 / Team / First draft submitted to advisor
0.95 / 28 Mar 2014 / Team / Second draft submitted to advisor
1.0 / 3 Apr 2014 / Team / Final draft submitted to advisor
1.1 / 7 April 2014 / Kevin Ratuiste / Updated Schematics (Figures 3 and 6)

TABLE OF CONTENTS

REVISION HISTORY 2

INTRODUCTION 4

HIGH LEVEL ARCHITECTURE 5

HARDWARE AND SOFTWARE DESIGN 6

User Interface 7

Arduino Due Microcontroller 8

Software 8

Electromagnet 9

Mechanical Components 12

Miscellaneous Changes 12

ASSUMPTIONS 12

RISKS 13

MILESTONES 13

CONCLUSION 14

GLOSSARY 15

REVISION HISTORY 2

INTRODUCTION 4

HIGH LEVEL ARCHITECTURE 5

HARDWARE AND SOFTWARE DESIGN 6

User Interface 7

Arduino Due Microcontroller 8

Software 8

Electromagnet 9

Mechanical Components 12

Miscellaneous Changes 12

ASSUMPTIONS 12

RISKS 12

MILESTONES 13

CONCLUSION 14

GLOSSARY 14

INTRODUCTION

Frequency Beats, the name given to this project, is a frequency response audio visualizer. The overall goal of the device was to visualize the spectrum of an audio signal. The input is an analog line level audio signal connected via a standard 3.5mm headphone jack. This signal enters the microcontroller where it is processed and filtered to separate the various frequencies in the audio signal. Implementing the filters digitally allowed more flexibility in how the microprocessor processed the signal as well as the resulting action or response. Once the frequencies of the audio signal were separated, they were output to the electromagnets, which, in turn, manipulated the ferromagnetic fluid creating a visual representation of the audio signal.

A front view of the final product is shown below in Figure 1, illustrating the front of the apparatus, consisting of three glass chambers partially filled with ferrofluid. Each glass chamber has a handmade electromagnet fixed to the top of it.

Some highlights of the implementation phase were building electromagnets, designing and building a circuit that takes the Arduino’s PWM outputs and controls the electromagnets, and implementing a working program for the microcontroller that does the processing required and seeing that the project works in parts.

The two biggest challenges the team faced was implementing the Fast Fourier Transform (FFT) algorithm on the Arduino Due and to design a circuit that can be controlled by the Arduino’s PWM outputs. Another minor challenge was trying to produce three, mostly identical electromagnets that would generate a strong enough electromagnetic field to actuate the ferrofluid. The first attempts produced depressingly sub-par results and extra assistance was needed to produce electromagnets of proper quality. Each of these challenges were addressed according to the team’s list of anticipated challenges in the design document and was ultimately overcome.

While the team noticed early in the Spring Semester that their milestones were overly ambitious and not in the ideal order for completion, the team did well at sticking to their basic original design, communicating with each other to anticipate, and plan for, any potential future challenges, and solving problems quickly as they arose in order to stay on schedule. The team could have done better in regards to testing individual components on a smaller scale as they were assembled and utilizing circuit simulation software, rather than testing larger sets of components towards the end and final assembly.

The following sections of this document will address how the team handled the challenges mentioned above, as well as, detail the technical and process outcomes, including the differences between the team’s original designs and the final product, how the implementation was different than intended, and a discussion of assumptions, changes, milestones, and risks the team faced. Additionally, there is a glossary at the end of this document.

HIGH LEVEL ARCHITECTURE

The figure below shows the high level architecture of Frequency Beats. The three components to note are the Arduino, Low-Pass Filter (LPF), and the control circuit. First, the audio signal is processed by the Arduino and broken up into its low, mid and high frequencies. This is output as a PWM signal, which is then smoothed out to a DC signal by the LPF. This DC signal is then sent to the control circuitry, which turns the electromagnet on or off.

HARDWARE AND SOFTWARE DESIGN

This section will go into the multiple components that make up the project. Both hardware and software designs will be discussed. Figure 3 below shows the overall final schematic of Frequency Beats.

User Interface

The user can plug in their audio signal via a 3.5mm standard line level audio cable on the back side of the project device. Once connected, the user presses play on the audio device (Ipod, Iphone, etc.) and watches the audio visualization of his or her music choice on the front side of the device. Additionally, the user will be able to hear the music, via external powered speakers, while viewing the ferrofluid displays with the aid of a 3.5mm headphone splitter; the user will not have to interact with this component as it is a passive piece on the back side of the device. Originally, the team had planned on using buttons on the face of the apparatus to manipulate the ferrofluid without music, but toggle switches were easier to incorporate. When looking at the front of the apparatus, having the switch to the left, forces the electromagnet on, to the right, the electromagnet is controlled by the audio input, and in the middle, the electromagnet is always off.

Arduino Due Microcontroller

The primary digital component that will be utilized in the design is the Arduino Due, which is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 CPU. It is the first Arduino board based on a 32-bit ARM core microcontroller. It has 54 digital input/output pins, 12 analog inputs with 12 bits of resolution each, and 12 PWM output pins.

This component will be used to digitally filter the input audio signal using a Fast Fourier Transform (FFT) algorithm, separating it into low-range, mid-range, and high-range frequency bands, averages the amplitudes to produce a single DC voltage representation of each band, and outputs those three signals to the electromagnets.

Software

The key software utilized in the design will be the Arduino integrated development environment (IDE), which is a cross-platform application written in java. The team will use this software to write the code necessary for filtering the input audio signal. An overview of the process to be implemented via code is shown below.

Figure 5 shows the general process that the signal will undergo as it is sampled by the Arduino. Simply stated the Arduino will continuously sample the input on one of the analog input pins using a loop. From there, using FFT, the signal will be separated as low pass, band pass, and high pass filters. These frequencies will range from 20Hz - 160Hz for the low frequencies, 160Hz – 7.5kHz for mid-range frequencies, and 7.5kHz - 15kHz for the high frequencies. Each signal will be output to three different digital output pins. The Arduino will process the audio input with a buffer size of 1024 and a sample rate of 44100Hz. The Arduino output is a Pulse Width Modulation (PWM) signal between 1 and 3.3 volts. These outputs will be combined by taking the magnitude of each output, and then summed. This value will then be scaled to a number between – 85 and 255 (the PWM output which comes out around 500Hz). The following is a list of the functions the Arduino will be performing.

Init

Initialize I/O pins and variables for the sampling and output process

sampleLoop

This loop will continuously sample the audio input in Analog format. Using FFT it will split the signal and output onto three separate pins for high, low, and band pass frequencies.

FFT will output several complex numbers, or rather a real and complex part of each number in the form of doubles. Each of the outputs will be sent to each of their corresponding output pins as a combine value, putting the real and complex portions into one value. The values will be continually recalculated in the loop to continually send to their respective pins, for example pins 22, 23, and 24 on the Arduino. The signal will then pass through a low pass filter in order to create the proper DC current output for the circuit.

Electromagnet

Power Supply

The signal from the Arduino was not strong enough to drive the electromagnet. Thus, the electromagnets were powered by a 6.5A, 12V power supply.

Control

As seen in the figure below, the signal from the Arduino’s PWM output pins is passed through a LPF, which acts as a simple DAC, allowing the electromagnets to be powered to any level within a certain range. A 2N3904 BJT is controlled by the low-passed PWM signal from the Arduino, which in turn controls an IRF3205 MOSFET. Together they act as the “on/off” switch for the electromagnet. At 3.3V the IRF3205 begins to saturate and the electromagnet begins to turn on. At 5V or higher, the MOSFET is completely saturated and the electromagnet is fully on. However, since the maximum voltage of the PWM signal after the LPF is only approximately 2V and thus never high enough to saturate the MOSFET, the signal could not be input directly into the IRF3205.

In order to provide enough voltage so that the MOSFET turns on, 6V is connected to its base and the 2N3904 controls when the IRF3205 base voltage is pulled high or low. This control was done by setting the base of the 2N3904 to 1.5V, so that when 2V or higher is seen at the collectoremitter, in other words Vce is greater than Vb, the BJT turns off. With the 2N3904 off, the IRF3205 is pulled high, thus turning the electromagnet on. As for when less than 1.5V is at the collectoremitter, the 2N3904 is on, which pulls the base of the IRF3205 to below 3.3v, turning the electromagnet off.

The team had to diverge from the original plan since the maximum current from the Arduino was less than the originally anticipated 40mA and could not trigger the TIP102. The team tried multiple fixes, including cascading another BJT in front of the TIP102, but none worked. In addition, it was difficult to observe the current coming out of the Arduino’s PWM outputs hindering debugging. Subsequently, the circuit was completely reworked to what it is now so that it was dependent on voltage level as opposed to current.

Another small change that was made was the addition of a flyback diode. This protected the circuitry from the voltage spikes that occur when the electromagnet is suddenly turned off.

Build

Each electromagnet was made with of approximately 270 feet of 26 gauge magnet wire and wrapped around a 1/4” diameter iron core that is 5 inches in length. The internal resistance of the wire was approximately 13Ω (greater than the originally anticipated 5.7 Ω). The electromagnets were mounted above the ferrofluid display. After many unsuccessful attempts at hand wrapping electromagnets, the team finally found success using a lathe to slowly wrap each individual electromagnet. Each magnet took approximately 3 hours to manufacture. Figure 10 below illustrates a hand wrapped electromagnet, on the right, and one wrapped carefully using a lathe, on the left.

Mechanical Components

The team’s project incorporates several simple mechanical devices. One of which was the casing that houses the Ferro fluid. For this, the team originally planned to use plexiglass cylinders, each with a diameter of approximately 2 inches and height of 5 inches. However, the ferrofluid stuck to the sides of the plexiglass, completely blacking out the display, and making it impossible to see inside the display. To address this, the team decided to use glass cylinders instead, since the ferrofluid did not stick to glass. The electromagnets were mounted above the cylinder. Additionally, a wood base was constructed to mount the three Ferro-fluid displays, control circuit, and Arduino.

Miscellaneous Changes

Most changes that occurred were explained in the above sections, but there were some other minor changes that the team also had to make during the semester.

LEDs

As of now, the team unfortunately was not able to incorporate LEDs to pulse with the music as stated in the Functional Specification Document. The setbacks caused by trouble with the FFT code, unexpected behavior of the ferrofluid display material, and the redesigning of the circuit ultimately resulted in final testing of the displays and Arduino not happening until 2 April. In addition to the need to complete the Final Report and presentation by 4 April, the team had to prioritize and abandon the implementation of the LEDs.

ASSUMPTIONS

The team originally made several assumptions (listed below) that all proved to be true throughout the construction, testing, and assembly process. No issues arose in regards to these assumptions, which are listed below.