Wednesday, June 14, 2017

Final Project - Color Organ

For the final project of the ENGR 44 course, Tony Li and I decided to create a color organ. A color organ is a device that uses an AC circuit to emit different color light at different frequencies. When applied with music, the color organ would correspond to the bass, mids, and highs being played.

Intended Operation
The color organ was intended to use an audio signal to light up different color LEDs, in our case red (bass), green (mids), and blue (highs). Ideally, these LEDs would only play the sounds at these frequency, and not at others. That is, as soon as a frequency surpasses the bass frequency, the red LED would turn off and the green LED would turn on.

Criteria for Success
There were two major criteria for success in our project:
1.) The color organ must emit different colors of light at different sound frequencies.
2.) Low frequencies would correspond to red LEDs, mid-level frequencies would correspond to green LEDs, and high frequencies would correspond to blue frequencies.

Pert Chart

Planning Phase
We began researching schematics and techniques for building a color organ. We came across a circuit that used transistor based filters in order to control when certain LED's would light up. We should the schematic to the professor and gained approval. 

Development Phase
Once we gained approval, we proceeded to create the actual circuit. All original parts were bought on Tayda if they could not be found in the engineering classroom. Tony was the first to get his hands on any parts, and thus he used a breadboard to get an initial feel for the circuit. We simultaneously created the EveryCircuit for the schematic above 
Add caption

List of Initial Materials
  • 3x 100 ohm resistors
  • 1x 180 ohm resistors
  • 1x 270 ohm resistors
  • 2x 1k ohm resistors
  • 4x 2.2k ohm resistors
  • 2x 10k ohm resistors
  • 1x 0.047 uF capacitor
  • 1x 0.01 uF capacitor
  • 1x 0.47 uF capacitor
  • 1x 1 uF capacitor
  • 1x 10 uF capacitor
  • 1x 1N4148 diode
  • 1x 2N2222A, 2N3904 or equivalent NPN transistor
  • 3x 2N2907A, 2N3906 or equivalent PNP transistor
  • 9x LED (3x Red, 3x Green, 3x Blue)

Initially, we had trouble getting the circuit to correspond to an alternating frequency. The lights would simply remain on.
Tony then handed the circuit off to me, and I had a chance to mess with it and investigate why we were not observing a frequency response. After roughly two days of fiddling with the circuit and becoming frustrated, I decided to rebuild it all together. Again, the LEDs were not lighting up. Funny mistake, we forgot to consider the polarity of the LED lights, in which the short leg goes to ground. Upon realization of this, we corrected ourselves and had a working circuit. 
I decided to space out the parts more for this section.
Testing Phase
Once we had a working system, I decided to try to tweak some values in hopes of gaining better results. One of our biggest issues was finding the right values for resistance and capacitance in our filters in order to yield cut off frequencies that would shut off certain lights. At this point, the light would come on in the correct order but would not shutt off beyond their intended frequency. Although I was able to change the frequency needed to turn on the blue and green LEDs, I was unable to find how to get a cutoff frequency.

Final Phase
After successfully creating a working circuit, we decided it'd be in our best interest to solder the circuit to a solder board. This would ensure a more robust system that would be able to take the "fall test" which would be expected on presentation day. This was my first time soldering, and luckily I was able to get a functioning and working circuit. 

Once the board was completed, we decided to create an enclosure that would add to the robustness of the circuit. Using acrylic sheeting and a few screws, we were able to properly cover the front and back of the circuit. It is by no means a pretty sight, but granted we weren't able to laser cut to precision the acrylic sheets.

Once the circuit was finally complete, we tested it out and found that it worked properly. However, it should be noted that we were never able to find a cut-off frequency or how to implement one into our circuit. The lights would simply play simultaneously, but would only come on at their specific frequencies. 


Day 25 - Filters

Topics Discussed
On day 25 of the ENGR 44 course, we were introduced to filters and the different types of filters would could make in a circuit. Essentially, there are four types of filters one could create: High-Pass, Low-Pass, Band-Pass, and Band-Stop. (Fig. 1)
Fig. 1
Each type of filter has its own corresponding transfer function which can describe it. We did some practice finding bandwidth and the quality factor as well from the previous lecture. (Fig. 2)
Fig. 2
Passive RL Filter Lab
In lab, we created a passive RL filter. The circuit would act as either a low-pass or high-pass filter depending on whether or not the voltage is measured across the inductor or resistor. We calculated the specific cut-off frequency for this circuit. (Fig. 3)
Fig. 3
Once we found our cut-off frequency we proceed to actually build the circuit. (Fig. 4)
Fig. 4
We then proceed to analyze the voltage across the entire circuit and the voltage across the inductor and resitor at different frequencies. We tried frequencies ranging from 1/10 the cut-off frequency to 10 times the cut-off frequency. (Fig. 5)
Fig. 5
We then calculated the gain, phase shifts, and determined if the circuit behaved as intended. (Fig. 6)

Fig. 6
Summary
On the final day of lecture for the ENGR 44 class, we were able to successfully build a circuit that filter out high frequencies and low frequencies according to whether we were measuring across the inductor or capacitor. This premise is what allowed Tony and I to create a color organ for our final project, as the circuit intended to filter out different frequencies to play specific color lights for the bass, mids, and highs. The semester has been interesting, and the class has been a challenge and kind of rewarding in a sense. God bless America.

Day 24 - Bode Plots

Topics Discussed
Today in class we discussed Bode plots. Bode plots are essentially semi-log plots that utilize the decibel scale and phase shifts. They are a plot of a transfer function and frequency. From the general form, one can pull four factors: the gain K, a pole (jω)− or zero (jω) at the origin, a simple pole 1/(1 + jω/p ) or zero (1 + jω/z ), and a quadratic pole 1/*1 + j2ζ ω/ω + (jω/ω )+ or zero *1 + j2ζ 1 ω/ω + (jω/ω )].  We also discussed resonance, a condition in which a capacitor and inductor have the same reactance. This allows the load to have maximum power at a resonance frequency denoted as ω0. There is a half power frequency next to the resonance frequency on either side, and the distance between the two is known as bandwidth. The quality factor Q is then quantified as  ω0/B. This quality factor represents the how sharp the frequency response is. There was no lab today.

Day 23 - Frequency Dependence and Transfer Functions

Topics Discussed
On day 23 of the ENGR 44 course, we discussed frequency dependence and transfer functions. The transfer function H that we defined in class can be written in four different contexts: 1) Voltage Gain: Vout/Vin 2) Current Gain Iout/Iin 3)Transfer Impedance Vout/Iin 4) Transfer Admittance Iout/Vin. We also discussed the decibel scale. We did several practice problems utilizing these new ideas. (Fig 1 and Fig. 2)
Fig. 1
Fig. 2

Signals with Multiple Frequency Components Lab
In lab today, we made a circuit in which we would analyze the frequency response. We first did some calculations to develop an understanding of how the circuit would work. We also found the transfer function of the circuit. (Fig. 3) We followed the schematic in the lab manual and applied different resistors throughout to gain different results. (Fig. 4)
Fig. 3
Fig. 4
Summary
We were able to successfully create a circuit in which we could analyze the frequency response. We found that as input frequency increased, the gain decreased and vice-versa. By analyzing this circuit, we are able to apply the concepts learned today to future discussions.

Day 22 - Apparent Power and Power Factor

Topics Discussed
On day 22 of the ENGR 44 course, we were introduced to different forms of power and how we could calculate and make sense of these types of power. These types of power come about as a result of AC circuits. Using the methods of dc circuits for power in application with ac circuits ultimately just shows us the instantaneous power. There is complex and apparent power which are integrated into AC circuits, and they have their own methods of calculation which we discussed. In order to get these different types of power, we also had to have an understanding of RMS current and voltage. We did many practice problems with these methods (Fig. 1, Fig. 2, Fig. 3)
Fig. 1
Fig. 2
Fig. 3
Apparent Power and Power Factor Lab
In lab, we planned to analyze a circuit that utilized two resistors and an inductor and find the different types of power through it. We followed the schematic in the lab and created the circuit (Fig. 4)
Fig. 4
We were able to utilize the methods discussed in class to find the apparent and complex power, as well as the power factor of the created circuit. 

Summary
Upon completion of the lab and class meeting, we were able to find apparent and complex power, as well as the total power that can be experienced across different elements in a circuit. These types of power utilize values uncommon in previous class discussions. We were also able to find the power factor of the circuit which came about as part of the phase shift found from the circuit. 

Day 21 - Oscillator

Topics Discussed
On day 21 of the ENGR 44 course, we were introduced to op-amps that were integrated into AC circuits. We used impedance instead of resistance to find the gains in each circuit, but we utilized the same equations previously discussed for op-amps. We did a few practice problems that utilized the same methods as previously, only working now in the complex domain and using impedance. (Fig. 1)
Fig. 1
We were also introduced to oscillators, which essentially create an ac waveform in its output when supplied by a dc source. 
Op-Amp Relaxation Oscillator
Today in lab, we planned to investigate an op-amp oscillator, which would utilize a dc input and output an ac waveform. In order to do this, the Barkhausen criteria have to be met. That is, the overall gain of the oscillator must be unity or greater, therefore stating that losses must be compensated for by an amplifying device. Additionally, the overall phase shift from input to output must be zero.

Once we understood the workings of the oscillator, we proceeded to make the circuit according to the lab manual specifications. (Fig. 2)
Fig. 2
We then measured the output signal to see if we had an ac waveform. (Fig. 3) This wave showed that we were able to successfully create an op-amp oscillator.
Fig. 3
Summary
Today, we were able to successfully create an oscillator using an operational amplifier. Putting in a dc circuit, we were able to generate a waveform in the output. This alternating voltage came about due to the charging and discharging of the capacitor in the circuit, which essentially allowed the voltage to fluctuate and thus create the ac signal that we were reading. 

Day 20 - Sinusoids and Phasor Cont.

Topics Discussed
On day 20 of the ENGR 44 course, we further discussed sinusoids and phasors, integrating previous circuit analysis methods into these AC circuits.Interestingly, having an understanding of how to work in the complex domain of numbers makes these methods relatively simple. We focused on using nodal analysis, but also were introduced to mesh analysis as well. (Fig. 1)
Fig. 1
We did a few problems that focused on mesh analysis (Fig. 2). We did no lab since the lab for this day was the same as the previous.
Fig. 2
Summary
Although there was no lab to get actual hands-on learning, we were able to apply some old skills to new problems and thus develop a better understanding of how to analyze AC circuits.