Lab 2 Critical Design Review: Optical Theremin Michelle Donzé Michael Ladesic Jeffery Chen EE 300, Section 4 Blue Barracudas (#3) 1 Table of Contents I. Abstract ......................................................................................................................... 3 II. Introduction ................................................................................................................... 3 III. Value Statement ............................................................................................................. 3 IV. Theory ............................................................................................................................ 4 V. Implementation .............................................................................................................. 4 VI. Conclusion ...................................................................................................................... 4 VII. Appendices ............................................................................................................. 5 a) Gantt Chart ...........................................................................................................................5 b) Bill of Materials .....................................................................................................................5 c) Financial Costs .......................................................................................................................6 d) Reasoning Behind Using the TL074 Op-Amp ........................................................................6 e) Block Diagrams ......................................................................................................................6 Initial Block Diagram............................................................................................................................ 6 Final Block Diagram ............................................................................................................................. 7 f) How to Improve Design Performance .....................................................................................7 g) Light Detector Circuit ............................................................................................................8 Schematic .............................................................................................................................................. 8 Circuit Built on Bread Board ................................................................................................................ 8 h) DAQ Assistant Settings ...........................................................................................................8 DAQ Assistant In .................................................................................................................................. 8 DAQ Assistant Out ............................................................................................................................... 9 Simulate Signal ..................................................................................................................................... 9 Observations ......................................................................................................................................... 9 i) LabVIEW Analysis .................................................................................................................9 j) LabVIEW Block Diagram Schematics .................................................................................. 10 Main Block Diagram........................................................................................................................... 10 Auto Tune Block Diagram (Sub VI) ................................................................................................... 10 k) LabVIEW Front Panel Schematic........................................................................................ 11 2 I. Abstract This project is to create an Optical Theremin, which is a device that can play sound without physical contact. The Theremin will be constructed by the amount of light that reaches the photodiodes used in the circuit and will control the frequency and amplitude. The frequency and amplitude results will be displayed in a LabVIEW VI after running the frequency through an auto tuner to make the sound improved. II. Introduction In this project, the team is to create an optical Theremin using a photo sensing circuit and LabVIEW. A Theremin is a musical instrument that can be played without physical contact, this means pitch and volume are both controlled without actually touching the instrument. The design requirements call for the frequency and amplitude to be adjusted based on light intensity. Photodiodes are implemented in this design for their low cost and their simplicity in analysis. The light will be measured using photodiodes with the current to be analyzed using LabVIEW. After sufficient signal processing a sinusoidal audio tone will be outputted by the myDAQ. The user will be able to control pitch and volume by regulating the amount of light that reaches the photodiodes. The user will also be able to configure the intensity range seen by each sensor. Through a LabVIEW virtual circuit, the user will be able to control the maximum and minimum light intensity levels along with the range of frequencies that the Theremin will produce. The front panel is to display the normalized waveforms that control pitch and volume. It is also to display numeric indicators of light intensities as detected by both photodiodes. LabVIEW is used in the design for its simplicity and easy programmability; it provides multiple ways to implement a circuit without uses any physical parts. The second part of this lab calls for the implementation of an auto-tune feature to the existing optical Theremin design. This feature will tune the pitch to the nearest half tone. The auto-tune feature is to implemented using LabVIEW virtual circuitry with the functionality being able to be turned on or off by the user using the front panel. LabVIEW is being used to for this feature as it allows the designer to nearly seamlessly add to an existing design. III. Value Statement This project has value for our team by the process we used to get to the critical design review. We learned important lessons in teamwork and cooperation, as well as setting goals for the next week to accomplish. Learning how to work together and write a critical design review is an experience and skill we can take with us to our Capstone Project next semester and beyond. This assignment was one of the first projects we had in a group setting to design a product from beginning to end. Working with a team can be difficult, but we each found our strengths that we brought to the design process. 3 IV. Theory A design was created to satisfy the Optical Theremin project through a light sensing circuit, an amplifier/buffer, an intensity/time range control, and current to frequency converter. The light sensing circuit should be able to read in the light intensity and then output that to the LabVIEW VI. The LabVIEW VI will then read the signals (amplitude and frequency) and amplify them to be able to read at the output. Before the signals reach the output, the frequency will be put through an auto tuner to match it to the closest note to improve the sound. Finally, the signal will be heard with the varying amplitude and frequency that the light intensity captured by the photodiodes produce. V. Implementation The Optical Theremin design is broken down into many components designed to work separately as well as together. For this design, the bottom-up approach was used because it was known what subsystems were needed to create an overall functioning system. Light Sensing Circuit – VI. Photodiodes will be used to interpret user interaction through an op amp circuit. Users will change the intensity of the light delivered to the circuit. The photodiodes will then output a current proportional to the light intensity. Amplifier/Buffer – Since the output of the photodiode will be low level, it will be necessary to amplify the signal to a usable level. This will be accomplished with an op amp amplifier/buffer that will interface with a LabVIEW VI through the NI myDAQ. Intensity/Time Range Control – The user will be able to control the range of light intensities seen by each sensor and the tone range output from a LabVIEW front panel interface. Current to Frequency Converter – Because the photodiodes output a current of varying amplitude, it will be necessary to convert it into a frequency in order to output an audio signal. The converter will convert the current into a sine wave of varying frequency that can be outputted through the myDAQ TRS connector. Auto Tune – The auto tune rounds the frequency to the closet note after being amplified. This addition to the LabVIEW VI will improve the sound at the output. Conclusion The project of an Optical Theremin will meet the requirements of the assignment by having a functional light sensing circuit and a successful LabVIEW VI that reads the frequency and amplitude from the circuit. Using a combination of knowledge from previous electrical engineering classes, an op-amp circuit design was created with the photodiodes and then being able to use LabVIEW to amplify and auto tune the signal; a successful Optical Theremin was created. 4 VII. Appendices a) Gantt Chart Number 1 2 3 4 5 6 7 8 Task Design circuit Build circuit Initial LabVIEW Code Testing/Fixing Code and Interface Add Auto Tune to Code Create Bill of Materials Design Modifications Critical Design Review Document Start Date Sept. 18 Sept. 25 Sept. 25 Oct. 2 End State Sept. 25 Sept. 25 Oct. 2 Oct. 2 Duration 7 days 1 day 7 days 1 day Oct. 2 Oct. 9 Oct. 10 Oct. 10 Oct. 9 Oct. 9 Oct. 10 Oct. 15 7 days 1 day 1 day 5 days b) Bill of Materials 2 photo diodes: $1.00 TL074 Op Amp: $2.26 myDAQ Kit: $312.52 Breadboard: $40.00 Pack of ten 1 Mega-Ohm Resistors: $0.15 Total Cost of Materials: $355.93 **Cost of materials on the date of October 9, 2013. **Subject to change. Assumptions for what is provided: The student has access to an oscilloscope with the necessary cables to connect to the circuit, speakers, and a computer with LabVIEW installed or the capabilities to have LabVIEW installed (myDAQ kit comes with LabVIEW). 5 c) Financial Costs Cost of Labor: Hourly Number of Rate Employees $35/hour 3 Hourly Rate (all) $105/hour Hours Worked 16 Total Labor Cost $1680.00 Fringe (15% of Labor): $252.00 Overheard (40% of Labor + Fringe): $772.80 Grand Total Cost of Project: $3060.73 d) Reasoning Behind Using the TL074 Op-Amp The TL074 Op-Amp has low input bias and offset currents that are important because of the photodiode’s low output current. Even a small amount of offset current will negatively affect the signal. The high slew will allow user input to affect the output of the Theremin with little to no lag time. There is not another op-amp better for the application because this one is provided at no cost, which makes the performance/price ratio infinite. e) Block Diagrams Initial Block Diagram 6 Final Block Diagram Inputs Light intensity as controlled by the user User settings (frequency and amplitude limits) Output Amplified, auto tuned sound f) How to Improve Design Performance There are three ways we would like to alter our circuit design after testing and debugging. The first problem was the noise factor created by the power source. Adding a filter to remove the noise will help fix this problem. Another way to improve our design is to have more accurate resistors because the resistors we are using have a 5% tolerance. Having resistors with a 1% tolerance will make our circuit more precise. Finally, we can improve our design by having matched photodiodes. In our circuit the two photodiodes do not register the same light intensity because the sensitivity of photodiodes vary from one to the other. Therefore, having matched photodiodes, our circuit will perform better. 7 g) Light Detector Circuit Schematic Circuit Built on Bread Board h) DAQ Assistant Settings DAQ Assistant In Voltage_0: Max = 10 V Min = -10 V 8 Voltage_1: Acquisition Mode: N Samples Samples to Read: 2k Hz Rate: 80k Hz DAQ Assistant Out VoltageOut_0: Max = 10 V Min = -10 V Max = 2 V Min = -2 V Acquisition Mode: Continuous Samples Samples to Read: 20k Rate: 80k Hz Simulate Signal Samples per Second: 80k Hz Number of Samples: 20k Hz Observations The DAQ Assistant writer and reader had to be configured so that it produces a smooth audio signal. Without a proper configuration the outputted audio signal can potential sound choppy meaning a low quality signal. IN our attempts to avoid this we found that for the reader a high sampling rate with a low number of samples produced a smooth signal. For the writer configuration it was the sampling rate that needed to be adjusted as it was sampling continuously. i) LabVIEW Analysis Our original block diagram only accounted for the N=1 level of operation. Our breadboard implementation and LabVIEW code detail the N=2 subsystems and beyond while still conforming to the original block diagram. The original idea has only changed in the details in order to meet the specific project requirements. Our LabVIEW block diagram creates and outputs a sinusoidal voltage signal based on the input. To begin, the input signal is split into an average frequency and amplitude number. These two numbers are normalized to the light intensity limits specified in the front panel. Input Signal - Min Preset Normalized Signal = Max Preset - Min Preset The frequency is then scaled to the frequency limits specified in the front panel and passed through a switch that dictates the presence of auto-tuning. The result is combined with the amplitude to simulate a sine wave that is sent to the DAQ Assistant for output. 9 Our auto-tune sub-vi is named T-Pain in the diagram. The vi works by looking for the nearest musical note on the scale given and coercing the input to that note. This task is accomplished by comparing the input with every element in a variable array in the inner while loop. The array contains the base frequencies for notes and is multiplied by two, each iteration of the loop, in order to raise every note by an octave. j) LabVIEW Block Diagram Schematics Main Block Diagram Auto Tune Block Diagram (Sub VI) 10 k) LabVIEW Front Panel Schematic 11