https://classes.engineering.wustl.edu/ese205/core/api.php?action=feedcontributions&user=NishChakra&feedformat=atomESE205 Wiki - User contributions [en]2022-12-03T09:39:25ZUser contributionsMediaWiki 1.29.0https://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino&diff=15314Fast Fourier Transform Library & Arduino2018-12-10T19:58:27Z<p>NishChakra: /* Implementation on the Arduino */</p>
<hr />
<div>== Overview==<br />
===Introduction===<br />
As the name suggests the Fast Fourier Transform Library enables for the timely computation of a signal's discrete Fourier transform. Instructions on how to download the latest release can be found [https://github.com/kosme/arduinoFFT here]. A fast Fourier transform (fFt) would be of interest to any wishing to take a signal or data set from the time domain to the frequency domain. <br />
[[Category:HowTos]]<br />
[[Category:Programming]]<br />
[[Category:Arduino]]<br />
<br />
==Materials & Prerequisites==<br />
===Materials===<br />
All items one needs to utilize an FFT with an Arduino are:<br />
*Computer<br />
*Arduino<br />
*USB connector<br />
<br />
===Prerequisites===<br />
Next download latest open-source Arduino Software [https://www.arduino.cc/en/Main/Software here].<br />
<br />
==Process==<br />
First, let's begin with a discussion of a general Fourier Transform (FT) and then we will address the Fast Fourier Transform (FFT). The Fourier transform is a mathematical function that decomposes a waveform, which is a function of time, into the frequencies that make it up. The result produced by the Fourier transform is a complex valued function of frequency. The absolute value of the Fourier transform represents the frequency value present in the original function and its complex argument represents the phase offset of the basic sinusoidal in that frequency.<br />
<br />
The Fourier transform is also called a generalization of the Fourier series. This term can also be applied to both the frequency domain representation and the mathematical function used. The Fourier transform helps in extending the Fourier series to non-periodic functions, which allows viewing any function as a sum of simple sinusoids. The definition of which is provided below. Note that we use the discrete time definition of the FT, or a Discrete Fourier Transform (DFT), and not the continuous time definition, the main difference between the two being a summation vs an integral. We make this choice because inputs into computers are discrete data points and not continuous so we can not use an integral, and by extension, we can't use the continuous time definition of the FT. <br />
<br />
The decomposition of functions into their respective frequencies is a very powerful and useful tool, however, an FT requires massive amounts of computational work. For those of you in computer science, an FT would take O(n^2) time. So although we want to use this tool it is computationally expensive. Or at least this was the case until J.W Cooley and John Tukey came on the scene. They came up with the aptly named Cooley–Tukey FFT algorithm which reduced the time cost on a DFT from O(n^2) to O(nlogn). It recursively breaks down the DFT into smaller DFTs and turns the summation into a dynamic programming problem. So we save on time but we increase our space complexity dramatically, however, due to the continued improvement in transistor technology, modern day computing, for all practical purposes, doesn't care about space complexity until it has to. An example of a field that has to would be computational biology, due to the vast number of different genes in existence that all need to be tested. But that's beside the point, let's continue our discussion of an FFT. <br />
<br />
The actual algorithm begins by splitting the matrix into two parts, one with all the even indexed elements, the other part with all the odd indexed elements. We continue spliting the matrices down in the same manner until we can perform a DFT on a manageable matrix. Another way to implement the split, rather than by the even-odd index convention, would be through a reversing the bit value of the array entry's index. You make the choice only on the language you program in; so choose the option that takes up less time to implement for the language. <br />
<br />
Coding it will look like: <br />
<br />
<br />
function cooley_tukey(x)<br />
<br />
N = length(x)<br />
<br />
if (N > 2)<br />
x_odd = cooley_tukey(x[1:2:N])<br />
<br />
x_even = cooley_tukey(x[2:2:N])<br />
else<br />
x_odd = x[1]<br />
<br />
x_even = x[2]<br />
end<br />
n = 0:N-1<br />
<br />
half = div(N,2)<br />
<br />
factor = exp.(-2im*pi*n/N)<br />
<br />
return vcat(x_odd .+ x_even .* factor[1:half], x_odd .- x_even .* factor[1:half])<br />
<br />
end<br />
<br />
<br />
Below you can see some classic implementations in other languages, but as you can see the actual implementation is incredibly difficult. You can find an example of a custom FFT at the bottom. Typically one would not code an FFT from scratch unless you had a very specific purpose for it. Many libraries that deal with computational problems regarding any sort of waveform will have an FFT coded in the API that has been vetted by multiple software developers. <br />
<br />
<br />
To implement a general FFT in an Arduino here are the steps:<br />
<br />
1. Get your computer, Arduino, USB-B cable ready<br />
<br />
2. Download the Arduino coding terminal on your computer ([https://create.arduino.cc/ Web Editor Here])<br />
<br />
3. Run the C++ code given below<br />
<br />
<br />
To really see it in action:<br />
<br />
1. Find a digital waveform (an audio signal, voltage signal, anything digital that can be modeled with sinusoids really)<br />
<br />
2. Pass the waveform in as the parameter of the FFT<br />
<br />
3. Print the output<br />
<br />
To download and use Arduino's pre implemented arduino library see instructions in the link cited (Arduino FFT code) <br />
<br />
<br />
===Code Implementations of an FFT===<br />
<br />
'''Arduino C'''<br />
<br />
'#'include "arduinoFFT.h"<br />
<br />
'#'define SAMPLES 128 //Must be a power of 2<br />
<br />
'#'define SAMPLING_FREQUENCY 1000 //Hz, must be less than 10000 due to ADC<br />
<br />
arduinoFFT FFT = arduinoFFT();<br />
<br />
unsigned int sampling_period_us;<br />
unsigned long microseconds;<br />
<br />
double vReal[SAMPLES];<br />
double vImag[SAMPLES];<br />
<br />
void setup() {<br />
Serial.begin(115200);<br />
<br />
sampling_period_us = round(1000000*(1.0/SAMPLING_FREQUENCY));<br />
}<br />
<br />
void loop() {<br />
<br />
/*SAMPLING*/<br />
for(int i=0; i<SAMPLES; i++)<br />
{<br />
microseconds = micros(); //Overflows after around 70 minutes!<br />
<br />
vReal[i] = analogRead(0);<br />
vImag[i] = 0;<br />
<br />
while(micros() < (microseconds + sampling_period_us)){<br />
}<br />
}<br />
<br />
/*FFT*/<br />
FFT.Windowing(vReal, SAMPLES, FFT_WIN_TYP_HAMMING, FFT_FORWARD);<br />
FFT.Compute(vReal, vImag, SAMPLES, FFT_FORWARD);<br />
FFT.ComplexToMagnitude(vReal, vImag, SAMPLES);<br />
double peak = FFT.MajorPeak(vReal, SAMPLES, SAMPLING_FREQUENCY);<br />
<br />
/*PRINT RESULTS*/<br />
//Serial.println(peak); //Print out what frequency is the most dominant.<br />
<br />
for(int i=0; i<(SAMPLES/2); i++)<br />
{<br />
/*View all these three lines in serial terminal to see which frequencies has which amplitudes*/<br />
<br />
//Serial.print((i * 1.0 * SAMPLING_FREQUENCY) / SAMPLES, 1);<br />
//Serial.print(" ");<br />
Serial.println(vReal[i], 1); //View only this line in serial plotter to visualize the bins<br />
}<br />
<br />
//delay(1000); //Repeat the process every second OR:<br />
while(1); //Run code once<br />
}<br />
<br />
<br />
'''C++'''<br />
<br />
/* fft.cpp<br />
* <br />
* This is a KISS implementation of<br />
* the Cooley-Tukey recursive FFT algorithm.<br />
* This works, and is visibly clear about what is happening where.<br />
*<br />
* To compile this with the GNU/GCC compiler:<br />
* g++ -o fft fft.cpp -lm<br />
*<br />
* To run the compiled version from a *nix command line:<br />
* ./fft<br />
*<br />
*/<br />
#include <complex><br />
#include <cstdio><br />
<br />
#define M_PI 3.14159265358979323846 // Pi constant with double precision<br />
<br />
using namespace std;<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void separate (complex<double>* a, int n) {<br />
complex<double>* b = new complex<double>[n/2]; // get temp heap storage<br />
for(int i=0; i<n/2; i++) // copy all odd elements to heap storage<br />
b[i] = a[i*2+1];<br />
for(int i=0; i<n/2; i++) // copy all even elements to lower-half of a[]<br />
a[i] = a[i*2];<br />
for(int i=0; i<n/2; i++) // copy all odd (from heap) to upper-half of a[]<br />
a[i+n/2] = b[i];<br />
delete[] b; // delete heap storage<br />
}<br />
<br />
// N must be a power-of-2, or bad things will happen.<br />
// Currently no check for this condition.<br />
//<br />
// N input samples in X[] are FFT'd and results left in X[].<br />
// Because of Nyquist theorem, N samples means <br />
// only first N/2 FFT results in X[] are the answer.<br />
// (upper half of X[] is a reflection with no new information).<br />
void fft2 (complex<double>* X, int N) {<br />
if(N < 2) {<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
} else {<br />
separate(X,N); // all evens to lower half, all odds to upper half<br />
fft2(X, N/2); // recurse even items<br />
fft2(X+N/2, N/2); // recurse odd items<br />
// combine results of two half recursions<br />
for(int k=0; k<N/2; k++) {<br />
complex<double> e = X[k ]; // even<br />
complex<double> o = X[k+N/2]; // odd<br />
// w is the "twiddle-factor"<br />
complex<double> w = exp( complex<double>(0,-2.*M_PI*k/N) );<br />
X[k ] = e + w * o;<br />
X[k+N/2] = e - w * o;<br />
}<br />
}<br />
}<br />
<br />
// simple test program<br />
int main () {<br />
const int nSamples = 64;<br />
double nSeconds = 1.0; // total time for sampling<br />
double sampleRate = nSamples / nSeconds; // n Hz = n / second <br />
double freqResolution = sampleRate / nSamples; // freq step in FFT result<br />
complex<double> x[nSamples]; // storage for sample data<br />
complex<double> X[nSamples]; // storage for FFT answer<br />
const int nFreqs = 5;<br />
double freq[nFreqs] = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
<br />
// generate samples for testing<br />
for(int i=0; i<nSamples; i++) {<br />
x[i] = complex<double>(0.,0.);<br />
// sum several known sinusoids into x[]<br />
for(int j=0; j<nFreqs; j++)<br />
x[i] += sin( 2*M_PI*freq[j]*i/nSamples );<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
// compute fft for this data<br />
fft2(X,nSamples);<br />
<br />
printf(" n\tx[]\tX[]\tf\n"); // header line<br />
// loop to print values<br />
for(int i=0; i<nSamples; i++) {<br />
printf("% 3d\t%+.3f\t%+.3f\t%g\n",<br />
i, x[i].real(), abs(X[i]), i*freqResolution );<br />
}<br />
}<br />
<br />
===An Example===<br />
https://github.com/kosme/arduinoFFT/tree/master/Examples<br />
<br />
==Authors==<br />
*Jordan Gewirtz<br />
*Nish Chakraburtty<br />
*Chanel Lynn<br />
==Group Link==<br />
eBox project page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX here]<br />
<br />
eBox log page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log here]<br />
==External References==<br />
https://www.youtube.com/watch?v=spUNpyF58BY&t=21s (introduction to a fourier transform)<br />
<br />
https://www.algorithm-archive.org/contents/cooley_tukey/cooley_tukey.html (cooley tukey better explained)<br />
<br />
https://www.youtube.com/watch?v=XtypWS8HZco&t=22s (introduction to fast fourier transform)<br />
<br />
http://people.scs.carleton.ca/~maheshwa/courses/5703COMP/16Fall/FFT_Report.pdf (proof of cooley tukey) <br />
<br />
https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm (cooley tukey intro)<br />
<br />
https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT code)</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino&diff=15313Fast Fourier Transform Library & Arduino2018-12-10T19:57:54Z<p>NishChakra: /* Process */</p>
<hr />
<div>== Overview==<br />
===Introduction===<br />
As the name suggests the Fast Fourier Transform Library enables for the timely computation of a signal's discrete Fourier transform. Instructions on how to download the latest release can be found [https://github.com/kosme/arduinoFFT here]. A fast Fourier transform (fFt) would be of interest to any wishing to take a signal or data set from the time domain to the frequency domain. <br />
[[Category:HowTos]]<br />
[[Category:Programming]]<br />
[[Category:Arduino]]<br />
<br />
==Materials & Prerequisites==<br />
===Materials===<br />
All items one needs to utilize an FFT with an Arduino are:<br />
*Computer<br />
*Arduino<br />
*USB connector<br />
<br />
===Prerequisites===<br />
Next download latest open-source Arduino Software [https://www.arduino.cc/en/Main/Software here].<br />
<br />
==Process==<br />
First, let's begin with a discussion of a general Fourier Transform (FT) and then we will address the Fast Fourier Transform (FFT). The Fourier transform is a mathematical function that decomposes a waveform, which is a function of time, into the frequencies that make it up. The result produced by the Fourier transform is a complex valued function of frequency. The absolute value of the Fourier transform represents the frequency value present in the original function and its complex argument represents the phase offset of the basic sinusoidal in that frequency.<br />
<br />
The Fourier transform is also called a generalization of the Fourier series. This term can also be applied to both the frequency domain representation and the mathematical function used. The Fourier transform helps in extending the Fourier series to non-periodic functions, which allows viewing any function as a sum of simple sinusoids. The definition of which is provided below. Note that we use the discrete time definition of the FT, or a Discrete Fourier Transform (DFT), and not the continuous time definition, the main difference between the two being a summation vs an integral. We make this choice because inputs into computers are discrete data points and not continuous so we can not use an integral, and by extension, we can't use the continuous time definition of the FT. <br />
<br />
The decomposition of functions into their respective frequencies is a very powerful and useful tool, however, an FT requires massive amounts of computational work. For those of you in computer science, an FT would take O(n^2) time. So although we want to use this tool it is computationally expensive. Or at least this was the case until J.W Cooley and John Tukey came on the scene. They came up with the aptly named Cooley–Tukey FFT algorithm which reduced the time cost on a DFT from O(n^2) to O(nlogn). It recursively breaks down the DFT into smaller DFTs and turns the summation into a dynamic programming problem. So we save on time but we increase our space complexity dramatically, however, due to the continued improvement in transistor technology, modern day computing, for all practical purposes, doesn't care about space complexity until it has to. An example of a field that has to would be computational biology, due to the vast number of different genes in existence that all need to be tested. But that's beside the point, let's continue our discussion of an FFT. <br />
<br />
The actual algorithm begins by splitting the matrix into two parts, one with all the even indexed elements, the other part with all the odd indexed elements. We continue spliting the matrices down in the same manner until we can perform a DFT on a manageable matrix. Another way to implement the split, rather than by the even-odd index convention, would be through a reversing the bit value of the array entry's index. You make the choice only on the language you program in; so choose the option that takes up less time to implement for the language. <br />
<br />
Coding it will look like: <br />
<br />
<br />
function cooley_tukey(x)<br />
<br />
N = length(x)<br />
<br />
if (N > 2)<br />
x_odd = cooley_tukey(x[1:2:N])<br />
<br />
x_even = cooley_tukey(x[2:2:N])<br />
else<br />
x_odd = x[1]<br />
<br />
x_even = x[2]<br />
end<br />
n = 0:N-1<br />
<br />
half = div(N,2)<br />
<br />
factor = exp.(-2im*pi*n/N)<br />
<br />
return vcat(x_odd .+ x_even .* factor[1:half], x_odd .- x_even .* factor[1:half])<br />
<br />
end<br />
<br />
<br />
Below you can see some classic implementations in other languages, but as you can see the actual implementation is incredibly difficult. You can find an example of a custom FFT at the bottom. Typically one would not code an FFT from scratch unless you had a very specific purpose for it. Many libraries that deal with computational problems regarding any sort of waveform will have an FFT coded in the API that has been vetted by multiple software developers. <br />
<br />
<br />
To implement a general FFT in an Arduino here are the steps:<br />
<br />
1. Get your computer, Arduino, USB-B cable ready<br />
<br />
2. Download the Arduino coding terminal on your computer ([https://create.arduino.cc/ Web Editor Here])<br />
<br />
3. Run the C++ code given below<br />
<br />
<br />
To really see it in action:<br />
<br />
1. Find a digital waveform (an audio signal, voltage signal, anything digital that can be modeled with sinusoids really)<br />
<br />
2. Pass the waveform in as the parameter of the FFT<br />
<br />
3. Print the output<br />
<br />
To download and use Arduino's pre implemented arduino library see instructions in the link cited (Arduino FFT code) <br />
<br />
<br />
===Implementation on the Arduino===<br />
<br />
'''Arduino C'''<br />
<br />
'#'include "arduinoFFT.h"<br />
<br />
'#'define SAMPLES 128 //Must be a power of 2<br />
<br />
'#'define SAMPLING_FREQUENCY 1000 //Hz, must be less than 10000 due to ADC<br />
<br />
arduinoFFT FFT = arduinoFFT();<br />
<br />
unsigned int sampling_period_us;<br />
unsigned long microseconds;<br />
<br />
double vReal[SAMPLES];<br />
double vImag[SAMPLES];<br />
<br />
void setup() {<br />
Serial.begin(115200);<br />
<br />
sampling_period_us = round(1000000*(1.0/SAMPLING_FREQUENCY));<br />
}<br />
<br />
void loop() {<br />
<br />
/*SAMPLING*/<br />
for(int i=0; i<SAMPLES; i++)<br />
{<br />
microseconds = micros(); //Overflows after around 70 minutes!<br />
<br />
vReal[i] = analogRead(0);<br />
vImag[i] = 0;<br />
<br />
while(micros() < (microseconds + sampling_period_us)){<br />
}<br />
}<br />
<br />
/*FFT*/<br />
FFT.Windowing(vReal, SAMPLES, FFT_WIN_TYP_HAMMING, FFT_FORWARD);<br />
FFT.Compute(vReal, vImag, SAMPLES, FFT_FORWARD);<br />
FFT.ComplexToMagnitude(vReal, vImag, SAMPLES);<br />
double peak = FFT.MajorPeak(vReal, SAMPLES, SAMPLING_FREQUENCY);<br />
<br />
/*PRINT RESULTS*/<br />
//Serial.println(peak); //Print out what frequency is the most dominant.<br />
<br />
for(int i=0; i<(SAMPLES/2); i++)<br />
{<br />
/*View all these three lines in serial terminal to see which frequencies has which amplitudes*/<br />
<br />
//Serial.print((i * 1.0 * SAMPLING_FREQUENCY) / SAMPLES, 1);<br />
//Serial.print(" ");<br />
Serial.println(vReal[i], 1); //View only this line in serial plotter to visualize the bins<br />
}<br />
<br />
//delay(1000); //Repeat the process every second OR:<br />
while(1); //Run code once<br />
}<br />
<br />
<br />
'''C++'''<br />
<br />
/* fft.cpp<br />
* <br />
* This is a KISS implementation of<br />
* the Cooley-Tukey recursive FFT algorithm.<br />
* This works, and is visibly clear about what is happening where.<br />
*<br />
* To compile this with the GNU/GCC compiler:<br />
* g++ -o fft fft.cpp -lm<br />
*<br />
* To run the compiled version from a *nix command line:<br />
* ./fft<br />
*<br />
*/<br />
#include <complex><br />
#include <cstdio><br />
<br />
#define M_PI 3.14159265358979323846 // Pi constant with double precision<br />
<br />
using namespace std;<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void separate (complex<double>* a, int n) {<br />
complex<double>* b = new complex<double>[n/2]; // get temp heap storage<br />
for(int i=0; i<n/2; i++) // copy all odd elements to heap storage<br />
b[i] = a[i*2+1];<br />
for(int i=0; i<n/2; i++) // copy all even elements to lower-half of a[]<br />
a[i] = a[i*2];<br />
for(int i=0; i<n/2; i++) // copy all odd (from heap) to upper-half of a[]<br />
a[i+n/2] = b[i];<br />
delete[] b; // delete heap storage<br />
}<br />
<br />
// N must be a power-of-2, or bad things will happen.<br />
// Currently no check for this condition.<br />
//<br />
// N input samples in X[] are FFT'd and results left in X[].<br />
// Because of Nyquist theorem, N samples means <br />
// only first N/2 FFT results in X[] are the answer.<br />
// (upper half of X[] is a reflection with no new information).<br />
void fft2 (complex<double>* X, int N) {<br />
if(N < 2) {<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
} else {<br />
separate(X,N); // all evens to lower half, all odds to upper half<br />
fft2(X, N/2); // recurse even items<br />
fft2(X+N/2, N/2); // recurse odd items<br />
// combine results of two half recursions<br />
for(int k=0; k<N/2; k++) {<br />
complex<double> e = X[k ]; // even<br />
complex<double> o = X[k+N/2]; // odd<br />
// w is the "twiddle-factor"<br />
complex<double> w = exp( complex<double>(0,-2.*M_PI*k/N) );<br />
X[k ] = e + w * o;<br />
X[k+N/2] = e - w * o;<br />
}<br />
}<br />
}<br />
<br />
// simple test program<br />
int main () {<br />
const int nSamples = 64;<br />
double nSeconds = 1.0; // total time for sampling<br />
double sampleRate = nSamples / nSeconds; // n Hz = n / second <br />
double freqResolution = sampleRate / nSamples; // freq step in FFT result<br />
complex<double> x[nSamples]; // storage for sample data<br />
complex<double> X[nSamples]; // storage for FFT answer<br />
const int nFreqs = 5;<br />
double freq[nFreqs] = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
<br />
// generate samples for testing<br />
for(int i=0; i<nSamples; i++) {<br />
x[i] = complex<double>(0.,0.);<br />
// sum several known sinusoids into x[]<br />
for(int j=0; j<nFreqs; j++)<br />
x[i] += sin( 2*M_PI*freq[j]*i/nSamples );<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
// compute fft for this data<br />
fft2(X,nSamples);<br />
<br />
printf(" n\tx[]\tX[]\tf\n"); // header line<br />
// loop to print values<br />
for(int i=0; i<nSamples; i++) {<br />
printf("% 3d\t%+.3f\t%+.3f\t%g\n",<br />
i, x[i].real(), abs(X[i]), i*freqResolution );<br />
}<br />
}<br />
<br />
===An Example===<br />
https://github.com/kosme/arduinoFFT/tree/master/Examples<br />
<br />
==Authors==<br />
*Jordan Gewirtz<br />
*Nish Chakraburtty<br />
*Chanel Lynn<br />
==Group Link==<br />
eBox project page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX here]<br />
<br />
eBox log page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log here]<br />
==External References==<br />
https://www.youtube.com/watch?v=spUNpyF58BY&t=21s (introduction to a fourier transform)<br />
<br />
https://www.algorithm-archive.org/contents/cooley_tukey/cooley_tukey.html (cooley tukey better explained)<br />
<br />
https://www.youtube.com/watch?v=XtypWS8HZco&t=22s (introduction to fast fourier transform)<br />
<br />
http://people.scs.carleton.ca/~maheshwa/courses/5703COMP/16Fall/FFT_Report.pdf (proof of cooley tukey) <br />
<br />
https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm (cooley tukey intro)<br />
<br />
https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT code)</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino&diff=15311Fast Fourier Transform Library & Arduino2018-12-10T19:57:29Z<p>NishChakra: /* Process */</p>
<hr />
<div>== Overview==<br />
===Introduction===<br />
As the name suggests the Fast Fourier Transform Library enables for the timely computation of a signal's discrete Fourier transform. Instructions on how to download the latest release can be found [https://github.com/kosme/arduinoFFT here]. A fast Fourier transform (fFt) would be of interest to any wishing to take a signal or data set from the time domain to the frequency domain. <br />
[[Category:HowTos]]<br />
[[Category:Programming]]<br />
[[Category:Arduino]]<br />
<br />
==Materials & Prerequisites==<br />
===Materials===<br />
All items one needs to utilize an FFT with an Arduino are:<br />
*Computer<br />
*Arduino<br />
*USB connector<br />
<br />
===Prerequisites===<br />
Next download latest open-source Arduino Software [https://www.arduino.cc/en/Main/Software here].<br />
<br />
==Process==<br />
First, let's begin with a discussion of a general Fourier Transform (FT) and then we will address the Fast Fourier Transform (FFT). The Fourier transform is a mathematical function that decomposes a waveform, which is a function of time, into the frequencies that make it up. The result produced by the Fourier transform is a complex valued function of frequency. The absolute value of the Fourier transform represents the frequency value present in the original function and its complex argument represents the phase offset of the basic sinusoidal in that frequency.<br />
<br />
The Fourier transform is also called a generalization of the Fourier series. This term can also be applied to both the frequency domain representation and the mathematical function used. The Fourier transform helps in extending the Fourier series to non-periodic functions, which allows viewing any function as a sum of simple sinusoids. The definition of which is provided below. Note that we use the discrete time definition of the FT, or a Discrete Fourier Transform (DFT), and not the continuous time definition, the main difference between the two being a summation vs an integral. We make this choice because inputs into computers are discrete data points and not continuous so we can not use an integral, and by extension, we can't use the continuous time definition of the FT. <br />
<br />
The decomposition of functions into their respective frequencies is a very powerful and useful tool, however, an FT requires massive amounts of computational work. For those of you in computer science, an FT would take O(n^2) time. So although we want to use this tool it is computationally expensive. Or at least this was the case until J.W Cooley and John Tukey came on the scene. They came up with the aptly named Cooley–Tukey FFT algorithm which reduced the time cost on a DFT from O(n^2) to O(nlogn). It recursively breaks down the DFT into smaller DFTs and turns the summation into a dynamic programming problem. So we save on time but we increase our space complexity dramatically, however, due to the continued improvement in transistor technology, modern day computing, for all practical purposes, doesn't care about space complexity until it has to. An example of a field that has to would be computational biology, due to the vast number of different genes in existence that all need to be tested. But that's beside the point, let's continue our discussion of an FFT. <br />
<br />
The actual algorithm begins by splitting the matrix into two parts, one with all the even indexed elements, the other part with all the odd indexed elements. We continue spliting the matrices down in the same manner until we can perform a DFT on a manageable matrix. Another way to implement the split, rather than by the even-odd index convention, would be through a reversing the bit value of the array entry's index. You make the choice only on the language you program in; so choose the option that takes up less time to implement for the language. <br />
<br />
Coding it will look like: <br />
<br />
<br />
function cooley_tukey(x)<br />
<br />
N = length(x)<br />
<br />
if (N > 2)<br />
x_odd = cooley_tukey(x[1:2:N])<br />
<br />
x_even = cooley_tukey(x[2:2:N])<br />
else<br />
x_odd = x[1]<br />
<br />
x_even = x[2]<br />
end<br />
n = 0:N-1<br />
<br />
half = div(N,2)<br />
<br />
factor = exp.(-2im*pi*n/N)<br />
<br />
return vcat(x_odd .+ x_even .* factor[1:half], x_odd .- x_even .* factor[1:half])<br />
<br />
end<br />
<br />
<br />
Below you can see some classic implementations in other languages, but as you can see the actual implementation is incredibly difficult. You can find an example of a custom FFT at the bottom. Typically one would not code an FFT from scratch unless you had a very specific purpose for it. Many libraries that deal with computational problems regarding any sort of waveform will have an FFT coded in the API that has been vetted by multiple software developers. <br />
<br />
<br />
To implement a general FFT in an Arduino here are the steps:<br />
<br />
1. Get your computer, Arduino, USB-B cable ready<br />
<br />
2. Download the Arduino coding terminal on your computer ([https://create.arduino.cc/ Web Editor Here])<br />
<br />
3. Run the C++ code given below<br />
<br />
<br />
To really see it in action:<br />
<br />
1. Find a digital waveform (an audio signal, voltage signal, anything digital that can be modeled with sinusoids really)<br />
<br />
2. Pass the waveform in as the parameter of the FFT<br />
<br />
3. Print the output<br />
<br />
To download and use Arduino's pre implemented arduino library see instructions in the link cited (FFT code) <br />
<br />
<br />
===Implementation on the Arduino===<br />
<br />
'''Arduino C'''<br />
<br />
'#'include "arduinoFFT.h"<br />
<br />
'#'define SAMPLES 128 //Must be a power of 2<br />
<br />
'#'define SAMPLING_FREQUENCY 1000 //Hz, must be less than 10000 due to ADC<br />
<br />
arduinoFFT FFT = arduinoFFT();<br />
<br />
unsigned int sampling_period_us;<br />
unsigned long microseconds;<br />
<br />
double vReal[SAMPLES];<br />
double vImag[SAMPLES];<br />
<br />
void setup() {<br />
Serial.begin(115200);<br />
<br />
sampling_period_us = round(1000000*(1.0/SAMPLING_FREQUENCY));<br />
}<br />
<br />
void loop() {<br />
<br />
/*SAMPLING*/<br />
for(int i=0; i<SAMPLES; i++)<br />
{<br />
microseconds = micros(); //Overflows after around 70 minutes!<br />
<br />
vReal[i] = analogRead(0);<br />
vImag[i] = 0;<br />
<br />
while(micros() < (microseconds + sampling_period_us)){<br />
}<br />
}<br />
<br />
/*FFT*/<br />
FFT.Windowing(vReal, SAMPLES, FFT_WIN_TYP_HAMMING, FFT_FORWARD);<br />
FFT.Compute(vReal, vImag, SAMPLES, FFT_FORWARD);<br />
FFT.ComplexToMagnitude(vReal, vImag, SAMPLES);<br />
double peak = FFT.MajorPeak(vReal, SAMPLES, SAMPLING_FREQUENCY);<br />
<br />
/*PRINT RESULTS*/<br />
//Serial.println(peak); //Print out what frequency is the most dominant.<br />
<br />
for(int i=0; i<(SAMPLES/2); i++)<br />
{<br />
/*View all these three lines in serial terminal to see which frequencies has which amplitudes*/<br />
<br />
//Serial.print((i * 1.0 * SAMPLING_FREQUENCY) / SAMPLES, 1);<br />
//Serial.print(" ");<br />
Serial.println(vReal[i], 1); //View only this line in serial plotter to visualize the bins<br />
}<br />
<br />
//delay(1000); //Repeat the process every second OR:<br />
while(1); //Run code once<br />
}<br />
<br />
<br />
'''C++'''<br />
<br />
/* fft.cpp<br />
* <br />
* This is a KISS implementation of<br />
* the Cooley-Tukey recursive FFT algorithm.<br />
* This works, and is visibly clear about what is happening where.<br />
*<br />
* To compile this with the GNU/GCC compiler:<br />
* g++ -o fft fft.cpp -lm<br />
*<br />
* To run the compiled version from a *nix command line:<br />
* ./fft<br />
*<br />
*/<br />
#include <complex><br />
#include <cstdio><br />
<br />
#define M_PI 3.14159265358979323846 // Pi constant with double precision<br />
<br />
using namespace std;<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void separate (complex<double>* a, int n) {<br />
complex<double>* b = new complex<double>[n/2]; // get temp heap storage<br />
for(int i=0; i<n/2; i++) // copy all odd elements to heap storage<br />
b[i] = a[i*2+1];<br />
for(int i=0; i<n/2; i++) // copy all even elements to lower-half of a[]<br />
a[i] = a[i*2];<br />
for(int i=0; i<n/2; i++) // copy all odd (from heap) to upper-half of a[]<br />
a[i+n/2] = b[i];<br />
delete[] b; // delete heap storage<br />
}<br />
<br />
// N must be a power-of-2, or bad things will happen.<br />
// Currently no check for this condition.<br />
//<br />
// N input samples in X[] are FFT'd and results left in X[].<br />
// Because of Nyquist theorem, N samples means <br />
// only first N/2 FFT results in X[] are the answer.<br />
// (upper half of X[] is a reflection with no new information).<br />
void fft2 (complex<double>* X, int N) {<br />
if(N < 2) {<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
} else {<br />
separate(X,N); // all evens to lower half, all odds to upper half<br />
fft2(X, N/2); // recurse even items<br />
fft2(X+N/2, N/2); // recurse odd items<br />
// combine results of two half recursions<br />
for(int k=0; k<N/2; k++) {<br />
complex<double> e = X[k ]; // even<br />
complex<double> o = X[k+N/2]; // odd<br />
// w is the "twiddle-factor"<br />
complex<double> w = exp( complex<double>(0,-2.*M_PI*k/N) );<br />
X[k ] = e + w * o;<br />
X[k+N/2] = e - w * o;<br />
}<br />
}<br />
}<br />
<br />
// simple test program<br />
int main () {<br />
const int nSamples = 64;<br />
double nSeconds = 1.0; // total time for sampling<br />
double sampleRate = nSamples / nSeconds; // n Hz = n / second <br />
double freqResolution = sampleRate / nSamples; // freq step in FFT result<br />
complex<double> x[nSamples]; // storage for sample data<br />
complex<double> X[nSamples]; // storage for FFT answer<br />
const int nFreqs = 5;<br />
double freq[nFreqs] = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
<br />
// generate samples for testing<br />
for(int i=0; i<nSamples; i++) {<br />
x[i] = complex<double>(0.,0.);<br />
// sum several known sinusoids into x[]<br />
for(int j=0; j<nFreqs; j++)<br />
x[i] += sin( 2*M_PI*freq[j]*i/nSamples );<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
// compute fft for this data<br />
fft2(X,nSamples);<br />
<br />
printf(" n\tx[]\tX[]\tf\n"); // header line<br />
// loop to print values<br />
for(int i=0; i<nSamples; i++) {<br />
printf("% 3d\t%+.3f\t%+.3f\t%g\n",<br />
i, x[i].real(), abs(X[i]), i*freqResolution );<br />
}<br />
}<br />
<br />
===An Example===<br />
https://github.com/kosme/arduinoFFT/tree/master/Examples<br />
<br />
==Authors==<br />
*Jordan Gewirtz<br />
*Nish Chakraburtty<br />
*Chanel Lynn<br />
==Group Link==<br />
eBox project page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX here]<br />
<br />
eBox log page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log here]<br />
==External References==<br />
https://www.youtube.com/watch?v=spUNpyF58BY&t=21s (introduction to a fourier transform)<br />
<br />
https://www.algorithm-archive.org/contents/cooley_tukey/cooley_tukey.html (cooley tukey better explained)<br />
<br />
https://www.youtube.com/watch?v=XtypWS8HZco&t=22s (introduction to fast fourier transform)<br />
<br />
http://people.scs.carleton.ca/~maheshwa/courses/5703COMP/16Fall/FFT_Report.pdf (proof of cooley tukey) <br />
<br />
https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm (cooley tukey intro)<br />
<br />
https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT code)</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino&diff=15308Fast Fourier Transform Library & Arduino2018-12-10T19:54:54Z<p>NishChakra: /* External References */</p>
<hr />
<div>== Overview==<br />
===Introduction===<br />
As the name suggests the Fast Fourier Transform Library enables for the timely computation of a signal's discrete Fourier transform. Instructions on how to download the latest release can be found [https://github.com/kosme/arduinoFFT here]. A fast Fourier transform (fFt) would be of interest to any wishing to take a signal or data set from the time domain to the frequency domain. <br />
[[Category:HowTos]]<br />
[[Category:Programming]]<br />
[[Category:Arduino]]<br />
<br />
==Materials & Prerequisites==<br />
===Materials===<br />
All items one needs to utilize an FFT with an Arduino are:<br />
*Computer<br />
*Arduino<br />
*USB connector<br />
<br />
===Prerequisites===<br />
Next download latest open-source Arduino Software [https://www.arduino.cc/en/Main/Software here].<br />
<br />
==Process==<br />
First, let's begin with a discussion of a general Fourier Transform (FT) and then we will address the Fast Fourier Transform (FFT). The Fourier transform is a mathematical function that decomposes a waveform, which is a function of time, into the frequencies that make it up. The result produced by the Fourier transform is a complex valued function of frequency. The absolute value of the Fourier transform represents the frequency value present in the original function and its complex argument represents the phase offset of the basic sinusoidal in that frequency.<br />
<br />
The Fourier transform is also called a generalization of the Fourier series. This term can also be applied to both the frequency domain representation and the mathematical function used. The Fourier transform helps in extending the Fourier series to non-periodic functions, which allows viewing any function as a sum of simple sinusoids. The definition of which is provided below. Note that we use the discrete time definition of the FT, or a Discrete Fourier Transform (DFT), and not the continuous time definition, the main difference between the two being a summation vs an integral. We make this choice because inputs into computers are discrete data points and not continuous so we can not use an integral, and by extension, we can't use the continuous time definition of the FT. <br />
<br />
The decomposition of functions into their respective frequencies is a very powerful and useful tool, however, an FT requires massive amounts of computational work. For those of you in computer science, an FT would take O(n^2) time. So although we want to use this tool it is computationally expensive. Or at least this was the case until J.W Cooley and John Tukey came on the scene. They came up with the aptly named Cooley–Tukey FFT algorithm which reduced the time cost on a DFT from O(n^2) to O(nlogn). It recursively breaks down the DFT into smaller DFTs and turns the summation into a dynamic programming problem. So we save on time but we increase our space complexity dramatically, however, due to the continued improvement in transistor technology, modern day computing, for all practical purposes, doesn't care about space complexity until it has to. An example of a field that has to would be computational biology, due to the vast number of different genes in existence that all need to be tested. But that's beside the point, let's continue our discussion of an FFT. <br />
<br />
The actual algorithm begins by splitting the matrix into two parts, one with all the even indexed elements, the other part with all the odd indexed elements. We continue spliting the matrices down in the same manner until we can perform a DFT on a manageable matrix. Another way to implement the split, rather than by the even-odd index convention, would be through a reversing the bit value of the array entry's index. You make the choice only on the language you program in; so choose the option that takes up less time to implement for the language. <br />
<br />
Coding it will look like: <br />
<br />
<br />
function cooley_tukey(x)<br />
<br />
N = length(x)<br />
<br />
if (N > 2)<br />
x_odd = cooley_tukey(x[1:2:N])<br />
<br />
x_even = cooley_tukey(x[2:2:N])<br />
else<br />
x_odd = x[1]<br />
<br />
x_even = x[2]<br />
end<br />
n = 0:N-1<br />
<br />
half = div(N,2)<br />
<br />
factor = exp.(-2im*pi*n/N)<br />
<br />
return vcat(x_odd .+ x_even .* factor[1:half], x_odd .- x_even .* factor[1:half])<br />
<br />
end<br />
<br />
<br />
Below you can see some classic implementations in other languages, but as you can see the actual implementation is incredibly difficult. You can find an example of a custom FFT at the bottom. Typically one would not code an FFT from scratch unless you had a very specific purpose for it. Many libraries that deal with computational problems regarding any sort of waveform will have an FFT coded in the API that has been vetted by multiple software developers. <br />
<br />
<br />
To implement a general FFT in an Arduino here are the steps:<br />
<br />
1. Get your computer, Arduino, USB-B cable ready<br />
<br />
2. Download the Arduino coding terminal on your computer ([https://create.arduino.cc/ Web Editor Here])<br />
<br />
3. Run the C++ code given below<br />
<br />
<br />
To really see it in action:<br />
<br />
1. Find a digital waveform (an audio signal, voltage signal, anything digital that can be modeled with sinusoids really)<br />
<br />
2. Pass the waveform in as the parameter of the FFT<br />
<br />
3. Print the output<br />
<br />
<br />
===Implementation on the Arduino===<br />
<br />
'''Arduino C'''<br />
<br />
'#'include "arduinoFFT.h"<br />
<br />
'#'define SAMPLES 128 //Must be a power of 2<br />
<br />
'#'define SAMPLING_FREQUENCY 1000 //Hz, must be less than 10000 due to ADC<br />
<br />
arduinoFFT FFT = arduinoFFT();<br />
<br />
unsigned int sampling_period_us;<br />
unsigned long microseconds;<br />
<br />
double vReal[SAMPLES];<br />
double vImag[SAMPLES];<br />
<br />
void setup() {<br />
Serial.begin(115200);<br />
<br />
sampling_period_us = round(1000000*(1.0/SAMPLING_FREQUENCY));<br />
}<br />
<br />
void loop() {<br />
<br />
/*SAMPLING*/<br />
for(int i=0; i<SAMPLES; i++)<br />
{<br />
microseconds = micros(); //Overflows after around 70 minutes!<br />
<br />
vReal[i] = analogRead(0);<br />
vImag[i] = 0;<br />
<br />
while(micros() < (microseconds + sampling_period_us)){<br />
}<br />
}<br />
<br />
/*FFT*/<br />
FFT.Windowing(vReal, SAMPLES, FFT_WIN_TYP_HAMMING, FFT_FORWARD);<br />
FFT.Compute(vReal, vImag, SAMPLES, FFT_FORWARD);<br />
FFT.ComplexToMagnitude(vReal, vImag, SAMPLES);<br />
double peak = FFT.MajorPeak(vReal, SAMPLES, SAMPLING_FREQUENCY);<br />
<br />
/*PRINT RESULTS*/<br />
//Serial.println(peak); //Print out what frequency is the most dominant.<br />
<br />
for(int i=0; i<(SAMPLES/2); i++)<br />
{<br />
/*View all these three lines in serial terminal to see which frequencies has which amplitudes*/<br />
<br />
//Serial.print((i * 1.0 * SAMPLING_FREQUENCY) / SAMPLES, 1);<br />
//Serial.print(" ");<br />
Serial.println(vReal[i], 1); //View only this line in serial plotter to visualize the bins<br />
}<br />
<br />
//delay(1000); //Repeat the process every second OR:<br />
while(1); //Run code once<br />
}<br />
<br />
<br />
'''C++'''<br />
<br />
/* fft.cpp<br />
* <br />
* This is a KISS implementation of<br />
* the Cooley-Tukey recursive FFT algorithm.<br />
* This works, and is visibly clear about what is happening where.<br />
*<br />
* To compile this with the GNU/GCC compiler:<br />
* g++ -o fft fft.cpp -lm<br />
*<br />
* To run the compiled version from a *nix command line:<br />
* ./fft<br />
*<br />
*/<br />
#include <complex><br />
#include <cstdio><br />
<br />
#define M_PI 3.14159265358979323846 // Pi constant with double precision<br />
<br />
using namespace std;<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void separate (complex<double>* a, int n) {<br />
complex<double>* b = new complex<double>[n/2]; // get temp heap storage<br />
for(int i=0; i<n/2; i++) // copy all odd elements to heap storage<br />
b[i] = a[i*2+1];<br />
for(int i=0; i<n/2; i++) // copy all even elements to lower-half of a[]<br />
a[i] = a[i*2];<br />
for(int i=0; i<n/2; i++) // copy all odd (from heap) to upper-half of a[]<br />
a[i+n/2] = b[i];<br />
delete[] b; // delete heap storage<br />
}<br />
<br />
// N must be a power-of-2, or bad things will happen.<br />
// Currently no check for this condition.<br />
//<br />
// N input samples in X[] are FFT'd and results left in X[].<br />
// Because of Nyquist theorem, N samples means <br />
// only first N/2 FFT results in X[] are the answer.<br />
// (upper half of X[] is a reflection with no new information).<br />
void fft2 (complex<double>* X, int N) {<br />
if(N < 2) {<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
} else {<br />
separate(X,N); // all evens to lower half, all odds to upper half<br />
fft2(X, N/2); // recurse even items<br />
fft2(X+N/2, N/2); // recurse odd items<br />
// combine results of two half recursions<br />
for(int k=0; k<N/2; k++) {<br />
complex<double> e = X[k ]; // even<br />
complex<double> o = X[k+N/2]; // odd<br />
// w is the "twiddle-factor"<br />
complex<double> w = exp( complex<double>(0,-2.*M_PI*k/N) );<br />
X[k ] = e + w * o;<br />
X[k+N/2] = e - w * o;<br />
}<br />
}<br />
}<br />
<br />
// simple test program<br />
int main () {<br />
const int nSamples = 64;<br />
double nSeconds = 1.0; // total time for sampling<br />
double sampleRate = nSamples / nSeconds; // n Hz = n / second <br />
double freqResolution = sampleRate / nSamples; // freq step in FFT result<br />
complex<double> x[nSamples]; // storage for sample data<br />
complex<double> X[nSamples]; // storage for FFT answer<br />
const int nFreqs = 5;<br />
double freq[nFreqs] = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
<br />
// generate samples for testing<br />
for(int i=0; i<nSamples; i++) {<br />
x[i] = complex<double>(0.,0.);<br />
// sum several known sinusoids into x[]<br />
for(int j=0; j<nFreqs; j++)<br />
x[i] += sin( 2*M_PI*freq[j]*i/nSamples );<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
// compute fft for this data<br />
fft2(X,nSamples);<br />
<br />
printf(" n\tx[]\tX[]\tf\n"); // header line<br />
// loop to print values<br />
for(int i=0; i<nSamples; i++) {<br />
printf("% 3d\t%+.3f\t%+.3f\t%g\n",<br />
i, x[i].real(), abs(X[i]), i*freqResolution );<br />
}<br />
}<br />
<br />
===An Example===<br />
https://github.com/kosme/arduinoFFT/tree/master/Examples<br />
<br />
==Authors==<br />
*Jordan Gewirtz<br />
*Nish Chakraburtty<br />
*Chanel Lynn<br />
==Group Link==<br />
eBox project page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX here]<br />
<br />
eBox log page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log here]<br />
==External References==<br />
https://www.youtube.com/watch?v=spUNpyF58BY&t=21s (introduction to a fourier transform)<br />
<br />
https://www.algorithm-archive.org/contents/cooley_tukey/cooley_tukey.html (cooley tukey better explained)<br />
<br />
https://www.youtube.com/watch?v=XtypWS8HZco&t=22s (introduction to fast fourier transform)<br />
<br />
http://people.scs.carleton.ca/~maheshwa/courses/5703COMP/16Fall/FFT_Report.pdf (proof of cooley tukey) <br />
<br />
https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm (cooley tukey intro)<br />
<br />
https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT code)</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino&diff=15307Fast Fourier Transform Library & Arduino2018-12-10T19:54:19Z<p>NishChakra: /* External References */</p>
<hr />
<div>== Overview==<br />
===Introduction===<br />
As the name suggests the Fast Fourier Transform Library enables for the timely computation of a signal's discrete Fourier transform. Instructions on how to download the latest release can be found [https://github.com/kosme/arduinoFFT here]. A fast Fourier transform (fFt) would be of interest to any wishing to take a signal or data set from the time domain to the frequency domain. <br />
[[Category:HowTos]]<br />
[[Category:Programming]]<br />
[[Category:Arduino]]<br />
<br />
==Materials & Prerequisites==<br />
===Materials===<br />
All items one needs to utilize an FFT with an Arduino are:<br />
*Computer<br />
*Arduino<br />
*USB connector<br />
<br />
===Prerequisites===<br />
Next download latest open-source Arduino Software [https://www.arduino.cc/en/Main/Software here].<br />
<br />
==Process==<br />
First, let's begin with a discussion of a general Fourier Transform (FT) and then we will address the Fast Fourier Transform (FFT). The Fourier transform is a mathematical function that decomposes a waveform, which is a function of time, into the frequencies that make it up. The result produced by the Fourier transform is a complex valued function of frequency. The absolute value of the Fourier transform represents the frequency value present in the original function and its complex argument represents the phase offset of the basic sinusoidal in that frequency.<br />
<br />
The Fourier transform is also called a generalization of the Fourier series. This term can also be applied to both the frequency domain representation and the mathematical function used. The Fourier transform helps in extending the Fourier series to non-periodic functions, which allows viewing any function as a sum of simple sinusoids. The definition of which is provided below. Note that we use the discrete time definition of the FT, or a Discrete Fourier Transform (DFT), and not the continuous time definition, the main difference between the two being a summation vs an integral. We make this choice because inputs into computers are discrete data points and not continuous so we can not use an integral, and by extension, we can't use the continuous time definition of the FT. <br />
<br />
The decomposition of functions into their respective frequencies is a very powerful and useful tool, however, an FT requires massive amounts of computational work. For those of you in computer science, an FT would take O(n^2) time. So although we want to use this tool it is computationally expensive. Or at least this was the case until J.W Cooley and John Tukey came on the scene. They came up with the aptly named Cooley–Tukey FFT algorithm which reduced the time cost on a DFT from O(n^2) to O(nlogn). It recursively breaks down the DFT into smaller DFTs and turns the summation into a dynamic programming problem. So we save on time but we increase our space complexity dramatically, however, due to the continued improvement in transistor technology, modern day computing, for all practical purposes, doesn't care about space complexity until it has to. An example of a field that has to would be computational biology, due to the vast number of different genes in existence that all need to be tested. But that's beside the point, let's continue our discussion of an FFT. <br />
<br />
The actual algorithm begins by splitting the matrix into two parts, one with all the even indexed elements, the other part with all the odd indexed elements. We continue spliting the matrices down in the same manner until we can perform a DFT on a manageable matrix. Another way to implement the split, rather than by the even-odd index convention, would be through a reversing the bit value of the array entry's index. You make the choice only on the language you program in; so choose the option that takes up less time to implement for the language. <br />
<br />
Coding it will look like: <br />
<br />
<br />
function cooley_tukey(x)<br />
<br />
N = length(x)<br />
<br />
if (N > 2)<br />
x_odd = cooley_tukey(x[1:2:N])<br />
<br />
x_even = cooley_tukey(x[2:2:N])<br />
else<br />
x_odd = x[1]<br />
<br />
x_even = x[2]<br />
end<br />
n = 0:N-1<br />
<br />
half = div(N,2)<br />
<br />
factor = exp.(-2im*pi*n/N)<br />
<br />
return vcat(x_odd .+ x_even .* factor[1:half], x_odd .- x_even .* factor[1:half])<br />
<br />
end<br />
<br />
<br />
Below you can see some classic implementations in other languages, but as you can see the actual implementation is incredibly difficult. You can find an example of a custom FFT at the bottom. Typically one would not code an FFT from scratch unless you had a very specific purpose for it. Many libraries that deal with computational problems regarding any sort of waveform will have an FFT coded in the API that has been vetted by multiple software developers. <br />
<br />
<br />
To implement a general FFT in an Arduino here are the steps:<br />
<br />
1. Get your computer, Arduino, USB-B cable ready<br />
<br />
2. Download the Arduino coding terminal on your computer ([https://create.arduino.cc/ Web Editor Here])<br />
<br />
3. Run the C++ code given below<br />
<br />
<br />
To really see it in action:<br />
<br />
1. Find a digital waveform (an audio signal, voltage signal, anything digital that can be modeled with sinusoids really)<br />
<br />
2. Pass the waveform in as the parameter of the FFT<br />
<br />
3. Print the output<br />
<br />
<br />
===Implementation on the Arduino===<br />
<br />
'''Arduino C'''<br />
<br />
'#'include "arduinoFFT.h"<br />
<br />
'#'define SAMPLES 128 //Must be a power of 2<br />
<br />
'#'define SAMPLING_FREQUENCY 1000 //Hz, must be less than 10000 due to ADC<br />
<br />
arduinoFFT FFT = arduinoFFT();<br />
<br />
unsigned int sampling_period_us;<br />
unsigned long microseconds;<br />
<br />
double vReal[SAMPLES];<br />
double vImag[SAMPLES];<br />
<br />
void setup() {<br />
Serial.begin(115200);<br />
<br />
sampling_period_us = round(1000000*(1.0/SAMPLING_FREQUENCY));<br />
}<br />
<br />
void loop() {<br />
<br />
/*SAMPLING*/<br />
for(int i=0; i<SAMPLES; i++)<br />
{<br />
microseconds = micros(); //Overflows after around 70 minutes!<br />
<br />
vReal[i] = analogRead(0);<br />
vImag[i] = 0;<br />
<br />
while(micros() < (microseconds + sampling_period_us)){<br />
}<br />
}<br />
<br />
/*FFT*/<br />
FFT.Windowing(vReal, SAMPLES, FFT_WIN_TYP_HAMMING, FFT_FORWARD);<br />
FFT.Compute(vReal, vImag, SAMPLES, FFT_FORWARD);<br />
FFT.ComplexToMagnitude(vReal, vImag, SAMPLES);<br />
double peak = FFT.MajorPeak(vReal, SAMPLES, SAMPLING_FREQUENCY);<br />
<br />
/*PRINT RESULTS*/<br />
//Serial.println(peak); //Print out what frequency is the most dominant.<br />
<br />
for(int i=0; i<(SAMPLES/2); i++)<br />
{<br />
/*View all these three lines in serial terminal to see which frequencies has which amplitudes*/<br />
<br />
//Serial.print((i * 1.0 * SAMPLING_FREQUENCY) / SAMPLES, 1);<br />
//Serial.print(" ");<br />
Serial.println(vReal[i], 1); //View only this line in serial plotter to visualize the bins<br />
}<br />
<br />
//delay(1000); //Repeat the process every second OR:<br />
while(1); //Run code once<br />
}<br />
<br />
<br />
'''C++'''<br />
<br />
/* fft.cpp<br />
* <br />
* This is a KISS implementation of<br />
* the Cooley-Tukey recursive FFT algorithm.<br />
* This works, and is visibly clear about what is happening where.<br />
*<br />
* To compile this with the GNU/GCC compiler:<br />
* g++ -o fft fft.cpp -lm<br />
*<br />
* To run the compiled version from a *nix command line:<br />
* ./fft<br />
*<br />
*/<br />
#include <complex><br />
#include <cstdio><br />
<br />
#define M_PI 3.14159265358979323846 // Pi constant with double precision<br />
<br />
using namespace std;<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void separate (complex<double>* a, int n) {<br />
complex<double>* b = new complex<double>[n/2]; // get temp heap storage<br />
for(int i=0; i<n/2; i++) // copy all odd elements to heap storage<br />
b[i] = a[i*2+1];<br />
for(int i=0; i<n/2; i++) // copy all even elements to lower-half of a[]<br />
a[i] = a[i*2];<br />
for(int i=0; i<n/2; i++) // copy all odd (from heap) to upper-half of a[]<br />
a[i+n/2] = b[i];<br />
delete[] b; // delete heap storage<br />
}<br />
<br />
// N must be a power-of-2, or bad things will happen.<br />
// Currently no check for this condition.<br />
//<br />
// N input samples in X[] are FFT'd and results left in X[].<br />
// Because of Nyquist theorem, N samples means <br />
// only first N/2 FFT results in X[] are the answer.<br />
// (upper half of X[] is a reflection with no new information).<br />
void fft2 (complex<double>* X, int N) {<br />
if(N < 2) {<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
} else {<br />
separate(X,N); // all evens to lower half, all odds to upper half<br />
fft2(X, N/2); // recurse even items<br />
fft2(X+N/2, N/2); // recurse odd items<br />
// combine results of two half recursions<br />
for(int k=0; k<N/2; k++) {<br />
complex<double> e = X[k ]; // even<br />
complex<double> o = X[k+N/2]; // odd<br />
// w is the "twiddle-factor"<br />
complex<double> w = exp( complex<double>(0,-2.*M_PI*k/N) );<br />
X[k ] = e + w * o;<br />
X[k+N/2] = e - w * o;<br />
}<br />
}<br />
}<br />
<br />
// simple test program<br />
int main () {<br />
const int nSamples = 64;<br />
double nSeconds = 1.0; // total time for sampling<br />
double sampleRate = nSamples / nSeconds; // n Hz = n / second <br />
double freqResolution = sampleRate / nSamples; // freq step in FFT result<br />
complex<double> x[nSamples]; // storage for sample data<br />
complex<double> X[nSamples]; // storage for FFT answer<br />
const int nFreqs = 5;<br />
double freq[nFreqs] = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
<br />
// generate samples for testing<br />
for(int i=0; i<nSamples; i++) {<br />
x[i] = complex<double>(0.,0.);<br />
// sum several known sinusoids into x[]<br />
for(int j=0; j<nFreqs; j++)<br />
x[i] += sin( 2*M_PI*freq[j]*i/nSamples );<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
// compute fft for this data<br />
fft2(X,nSamples);<br />
<br />
printf(" n\tx[]\tX[]\tf\n"); // header line<br />
// loop to print values<br />
for(int i=0; i<nSamples; i++) {<br />
printf("% 3d\t%+.3f\t%+.3f\t%g\n",<br />
i, x[i].real(), abs(X[i]), i*freqResolution );<br />
}<br />
}<br />
<br />
===An Example===<br />
https://github.com/kosme/arduinoFFT/tree/master/Examples<br />
<br />
==Authors==<br />
*Jordan Gewirtz<br />
*Nish Chakraburtty<br />
*Chanel Lynn<br />
==Group Link==<br />
eBox project page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX here]<br />
<br />
eBox log page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log here]<br />
==External References==<br />
https://www.youtube.com/watch?v=spUNpyF58BY&t=21s (introduction to a fast fourier transform)<br />
<br />
https://www.algorithm-archive.org/contents/cooley_tukey/cooley_tukey.html (cooley tukey better explained)<br />
<br />
https://www.youtube.com/watch?v=XtypWS8HZco&t=22s (introduction to fourier transform)<br />
<br />
http://people.scs.carleton.ca/~maheshwa/courses/5703COMP/16Fall/FFT_Report.pdf (proof of cooley tukey) <br />
<br />
https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm (cooley tukey intro)<br />
<br />
https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT code)</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino&diff=15306Fast Fourier Transform Library & Arduino2018-12-10T19:52:25Z<p>NishChakra: /* Process */</p>
<hr />
<div>== Overview==<br />
===Introduction===<br />
As the name suggests the Fast Fourier Transform Library enables for the timely computation of a signal's discrete Fourier transform. Instructions on how to download the latest release can be found [https://github.com/kosme/arduinoFFT here]. A fast Fourier transform (fFt) would be of interest to any wishing to take a signal or data set from the time domain to the frequency domain. <br />
[[Category:HowTos]]<br />
[[Category:Programming]]<br />
[[Category:Arduino]]<br />
<br />
==Materials & Prerequisites==<br />
===Materials===<br />
All items one needs to utilize an FFT with an Arduino are:<br />
*Computer<br />
*Arduino<br />
*USB connector<br />
<br />
===Prerequisites===<br />
Next download latest open-source Arduino Software [https://www.arduino.cc/en/Main/Software here].<br />
<br />
==Process==<br />
First, let's begin with a discussion of a general Fourier Transform (FT) and then we will address the Fast Fourier Transform (FFT). The Fourier transform is a mathematical function that decomposes a waveform, which is a function of time, into the frequencies that make it up. The result produced by the Fourier transform is a complex valued function of frequency. The absolute value of the Fourier transform represents the frequency value present in the original function and its complex argument represents the phase offset of the basic sinusoidal in that frequency.<br />
<br />
The Fourier transform is also called a generalization of the Fourier series. This term can also be applied to both the frequency domain representation and the mathematical function used. The Fourier transform helps in extending the Fourier series to non-periodic functions, which allows viewing any function as a sum of simple sinusoids. The definition of which is provided below. Note that we use the discrete time definition of the FT, or a Discrete Fourier Transform (DFT), and not the continuous time definition, the main difference between the two being a summation vs an integral. We make this choice because inputs into computers are discrete data points and not continuous so we can not use an integral, and by extension, we can't use the continuous time definition of the FT. <br />
<br />
The decomposition of functions into their respective frequencies is a very powerful and useful tool, however, an FT requires massive amounts of computational work. For those of you in computer science, an FT would take O(n^2) time. So although we want to use this tool it is computationally expensive. Or at least this was the case until J.W Cooley and John Tukey came on the scene. They came up with the aptly named Cooley–Tukey FFT algorithm which reduced the time cost on a DFT from O(n^2) to O(nlogn). It recursively breaks down the DFT into smaller DFTs and turns the summation into a dynamic programming problem. So we save on time but we increase our space complexity dramatically, however, due to the continued improvement in transistor technology, modern day computing, for all practical purposes, doesn't care about space complexity until it has to. An example of a field that has to would be computational biology, due to the vast number of different genes in existence that all need to be tested. But that's beside the point, let's continue our discussion of an FFT. <br />
<br />
The actual algorithm begins by splitting the matrix into two parts, one with all the even indexed elements, the other part with all the odd indexed elements. We continue spliting the matrices down in the same manner until we can perform a DFT on a manageable matrix. Another way to implement the split, rather than by the even-odd index convention, would be through a reversing the bit value of the array entry's index. You make the choice only on the language you program in; so choose the option that takes up less time to implement for the language. <br />
<br />
Coding it will look like: <br />
<br />
<br />
function cooley_tukey(x)<br />
<br />
N = length(x)<br />
<br />
if (N > 2)<br />
x_odd = cooley_tukey(x[1:2:N])<br />
<br />
x_even = cooley_tukey(x[2:2:N])<br />
else<br />
x_odd = x[1]<br />
<br />
x_even = x[2]<br />
end<br />
n = 0:N-1<br />
<br />
half = div(N,2)<br />
<br />
factor = exp.(-2im*pi*n/N)<br />
<br />
return vcat(x_odd .+ x_even .* factor[1:half], x_odd .- x_even .* factor[1:half])<br />
<br />
end<br />
<br />
<br />
Below you can see some classic implementations in other languages, but as you can see the actual implementation is incredibly difficult. You can find an example of a custom FFT at the bottom. Typically one would not code an FFT from scratch unless you had a very specific purpose for it. Many libraries that deal with computational problems regarding any sort of waveform will have an FFT coded in the API that has been vetted by multiple software developers. <br />
<br />
<br />
To implement a general FFT in an Arduino here are the steps:<br />
<br />
1. Get your computer, Arduino, USB-B cable ready<br />
<br />
2. Download the Arduino coding terminal on your computer ([https://create.arduino.cc/ Web Editor Here])<br />
<br />
3. Run the C++ code given below<br />
<br />
<br />
To really see it in action:<br />
<br />
1. Find a digital waveform (an audio signal, voltage signal, anything digital that can be modeled with sinusoids really)<br />
<br />
2. Pass the waveform in as the parameter of the FFT<br />
<br />
3. Print the output<br />
<br />
<br />
===Implementation on the Arduino===<br />
<br />
'''Arduino C'''<br />
<br />
'#'include "arduinoFFT.h"<br />
<br />
'#'define SAMPLES 128 //Must be a power of 2<br />
<br />
'#'define SAMPLING_FREQUENCY 1000 //Hz, must be less than 10000 due to ADC<br />
<br />
arduinoFFT FFT = arduinoFFT();<br />
<br />
unsigned int sampling_period_us;<br />
unsigned long microseconds;<br />
<br />
double vReal[SAMPLES];<br />
double vImag[SAMPLES];<br />
<br />
void setup() {<br />
Serial.begin(115200);<br />
<br />
sampling_period_us = round(1000000*(1.0/SAMPLING_FREQUENCY));<br />
}<br />
<br />
void loop() {<br />
<br />
/*SAMPLING*/<br />
for(int i=0; i<SAMPLES; i++)<br />
{<br />
microseconds = micros(); //Overflows after around 70 minutes!<br />
<br />
vReal[i] = analogRead(0);<br />
vImag[i] = 0;<br />
<br />
while(micros() < (microseconds + sampling_period_us)){<br />
}<br />
}<br />
<br />
/*FFT*/<br />
FFT.Windowing(vReal, SAMPLES, FFT_WIN_TYP_HAMMING, FFT_FORWARD);<br />
FFT.Compute(vReal, vImag, SAMPLES, FFT_FORWARD);<br />
FFT.ComplexToMagnitude(vReal, vImag, SAMPLES);<br />
double peak = FFT.MajorPeak(vReal, SAMPLES, SAMPLING_FREQUENCY);<br />
<br />
/*PRINT RESULTS*/<br />
//Serial.println(peak); //Print out what frequency is the most dominant.<br />
<br />
for(int i=0; i<(SAMPLES/2); i++)<br />
{<br />
/*View all these three lines in serial terminal to see which frequencies has which amplitudes*/<br />
<br />
//Serial.print((i * 1.0 * SAMPLING_FREQUENCY) / SAMPLES, 1);<br />
//Serial.print(" ");<br />
Serial.println(vReal[i], 1); //View only this line in serial plotter to visualize the bins<br />
}<br />
<br />
//delay(1000); //Repeat the process every second OR:<br />
while(1); //Run code once<br />
}<br />
<br />
<br />
'''C++'''<br />
<br />
/* fft.cpp<br />
* <br />
* This is a KISS implementation of<br />
* the Cooley-Tukey recursive FFT algorithm.<br />
* This works, and is visibly clear about what is happening where.<br />
*<br />
* To compile this with the GNU/GCC compiler:<br />
* g++ -o fft fft.cpp -lm<br />
*<br />
* To run the compiled version from a *nix command line:<br />
* ./fft<br />
*<br />
*/<br />
#include <complex><br />
#include <cstdio><br />
<br />
#define M_PI 3.14159265358979323846 // Pi constant with double precision<br />
<br />
using namespace std;<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void separate (complex<double>* a, int n) {<br />
complex<double>* b = new complex<double>[n/2]; // get temp heap storage<br />
for(int i=0; i<n/2; i++) // copy all odd elements to heap storage<br />
b[i] = a[i*2+1];<br />
for(int i=0; i<n/2; i++) // copy all even elements to lower-half of a[]<br />
a[i] = a[i*2];<br />
for(int i=0; i<n/2; i++) // copy all odd (from heap) to upper-half of a[]<br />
a[i+n/2] = b[i];<br />
delete[] b; // delete heap storage<br />
}<br />
<br />
// N must be a power-of-2, or bad things will happen.<br />
// Currently no check for this condition.<br />
//<br />
// N input samples in X[] are FFT'd and results left in X[].<br />
// Because of Nyquist theorem, N samples means <br />
// only first N/2 FFT results in X[] are the answer.<br />
// (upper half of X[] is a reflection with no new information).<br />
void fft2 (complex<double>* X, int N) {<br />
if(N < 2) {<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
} else {<br />
separate(X,N); // all evens to lower half, all odds to upper half<br />
fft2(X, N/2); // recurse even items<br />
fft2(X+N/2, N/2); // recurse odd items<br />
// combine results of two half recursions<br />
for(int k=0; k<N/2; k++) {<br />
complex<double> e = X[k ]; // even<br />
complex<double> o = X[k+N/2]; // odd<br />
// w is the "twiddle-factor"<br />
complex<double> w = exp( complex<double>(0,-2.*M_PI*k/N) );<br />
X[k ] = e + w * o;<br />
X[k+N/2] = e - w * o;<br />
}<br />
}<br />
}<br />
<br />
// simple test program<br />
int main () {<br />
const int nSamples = 64;<br />
double nSeconds = 1.0; // total time for sampling<br />
double sampleRate = nSamples / nSeconds; // n Hz = n / second <br />
double freqResolution = sampleRate / nSamples; // freq step in FFT result<br />
complex<double> x[nSamples]; // storage for sample data<br />
complex<double> X[nSamples]; // storage for FFT answer<br />
const int nFreqs = 5;<br />
double freq[nFreqs] = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
<br />
// generate samples for testing<br />
for(int i=0; i<nSamples; i++) {<br />
x[i] = complex<double>(0.,0.);<br />
// sum several known sinusoids into x[]<br />
for(int j=0; j<nFreqs; j++)<br />
x[i] += sin( 2*M_PI*freq[j]*i/nSamples );<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
// compute fft for this data<br />
fft2(X,nSamples);<br />
<br />
printf(" n\tx[]\tX[]\tf\n"); // header line<br />
// loop to print values<br />
for(int i=0; i<nSamples; i++) {<br />
printf("% 3d\t%+.3f\t%+.3f\t%g\n",<br />
i, x[i].real(), abs(X[i]), i*freqResolution );<br />
}<br />
}<br />
<br />
===An Example===<br />
https://github.com/kosme/arduinoFFT/tree/master/Examples<br />
<br />
==Authors==<br />
*Jordan Gewirtz<br />
*Nish Chakraburtty<br />
*Chanel Lynn<br />
==Group Link==<br />
eBox project page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX here]<br />
<br />
eBox log page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log here]<br />
==External References==<br />
https://www.youtube.com/watch?v=spUNpyF58BY&t=21s<br />
<br />
https://www.algorithm-archive.org/contents/cooley_tukey/cooley_tukey.html<br />
<br />
https://www.youtube.com/watch?v=XtypWS8HZco&t=22s<br />
<br />
http://people.scs.carleton.ca/~maheshwa/courses/5703COMP/16Fall/FFT_Report.pdf<br />
<br />
https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=15305EBOX2018-12-10T19:44:59Z<p>NishChakra: /* The Software */</p>
<hr />
<div>== Project Proposal ==<br />
=== Overview ===<br />
We created an audio responsive LED lighting system integrated on a desk that can be used as a fun addition to one's home entertainment and lighting systems. The EBOX has 3 modes that the user can set with a tap of a touch sensor to customize the dynamic light patterns to fit any mood.<br />
<br />
=== Group Members ===<br />
Jordan Gewirtz<br />
<br />
Chanel Lynn<br />
<br />
Nish Chakraburtty<br />
<br />
Tony Sancho-Spore (TA)<br />
<br />
Dr. James Feher (Prof)<br />
<br />
===Link to Log===<br />
*[[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
*eBOX WUSTL BOX: https://wustl.app.box.com/folder/57307264614]<br />
*Link to tutorial [https://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino#Materials_.26_Prerequisites here]<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
*User interface<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Soldering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
*Staying under budget<br />
<br />
=== Gantt Chart ===<br />
<br />
<gallery><br />
Gantt Chart (Rev 3).png| Gantt Chart<br />
</gallery><br />
<br />
=== Budget ===<br />
{| class = "wikitable sortable" {{table}}<br />
| align="center" style="background:#f0f0f0;"|'''Item'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price: Actual (Including Shipping)'''<br />
|-<br />
| Arduino [https://store.arduino.cc/usa/arduino-uno-rev3 (Link)]||1||1|| $22.00 ||$0.00 (Provided by TA)|| $22.00 || $0.00<br />
|-<br />
| Transistors [https://www.mouser.com/ProductDetail/ON-Semiconductor-Fairchild/BC547B?qs=UMEuL5FsraB3zD25tclGGQ%3D%3D&gclid=Cj0KCQjwxvbdBRC0ARIsAKmec9aPrjnMgL2Z2kN_UUj-lH33KsgSWltRarCH75kZdbScUbCfsbLc_NUaAjMkEALw_wcB (Link)]||10|||| $0.06 |||| $0.60 ||$0.00 (Provided by TA)<br />
|-<br />
| LED (strips - 6ft) [https://www.amazon.com/Flexible-Daylight-Kitchen-Christmas-Non-waterproof/dp/B00HSF65MC (Link)]||1||1|| $21.99 |||| $21.99 ||<br />
|-<br />
| Arduino Microphone [https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all (Link)]||10||10|| $0.88 ||$0.69|| $8.88 || $6.90<br />
|-<br />
| Table [https://www.ikea.com/us/en/catalog/products/40303444/#/80221352 (Link)] ||1||1|| $39.99 ||$39.99|| $39.99 || $43.86 <br />
|-<br />
|Capacitive Touch Sensors [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen (Link)]|| - || 5 || - || $1.40 || - || $6.99<br />
|-<br />
| Total||14|||||||| $48.78 ||<br />
|}<br />
<br />
== Design And Solutions ==<br />
<br />
=== Steps to Build the EBOX ===<br />
<br />
1. Program the color patterns<br />
<br />
2. Upload the code to the Arduino<br />
<br />
3. Plug leads into the hardware<br />
<br />
4. Solder external power source to lights and Arduino<br />
<br />
5. CAD box to hold the hardware<br />
<br />
6. Assemble table<br />
<br />
7. Secure lights around the underside of the table<br />
<br />
8. Plug in power source adapter to an outlet, place a speaker near the microphone, and enjoy!<br />
<br />
=== Components ===<br />
<br />
LED Light Strip (6ft)<br />
<br />
Arduino Uno<br />
<br />
Capacitive touch sensor<br />
<br />
Sound Detection Sensor Module (Microphone)<br />
<br />
Desk with glass or translucent top<br />
<br />
5V Power adapter<br />
<br />
Leads (wires)<br />
<br />
=== The Software ===<br />
<br />
We wanted to use a Fast Fourier Transform (FFT) in our project implementation as music is just the superposition of a bunch of different frequencies and an FFT would allow us to easily map each superposition to a numeral. <br />
A Fourier Transform is a transformation of a function of time into the frequencies that make it up, but a Fast Fourier Transform is an algorithm that computes the same result but in O(nlogn) time rather than O(n^2) by factorizing the discrete Fourier transform matrix into a product of mostly zeros. We imported the FastLED library ([https://github.com/kosme/arduinoFFT Access Library Here]) from the Arduino library database to translate the analog sound signals into digital signals. This decrease in complexity from a regular Discrete Fourier Transform to a Fast Fourier Transform allowed for a quick response to the audio input. Music or other forms of audio are inputted to the system through the Arduino microphone and the Arduino is programmed to take those analog signals into the FFT (Fast Fourier Transform) operations and the output is series of frequencies in the range of 0-720.<br />
<br />
[[File:FFT-Time-Frequency-View-540.png|thumb|Concept of the Fourier Transform~Source https://www.nti-audio.com/en/support/know-how/fast-fourier-transform-fft]]<br />
<br />
'''Basic implementation idea:'''<br />
<br />
'''Pseudocode:'''<br />
<br />
<br />
Import Libraries<br />
<br />
declare all global variables<br />
<br />
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
Setup<br />
<br />
{<br />
<br />
instantiate hardware pins<br />
<br />
initialize your led strip<br />
<br />
:For (0->numLeds)<br />
<br />
:{<br />
<br />
::create addressable/editable LED array <br />
<br />
:}<br />
<br />
Call showLights Command<br />
<br />
Start taking the average<br />
<br />
}<br />
<br />
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
Main<br />
<br />
{<br />
<br />
Check touch sensor counter<br />
<br />
Change color mode<br />
<br />
}<br />
<br />
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
Options<br />
<br />
{<br />
<br />
:if (counter=value)<br />
<br />
:{<br />
<br />
::put it in a certain mode<br />
<br />
:}<br />
<br />
}<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
TouchSensor<br />
<br />
{<br />
<br />
Instantiate touch sensor <br />
<br />
Create Counter<br />
<br />
Increment with each touch<br />
<br />
mod the counter by numModes<br />
<br />
}<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
Average<br />
<br />
{<br />
<br />
Decide Sampling Rate<br />
<br />
Average input values at rate<br />
<br />
Returns average value <br />
<br />
}<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
White mode<br />
<br />
{<br />
<br />
set all LEDs to white<br />
<br />
}<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
Off<br />
<br />
{<br />
<br />
Turn off LEDs<br />
<br />
}<br />
<br />
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
Party mode<br />
<br />
{<br />
<br />
Take average to sense drops<br />
<br />
Increment RGB values differently based on if there's a drop<br />
<br />
//one way to increment the RGB values of LEDs//<br />
<br />
:For (each LED)<br />
<br />
:{<br />
<br />
::generate r/g/b value from Average method output <br />
<br />
::if (val.r/g/b >= critical value)<br />
<br />
::{<br />
<br />
::: val.r/g/b = val.r/g/b % critVal<br />
<br />
::}<br />
<br />
::if (val.r/g/b < 0)<br />
<br />
::{<br />
<br />
::: val.r/g/b = 0 <br />
<br />
::}<br />
<br />
::else (add the value and move on)<br />
<br />
:}<br />
}<br />
<br />
<br />
'''Explanation of the concept:'''<br />
<br />
First light up the strip to instantiate the strip. From then we want the music to be the input, so it inputs through the microphone. After we get an input, we use the FFT to convert it into value. From that frequency value, we can quantify the relative intensity of the music. However, since the microphone is picking up an obscene amount of inputs per second we should take an average every few milliseconds, hence the 'delay(10)' in the setup of the code, to get a value that we use to change the LED's color. We do this so the Arduino doesn't have to do a ridiculous amount of work by changing colors for every single input value, otherwise, the Arduino would require too much power and the circuit would fry. Based on the value obtained from the average, increment the RGB value of each LED a certain way (up to you). Make sure that the values of each RGB index for each LED has an edge case condition on incrementing the value. The max value for any RGB index is 255, so if you have a bunch of inputs all the RGB values will max out and turn to white light. To avoid this you need to make sure that the RGB values mod by 255, or a lower value if you need to draw less power so that once it hits max red, blue, or green it can reset and keep its dynamics. Now that we have music responsive lights we have to program more modes. In order to do so while allowing for user input to change the modes we employed a capacitive touch sensor, but any type of digital input sensor will work. The touch sensor is binary with it either being touched or not touched. We then instantiate a counter that increments everytime the sensor is touched. We also include in the counter definition a modular wrap around (like the wrap around in the lights) that mods by the number of modes. Now the counter will only exist as a number between 0 and (numModes -1). We then used if statements in our main method that say if the counter is a certain value then party mode, other value then desk mode, etc.<br />
<br />
=== The Electronics ===<br />
====Background====<br />
The electronics that eBOX contains includes an Arduino Uno [https://store.arduino.cc/usa/arduino-uno-rev3], a WS2812B LED strip [https://randomnerdtutorials.com/guide-for-ws2812b-addressable-rgb-led-strip-with-arduino/] , a KY-038 4 pin microphone [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino] , and a TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/] [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen] , all of which is soldered up to an external power source that has a standard [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] wall outlet adapter.<br />
<br />
====Design Considerations & Challenges Faced====<br />
As discussed in the Software section of this wiki, the Arduino functions as the operator of eBOX. It holds all of the code that allows eBOX to perform its functions as well as serving as the interfacing module with the other hardware components. Detailed specs with respect to the Arduino UNO can be found [https://store.arduino.cc/usa/arduino-uno-rev3 here]. One important aspect to consider is that the Arduino UNO comes with only 2 preset 5v port, but for our setup (see figure below) 3 ports were needed. This potential hardware issue was resolved as the ports of the Arduino can be altered to give out power instead of receive information. In our case, we overrode digital port 13 to be a 5v power port instead. However, it is important to note that only devices that draw low power should be connected to the overrode port to ensure not frying the Arduino; we specifically had the touch sensor be powered by overrode port digital 13 as 2 sensors need approximately 5.5V DC and we only used one. Furthermore, an Arduino was chosen over a Raspberry Pi for simplicity sake. A rule of thumb is that an Arduino is best for repetitive tasks, like performing the same calculations over and over and updating LEDs [https://makezine.com/2015/12/04/admittedly-simplistic-guide-raspberry-pi-vs-arduino/].<br />
<br />
The WS2812B LED strip is a particularly nifty piece of hardware. At 10ft long it provides ample length to satisfy any creative design one is crafting. Furthermore, not only is the strip addressable from Arduino’s fastLED Library, but each individual LED in the strip is addressable with respect to brightness and color. Additionally, the WS2812B LEDs are wired in series allowing for communication via a one-wire interface. This means that one can control each LED in the strip individually using a single Arduino digital pin. This setup also allows for the strip to be cut without damaging the LEDs that precede the cut. With respect to power, the WS2812B LED strip should be powered using 5v where each LED draws about 50mA when set at full brightness. This actually started to become an issue due to the surge protector that was part of our external power source. The surge protector would shut off the supply if the current was approaching 2.4 A. This technical issue was overcome similar to the Arduino issue via a software solution. We limited the how bright the LEDs could get by moding the RGB components by 160 instead of 255. This allowed for eBOX to run longer without running into an over consumption of power issue.<br />
<br />
The KY-038 4 pin microphone allowed for sound detection based off the specs [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino found here]. It is crucial that the microphone has an analog out pin in order for frequency detection to be possible. If the mic only has a digital pin, only threshold sounds detection is possible based on the potentiometer setting.<br />
<br />
The TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration was ideal for functioning as a clean and simple user interface. Essentially a digital signal is sent if a human finger gets close enough to the sensor that a change in capacitance is detected. The finger functions as a dielectric as well as conductor, both contributing to an increase in capacitance. More details on how the finger functions as a dielectric and a conductor, as well as discussion on proximity vs contact can be found [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ here]. The digital signal sent to Arduino due to the change in capacitance was used to change modes from party to lamp to off, enabling a slick user interface to operate eBOX by the touch of a button. <br />
<br />
The adapter for the external power source needed to be usable in most places. That is why we soldered an adapted with a [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] configuration. As previously discussed, the adapter had a built-in surge protector which required us to modulate our energy consumption. The adapter had inputs of 100-240V, 50/60Hz and 0.45A. It outputted 5.25V and 2400mA.<br />
<br />
For the literal hardware set up and configuration see the diagram below <br />
<br />
<gallery><br />
ESE205_Electrical_Diagram_bbb.png| Electrical Diagram <br />
</gallery><br />
<br />
=== The Housing ===<br />
<br />
[[File:Screen Shot 2018-12-07 at 6.52.19 PM.png|thumb|Hardware Box]]<br />
To hold the hardware required for the system, we 3D printed a box using OnShape, a computer-aided design software, that would hold the Arduino and other components. When designing the box, we had to consider how the Arduino would be able to access the lights, touch sensor, and a power source, so we made 3 holes in the box, one on the top and two on either side. This way, the leads from the LED strip could be fed through the top hole, the leads from the external power source could feed through a hole on the side, and the touch sensor could feed through the other hole on the side of the box. We determined that the microphone was sensitive enough that we did not need to consider placing the microphone on outside of the box, so we kept it inside the box to keep the wires out of the way. To ensure that the box would fit smoothly into the table, we excavated one corner so that it would fit into the corner of the table and the user can access the touch sensor that interfaces with the entire system. <br />
<br />
[[File:Screen Shot 2018-12-07 at 7.11.07 PM.png|thumb|Bottom view of the hardware box]]<br />
Keeping in mind that the shell of the box and the excavated corner would take space away from the Arduino, we added about 0.5in to the dimensions of the box to ensure that everything would have space.<br />
<br />
To secure the lights to the table, we super glued the LED strip to the inside suface of the table.<br />
<br />
== Results ==<br />
<br />
Our efforts resulted in a functional led integrated table that met the parameters we set out for ourselves. We successfully designed, coded, and built and dynamically audio responsive LED light show and put it into a table. We did so at more than an affordable price point of $90 ($44 sans IKEA table expenses). Although the brightness modulation was not as extreme as we would have liked it to be, we still had the brightness modulate in response to decibels. An important decision that had to be made was the choice to modulate our individual RGB light wrap around at 150 rather than 255 (see software section of Design&Solutions for further explanation). We did so to decrease power draw and to not activate the surge protector in the external power source's adapter. Unfortunately, this resulted in a more narrow range of brightness intensities. <br />
<br />
=== Shortcomings ===<br />
<br />
All of the modules that we set out to use worked out and synced seamlessly. Challenges we faced included buying the right components that would give us the output we needed to conduct the Fast Fourier Transform, debugging the software, and comparing our initial objectives with the final product we felt that we reach all of our goals. Some restricted access to the workshop barred us from customizing the design of the table, although we still met our desired outcome by using a desk that had an existing transparent glass top.<br />
<br />
=== Potential Next Steps ===<br />
Our next steps would be to think about securing the table further by adding a waterproof seal around the glass to avoid damaging the hardware and the LED lights. This will make the product even more functional in that someone would not have to worry about their beverage affecting the components of the electrical system. Adding some additional user interfaces such as an LCD screen that tells the user what mode the system is in and making the light patterns even more dynamic through the software is in could also be next steps. <br />
=== Poster ===<br />
<gallery><br />
Screen Shot 2018-12-02 at 4.23.55 PM.png|Poster<br />
</gallery><br />
<br />
=== External Links ===<br />
<br />
[https://docs.google.com/presentation/d/1mnPGURRNoGbIu7AR5VZs8qfj3P0mFTK5Hc8BOpOewkI/edit?usp=sharing Project Proposal Presentation Powerpoint Link]<br />
<br />
[https://github.com/chanelilynn/ESE205 Code Repository]<br />
<br />
== References ==<br />
<br />
*https://sites.wustl.edu/ese498vertigodancefloor/ (Move to the Groove Reference) <br />
<br />
'''Software References'''<br />
*https://github.com/kosme/arduinoFFT (Arduino FFT library)<br />
*https:/ing /forum.arduino.cc/index.php?topic=427386.0 (Arduino FFT discussion page)<br />
*https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT tutorial)<br />
*https://playground.arduino.cc/Code/Filters (Real Time Digital Signal Processing Library)<br />
*https://www.instructables.com/id/Arduino-Audio-Input/ (Tutorial to take in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Frequency-Detection/ (Tutorial to analyze in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Audio-Output/ (Tutorial to output audio for FFT ~40KHz)<br />
*https://www.youtube.com/watch?v=NQinj-tlU-M (LED coding walkthrough)<br />
*https://www.arduino.cc/reference/en/ (Arduino Language Reference)<br />
*https://www.youtube.com/watch?v=5oRir4dck_w (ARDUINO LED LIGHTS WORK AND ARE SOUND RECEPTIVE (with opensource code))<br />
*http://genericnerd.blogspot.com/2009/05/arduino-mood-light-controller.html (Tutorial, LED color transitions)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Electrical Design References'''<br />
*https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10 (purchased microphone)<br />
*https://randomnerdtutorials.com/guide-for-microphone-sound-sensor-with-arduino/ (Guide for microphone sound sensor)<br />
*https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ (Understanding Capacitive Touch Sensors (Self-Capacitance Configuration))<br />
*http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/catalex-ttp223b-arduino-capacitive-touch-sensor-tutorial/ (Tutorial Capacitive Touch Sensor Arduino)<br />
*https://www.instructables.com/id/Wire-a-Potentiometer-as-a-Variable-Resistor/ (Potentiometer, Variable Resistor)<br />
*https://www.instructables.com/id/How-to-use-OLED-display-arduino-module/ (Tutorial LED display)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Physical Design References'''<br />
*https://www.youtube.com/watch?v=kj-oZgmRB2w&t=73s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=pMWnsHpDlQE&t=18s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=OasbgnLOuPI (HOW TO BUILD THE TABLE AND INTEGRATE THE LEDS)<br />
<br />
<br />
<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=15304EBOX2018-12-10T19:43:11Z<p>NishChakra: /* The Software */</p>
<hr />
<div>== Project Proposal ==<br />
=== Overview ===<br />
We created an audio responsive LED lighting system integrated on a desk that can be used as a fun addition to one's home entertainment and lighting systems. The EBOX has 3 modes that the user can set with a tap of a touch sensor to customize the dynamic light patterns to fit any mood.<br />
<br />
=== Group Members ===<br />
Jordan Gewirtz<br />
<br />
Chanel Lynn<br />
<br />
Nish Chakraburtty<br />
<br />
Tony Sancho-Spore (TA)<br />
<br />
Dr. James Feher (Prof)<br />
<br />
===Link to Log===<br />
*[[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
*eBOX WUSTL BOX: https://wustl.app.box.com/folder/57307264614]<br />
*Link to tutorial [https://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino#Materials_.26_Prerequisites here]<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
*User interface<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Soldering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
*Staying under budget<br />
<br />
=== Gantt Chart ===<br />
<br />
<gallery><br />
Gantt Chart (Rev 3).png| Gantt Chart<br />
</gallery><br />
<br />
=== Budget ===<br />
{| class = "wikitable sortable" {{table}}<br />
| align="center" style="background:#f0f0f0;"|'''Item'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price: Actual (Including Shipping)'''<br />
|-<br />
| Arduino [https://store.arduino.cc/usa/arduino-uno-rev3 (Link)]||1||1|| $22.00 ||$0.00 (Provided by TA)|| $22.00 || $0.00<br />
|-<br />
| Transistors [https://www.mouser.com/ProductDetail/ON-Semiconductor-Fairchild/BC547B?qs=UMEuL5FsraB3zD25tclGGQ%3D%3D&gclid=Cj0KCQjwxvbdBRC0ARIsAKmec9aPrjnMgL2Z2kN_UUj-lH33KsgSWltRarCH75kZdbScUbCfsbLc_NUaAjMkEALw_wcB (Link)]||10|||| $0.06 |||| $0.60 ||$0.00 (Provided by TA)<br />
|-<br />
| LED (strips - 6ft) [https://www.amazon.com/Flexible-Daylight-Kitchen-Christmas-Non-waterproof/dp/B00HSF65MC (Link)]||1||1|| $21.99 |||| $21.99 ||<br />
|-<br />
| Arduino Microphone [https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all (Link)]||10||10|| $0.88 ||$0.69|| $8.88 || $6.90<br />
|-<br />
| Table [https://www.ikea.com/us/en/catalog/products/40303444/#/80221352 (Link)] ||1||1|| $39.99 ||$39.99|| $39.99 || $43.86 <br />
|-<br />
|Capacitive Touch Sensors [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen (Link)]|| - || 5 || - || $1.40 || - || $6.99<br />
|-<br />
| Total||14|||||||| $48.78 ||<br />
|}<br />
<br />
== Design And Solutions ==<br />
<br />
=== Steps to Build the EBOX ===<br />
<br />
1. Program the color patterns<br />
<br />
2. Upload the code to the Arduino<br />
<br />
3. Plug leads into the hardware<br />
<br />
4. Solder external power source to lights and Arduino<br />
<br />
5. CAD box to hold the hardware<br />
<br />
6. Assemble table<br />
<br />
7. Secure lights around the underside of the table<br />
<br />
8. Plug in power source adapter to an outlet, place a speaker near the microphone, and enjoy!<br />
<br />
=== Components ===<br />
<br />
LED Light Strip (6ft)<br />
<br />
Arduino Uno<br />
<br />
Capacitive touch sensor<br />
<br />
Sound Detection Sensor Module (Microphone)<br />
<br />
Desk with glass or translucent top<br />
<br />
5V Power adapter<br />
<br />
Leads (wires)<br />
<br />
=== The Software ===<br />
<br />
We wanted to use a Fast Fourier Transform (FFT) in our project implementation as music is just the superposition of a bunch of different frequencies and an FFT would allow us to easily map each superposition to a numeral. <br />
A Fourier Transform is a transformation of a function of time into the frequencies that make it up, but a Fast Fourier Transform is an algorithm that computes the same result but in O(nlogn) time rather than O(n^2) by factorizing the discrete Fourier transform matrix into a product of mostly zeros. We imported the FastLED library ([https://github.com/kosme/arduinoFFT Access Library Here]) from the Arduino library database to translate the analog sound signals into digital signals. This decrease in complexity from a regular Discrete Fourier Transform to a Fast Fourier Transform allowed for a quick response to the audio input. Music or other forms of audio are inputted to the system through the Arduino microphone and the Arduino is programmed to take those analog signals into the FFT (Fast Fourier Transform) operations and the output is series of frequencies in the range of 0-720.<br />
<br />
[[File:FFT-Time-Frequency-View-540.png|thumb|Concept of the Fourier Transform~Source https://www.nti-audio.com/en/support/know-how/fast-fourier-transform-fft]]<br />
<br />
'''Basic implementation idea:'''<br />
<br />
'''Pseudocode:'''<br />
<br />
<br />
Import Libraries<br />
<br />
declare all global variables<br />
<br />
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
Setup<br />
<br />
{<br />
<br />
instantiate hardware pins<br />
<br />
initialize your led strip<br />
<br />
:For (0->numLeds)<br />
<br />
:{<br />
<br />
::create addressable/editable LED array <br />
<br />
:}<br />
<br />
Call showLights Command<br />
<br />
Start taking the average<br />
<br />
}<br />
<br />
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
Main<br />
<br />
{<br />
<br />
Check touch sensor counter<br />
<br />
Change color mode<br />
<br />
}<br />
<br />
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
Options<br />
<br />
{<br />
<br />
:if (counter=value)<br />
<br />
:{<br />
<br />
::put it in a certain mode<br />
<br />
:}<br />
<br />
}<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
TouchSensor<br />
<br />
{<br />
<br />
Instantiate touch sensor <br />
<br />
Create Counter<br />
<br />
Increment with each touch<br />
<br />
mod the counter by numModes<br />
<br />
}<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
Average<br />
<br />
{<br />
<br />
Decide Sampling Rate<br />
<br />
Average input values at rate<br />
<br />
Returns average value <br />
<br />
}<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
White mode<br />
<br />
{<br />
<br />
set all LEDs to white<br />
<br />
}<br />
<br />
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
Off<br />
<br />
{<br />
<br />
Turn off LEDs<br />
<br />
}<br />
<br />
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
<br />
Party mode<br />
<br />
{<br />
<br />
Take average to sense drops<br />
<br />
Increment RGB values differently based on if there's a drop<br />
<br />
//one way to increment the RGB values of LEDs//<br />
<br />
:For (each LED)<br />
<br />
:{<br />
<br />
::add combination or permutation of RGB to existing value <br />
<br />
::if (val.r/g/b = critical value)<br />
<br />
::{<br />
<br />
::: val.r/g/b = val.r/g/b % critVal<br />
<br />
::}<br />
<br />
::if (val.r/g/b < 0)<br />
<br />
::{<br />
<br />
::: val.r/g/b = 0 <br />
<br />
::}<br />
<br />
::else (add the value and move on)<br />
<br />
:}<br />
}<br />
<br />
<br />
'''Explanation of the concept:'''<br />
<br />
First light up the strip to instantiate the strip. From then we want the music to be the input, so it inputs through the microphone. After we get an input, we use the FFT to convert it into value. From that frequency value, we can quantify the relative intensity of the music. However, since the microphone is picking up an obscene amount of inputs per second we should take an average every few milliseconds, hence the 'delay(10)' in the setup of the code, to get a value that we use to change the LED's color. We do this so the Arduino doesn't have to do a ridiculous amount of work by changing colors for every single input value, otherwise, the Arduino would require too much power and the circuit would fry. Based on the value obtained from the average, increment the RGB value of each LED a certain way (up to you). Make sure that the values of each RGB index for each LED has an edge case condition on incrementing the value. The max value for any RGB index is 255, so if you have a bunch of inputs all the RGB values will max out and turn to white light. To avoid this you need to make sure that the RGB values mod by 255, or a lower value if you need to draw less power so that once it hits max red, blue, or green it can reset and keep its dynamics. Now that we have music responsive lights we have to program more modes. In order to do so while allowing for user input to change the modes we employed a capacitive touch sensor, but any type of digital input sensor will work. The touch sensor is binary with it either being touched or not touched. We then instantiate a counter that increments everytime the sensor is touched. We also include in the counter definition a modular wrap around (like the wrap around in the lights) that mods by the number of modes. Now the counter will only exist as a number between 0 and (numModes -1). We then used if statements in our main method that say if the counter is a certain value then party mode, other value then desk mode, etc.<br />
<br />
=== The Electronics ===<br />
====Background====<br />
The electronics that eBOX contains includes an Arduino Uno [https://store.arduino.cc/usa/arduino-uno-rev3], a WS2812B LED strip [https://randomnerdtutorials.com/guide-for-ws2812b-addressable-rgb-led-strip-with-arduino/] , a KY-038 4 pin microphone [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino] , and a TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/] [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen] , all of which is soldered up to an external power source that has a standard [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] wall outlet adapter.<br />
<br />
====Design Considerations & Challenges Faced====<br />
As discussed in the Software section of this wiki, the Arduino functions as the operator of eBOX. It holds all of the code that allows eBOX to perform its functions as well as serving as the interfacing module with the other hardware components. Detailed specs with respect to the Arduino UNO can be found [https://store.arduino.cc/usa/arduino-uno-rev3 here]. One important aspect to consider is that the Arduino UNO comes with only 2 preset 5v port, but for our setup (see figure below) 3 ports were needed. This potential hardware issue was resolved as the ports of the Arduino can be altered to give out power instead of receive information. In our case, we overrode digital port 13 to be a 5v power port instead. However, it is important to note that only devices that draw low power should be connected to the overrode port to ensure not frying the Arduino; we specifically had the touch sensor be powered by overrode port digital 13 as 2 sensors need approximately 5.5V DC and we only used one. Furthermore, an Arduino was chosen over a Raspberry Pi for simplicity sake. A rule of thumb is that an Arduino is best for repetitive tasks, like performing the same calculations over and over and updating LEDs [https://makezine.com/2015/12/04/admittedly-simplistic-guide-raspberry-pi-vs-arduino/].<br />
<br />
The WS2812B LED strip is a particularly nifty piece of hardware. At 10ft long it provides ample length to satisfy any creative design one is crafting. Furthermore, not only is the strip addressable from Arduino’s fastLED Library, but each individual LED in the strip is addressable with respect to brightness and color. Additionally, the WS2812B LEDs are wired in series allowing for communication via a one-wire interface. This means that one can control each LED in the strip individually using a single Arduino digital pin. This setup also allows for the strip to be cut without damaging the LEDs that precede the cut. With respect to power, the WS2812B LED strip should be powered using 5v where each LED draws about 50mA when set at full brightness. This actually started to become an issue due to the surge protector that was part of our external power source. The surge protector would shut off the supply if the current was approaching 2.4 A. This technical issue was overcome similar to the Arduino issue via a software solution. We limited the how bright the LEDs could get by moding the RGB components by 160 instead of 255. This allowed for eBOX to run longer without running into an over consumption of power issue.<br />
<br />
The KY-038 4 pin microphone allowed for sound detection based off the specs [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino found here]. It is crucial that the microphone has an analog out pin in order for frequency detection to be possible. If the mic only has a digital pin, only threshold sounds detection is possible based on the potentiometer setting.<br />
<br />
The TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration was ideal for functioning as a clean and simple user interface. Essentially a digital signal is sent if a human finger gets close enough to the sensor that a change in capacitance is detected. The finger functions as a dielectric as well as conductor, both contributing to an increase in capacitance. More details on how the finger functions as a dielectric and a conductor, as well as discussion on proximity vs contact can be found [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ here]. The digital signal sent to Arduino due to the change in capacitance was used to change modes from party to lamp to off, enabling a slick user interface to operate eBOX by the touch of a button. <br />
<br />
The adapter for the external power source needed to be usable in most places. That is why we soldered an adapted with a [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] configuration. As previously discussed, the adapter had a built-in surge protector which required us to modulate our energy consumption. The adapter had inputs of 100-240V, 50/60Hz and 0.45A. It outputted 5.25V and 2400mA.<br />
<br />
For the literal hardware set up and configuration see the diagram below <br />
<br />
<gallery><br />
ESE205_Electrical_Diagram_bbb.png| Electrical Diagram <br />
</gallery><br />
<br />
=== The Housing ===<br />
<br />
[[File:Screen Shot 2018-12-07 at 6.52.19 PM.png|thumb|Hardware Box]]<br />
To hold the hardware required for the system, we 3D printed a box using OnShape, a computer-aided design software, that would hold the Arduino and other components. When designing the box, we had to consider how the Arduino would be able to access the lights, touch sensor, and a power source, so we made 3 holes in the box, one on the top and two on either side. This way, the leads from the LED strip could be fed through the top hole, the leads from the external power source could feed through a hole on the side, and the touch sensor could feed through the other hole on the side of the box. We determined that the microphone was sensitive enough that we did not need to consider placing the microphone on outside of the box, so we kept it inside the box to keep the wires out of the way. To ensure that the box would fit smoothly into the table, we excavated one corner so that it would fit into the corner of the table and the user can access the touch sensor that interfaces with the entire system. <br />
<br />
[[File:Screen Shot 2018-12-07 at 7.11.07 PM.png|thumb|Bottom view of the hardware box]]<br />
Keeping in mind that the shell of the box and the excavated corner would take space away from the Arduino, we added about 0.5in to the dimensions of the box to ensure that everything would have space.<br />
<br />
To secure the lights to the table, we super glued the LED strip to the inside suface of the table.<br />
<br />
== Results ==<br />
<br />
Our efforts resulted in a functional led integrated table that met the parameters we set out for ourselves. We successfully designed, coded, and built and dynamically audio responsive LED light show and put it into a table. We did so at more than an affordable price point of $90 ($44 sans IKEA table expenses). Although the brightness modulation was not as extreme as we would have liked it to be, we still had the brightness modulate in response to decibels. An important decision that had to be made was the choice to modulate our individual RGB light wrap around at 150 rather than 255 (see software section of Design&Solutions for further explanation). We did so to decrease power draw and to not activate the surge protector in the external power source's adapter. Unfortunately, this resulted in a more narrow range of brightness intensities. <br />
<br />
=== Shortcomings ===<br />
<br />
All of the modules that we set out to use worked out and synced seamlessly. Challenges we faced included buying the right components that would give us the output we needed to conduct the Fast Fourier Transform, debugging the software, and comparing our initial objectives with the final product we felt that we reach all of our goals. Some restricted access to the workshop barred us from customizing the design of the table, although we still met our desired outcome by using a desk that had an existing transparent glass top.<br />
<br />
=== Potential Next Steps ===<br />
Our next steps would be to think about securing the table further by adding a waterproof seal around the glass to avoid damaging the hardware and the LED lights. This will make the product even more functional in that someone would not have to worry about their beverage affecting the components of the electrical system. Adding some additional user interfaces such as an LCD screen that tells the user what mode the system is in and making the light patterns even more dynamic through the software is in could also be next steps. <br />
=== Poster ===<br />
<gallery><br />
Screen Shot 2018-12-02 at 4.23.55 PM.png|Poster<br />
</gallery><br />
<br />
=== External Links ===<br />
<br />
[https://docs.google.com/presentation/d/1mnPGURRNoGbIu7AR5VZs8qfj3P0mFTK5Hc8BOpOewkI/edit?usp=sharing Project Proposal Presentation Powerpoint Link]<br />
<br />
[https://github.com/chanelilynn/ESE205 Code Repository]<br />
<br />
== References ==<br />
<br />
*https://sites.wustl.edu/ese498vertigodancefloor/ (Move to the Groove Reference) <br />
<br />
'''Software References'''<br />
*https://github.com/kosme/arduinoFFT (Arduino FFT library)<br />
*https:/ing /forum.arduino.cc/index.php?topic=427386.0 (Arduino FFT discussion page)<br />
*https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT tutorial)<br />
*https://playground.arduino.cc/Code/Filters (Real Time Digital Signal Processing Library)<br />
*https://www.instructables.com/id/Arduino-Audio-Input/ (Tutorial to take in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Frequency-Detection/ (Tutorial to analyze in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Audio-Output/ (Tutorial to output audio for FFT ~40KHz)<br />
*https://www.youtube.com/watch?v=NQinj-tlU-M (LED coding walkthrough)<br />
*https://www.arduino.cc/reference/en/ (Arduino Language Reference)<br />
*https://www.youtube.com/watch?v=5oRir4dck_w (ARDUINO LED LIGHTS WORK AND ARE SOUND RECEPTIVE (with opensource code))<br />
*http://genericnerd.blogspot.com/2009/05/arduino-mood-light-controller.html (Tutorial, LED color transitions)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Electrical Design References'''<br />
*https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10 (purchased microphone)<br />
*https://randomnerdtutorials.com/guide-for-microphone-sound-sensor-with-arduino/ (Guide for microphone sound sensor)<br />
*https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ (Understanding Capacitive Touch Sensors (Self-Capacitance Configuration))<br />
*http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/catalex-ttp223b-arduino-capacitive-touch-sensor-tutorial/ (Tutorial Capacitive Touch Sensor Arduino)<br />
*https://www.instructables.com/id/Wire-a-Potentiometer-as-a-Variable-Resistor/ (Potentiometer, Variable Resistor)<br />
*https://www.instructables.com/id/How-to-use-OLED-display-arduino-module/ (Tutorial LED display)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Physical Design References'''<br />
*https://www.youtube.com/watch?v=kj-oZgmRB2w&t=73s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=pMWnsHpDlQE&t=18s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=OasbgnLOuPI (HOW TO BUILD THE TABLE AND INTEGRATE THE LEDS)<br />
<br />
<br />
<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino&diff=15239Fast Fourier Transform Library & Arduino2018-12-08T23:52:20Z<p>NishChakra: /* Process */</p>
<hr />
<div>== Overview==<br />
===Introduction===<br />
As the name suggests the Fast Fourier Transform Library enables for the timely computation of a signal's discrete Fourier transform. Instructions on how to download the latest release can be found [https://github.com/kosme/arduinoFFT here]. A fast Fourier transform (fFt) would be of interest to any wishing to take a signal or data set from the time domain to the frequency domain. <br />
[[Category:HowTos]]<br />
[[Category:Programming]]<br />
[[Category:Arduino]]<br />
<br />
==Materials & Prerequisites==<br />
===Materials===<br />
All items one needs to utilize an FFT with an Arduino are:<br />
*Computer<br />
*Arduino<br />
*USB connector<br />
<br />
===Prerequisites===<br />
Next download latest open-source Arduino Software [https://www.arduino.cc/en/Main/Software here].<br />
<br />
==Process==<br />
First, let's begin with a discussion of a general Fourier Transform (FT) and then we will address the Fast Fourier Transform (FFT). The Fourier transform is a mathematical function that decomposes a waveform, which is a function of time, into the frequencies that make it up. The result produced by the Fourier transform is a complex valued function of frequency. The absolute value of the Fourier transform represents the frequency value present in the original function and its complex argument represents the phase offset of the basic sinusoidal in that frequency.<br />
<br />
The Fourier transform is also called a generalization of the Fourier series. This term can also be applied to both the frequency domain representation and the mathematical function used. The Fourier transform helps in extending the Fourier series to non-periodic functions, which allows viewing any function as a sum of simple sinusoids. The definition of which is provided below. Note that we use the discrete time definition of the FT, or a Discrete Fourier Transform (DFT), and not the continuous time definition, the main difference between the two being a summation vs an integral. We make this choice because inputs into computers are discrete data points and not continuous so we can not use an integral, and by extension, we can't use the continuous time definition of the FT. <br />
<br />
The decomposition of functions into their respective frequencies is a very powerful and useful tool, however, an FT requires massive amounts of computational work. For those of you in computer science, an FT would take O(n^2) time. So although we want to use this tool it is computationally expensive. Or at least this was the case until J.W Cooley and John Tukey came on the scene. They came up with the aptly named Cooley–Tukey FFT algorithm which reduced the time cost on a DFT from O(n^2) to O(nlogn). It recursively breaks down the DFT into smaller DFTs and turns the summation into a dynamic programming problem. So we save on time but we increase our space complexity dramatically, however, due to the continued improvement in transistor technology, modern day computing, for all practical purposes, doesn't care about space complexity until it has to. An example of a field that has to would be computational biology, due to the vast number of different genes in existence that all need to be tested. But that's beside the point, let's continue our discussion of an FFT. <br />
<br />
The actual algorithm begins by splitting the matrix into two parts, one with all the even indexed elements, the other part with all the odd indexed elements. We continue spliting the matrices down in the same manner until we can perform a DFT on a manageable matrix. Another way to implement the split, rather than by the even-odd index convention, would be through a reversing the bit value of the array entry's index. You make the choice only on the language you program in; so choose the option that takes up less time to implement for the language. <br />
<br />
Coding it will look like: <br />
<br />
<br />
function cooley_tukey(x)<br />
<br />
N = length(x)<br />
<br />
if (N > 2)<br />
x_odd = cooley_tukey(x[1:2:N])<br />
<br />
x_even = cooley_tukey(x[2:2:N])<br />
else<br />
x_odd = x[1]<br />
<br />
x_even = x[2]<br />
end<br />
n = 0:N-1<br />
<br />
half = div(N,2)<br />
<br />
factor = exp.(-2im*pi*n/N)<br />
<br />
return vcat(x_odd .+ x_even .* factor[1:half], x_odd .- x_even .* factor[1:half])<br />
<br />
end<br />
<br />
Below you can see some classic implementations in other languages, but as you can see the actual implementation is incredibly difficult. You can find an example of a custom FFT at the bottom. Typically one would not code an FFT from scratch unless you had a very specific purpose for it. Many libraries that deal with computational problems regarding any sort of waveform will have an FFT coded in the API that has been vetted by multiple software developers. <br />
<br />
<br />
To implement a general FFT in an Arduino here are the steps:<br />
<br />
1. Get your computer, arduino, usb-B cable ready<br />
<br />
2. download the Arduino coding terminal on your computer<br />
<br />
3. run the C++ code given below<br />
<br />
<br />
To really see it in action:<br />
<br />
1. Find a digital waveform (an audio signal, voltage signal, anything digital that can be modeled with sinusoids really)<br />
<br />
2. Pass that waveform in as the parameter of the FFT<br />
<br />
3. Print the output<br />
<br />
<br />
===Implementations in different languages===<br />
<br />
'''C++'''<br />
<br />
/* fft.cpp<br />
* <br />
* This is a KISS implementation of<br />
* the Cooley-Tukey recursive FFT algorithm.<br />
* This works, and is visibly clear about what is happening where.<br />
*<br />
* To compile this with the GNU/GCC compiler:<br />
* g++ -o fft fft.cpp -lm<br />
*<br />
* To run the compiled version from a *nix command line:<br />
* ./fft<br />
*<br />
*/<br />
#include <complex><br />
#include <cstdio><br />
<br />
#define M_PI 3.14159265358979323846 // Pi constant with double precision<br />
<br />
using namespace std;<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void separate (complex<double>* a, int n) {<br />
complex<double>* b = new complex<double>[n/2]; // get temp heap storage<br />
for(int i=0; i<n/2; i++) // copy all odd elements to heap storage<br />
b[i] = a[i*2+1];<br />
for(int i=0; i<n/2; i++) // copy all even elements to lower-half of a[]<br />
a[i] = a[i*2];<br />
for(int i=0; i<n/2; i++) // copy all odd (from heap) to upper-half of a[]<br />
a[i+n/2] = b[i];<br />
delete[] b; // delete heap storage<br />
}<br />
<br />
// N must be a power-of-2, or bad things will happen.<br />
// Currently no check for this condition.<br />
//<br />
// N input samples in X[] are FFT'd and results left in X[].<br />
// Because of Nyquist theorem, N samples means <br />
// only first N/2 FFT results in X[] are the answer.<br />
// (upper half of X[] is a reflection with no new information).<br />
void fft2 (complex<double>* X, int N) {<br />
if(N < 2) {<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
} else {<br />
separate(X,N); // all evens to lower half, all odds to upper half<br />
fft2(X, N/2); // recurse even items<br />
fft2(X+N/2, N/2); // recurse odd items<br />
// combine results of two half recursions<br />
for(int k=0; k<N/2; k++) {<br />
complex<double> e = X[k ]; // even<br />
complex<double> o = X[k+N/2]; // odd<br />
// w is the "twiddle-factor"<br />
complex<double> w = exp( complex<double>(0,-2.*M_PI*k/N) );<br />
X[k ] = e + w * o;<br />
X[k+N/2] = e - w * o;<br />
}<br />
}<br />
}<br />
<br />
// simple test program<br />
int main () {<br />
const int nSamples = 64;<br />
double nSeconds = 1.0; // total time for sampling<br />
double sampleRate = nSamples / nSeconds; // n Hz = n / second <br />
double freqResolution = sampleRate / nSamples; // freq step in FFT result<br />
complex<double> x[nSamples]; // storage for sample data<br />
complex<double> X[nSamples]; // storage for FFT answer<br />
const int nFreqs = 5;<br />
double freq[nFreqs] = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
<br />
// generate samples for testing<br />
for(int i=0; i<nSamples; i++) {<br />
x[i] = complex<double>(0.,0.);<br />
// sum several known sinusoids into x[]<br />
for(int j=0; j<nFreqs; j++)<br />
x[i] += sin( 2*M_PI*freq[j]*i/nSamples );<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
// compute fft for this data<br />
fft2(X,nSamples);<br />
<br />
printf(" n\tx[]\tX[]\tf\n"); // header line<br />
// loop to print values<br />
for(int i=0; i<nSamples; i++) {<br />
printf("% 3d\t%+.3f\t%+.3f\t%g\n",<br />
i, x[i].real(), abs(X[i]), i*freqResolution );<br />
}<br />
}<br />
<br />
<br />
'''C#'''<br />
<br />
using System;<br />
using System.Numerics;<br />
<br />
class FT<br />
{<br />
public Complex[] x; // storage for sample data<br />
public Complex[] X; // storage for FFT answer<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void Separate(ref Complex[] a, int m, int n)<br />
{<br />
Complex[] b = new Complex[(n - m) / 2];<br />
for (int i = 0; i < (n - m) / 2; i++) // copy all odd elements to b<br />
b[i] = a[m + i * 2 + 1];<br />
for (int i = 0; i < (n - m) / 2; i++) // copy all even elements to lower-half of a<br />
a[m + i] = a[m + i * 2];<br />
for (int i = 0; i < (n - m) / 2; i++) // copy all odd (from b) to upper-half of a[]<br />
a[m + i + (n - m) / 2] = b[i];<br />
}<br />
<br />
void FFT2(ref Complex[] X, int m, int n) // m: the first element of the array X<br />
// n - 1: the last element of the array X<br />
{<br />
if (n - m < 2)<br />
{<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
}<br />
else<br />
{<br />
Separate(ref X, m, n); // all evens to lower half, all odds to upper half<br />
FFT2(ref X, m, m + (n - m) / 2); // recurse even items<br />
FFT2(ref X, m + (n - m) / 2, n); // recurse odd items <br />
for (int k = 0; k < (n - m) / 2; k++)// combine results of two half recursions<br />
{<br />
Complex e = X[m + k]; // even<br />
Complex o = X[m + k + (n - m) / 2]; // odd <br />
Complex w = Complex.Exp(new Complex(0, -2 * Math.PI * k / (n - m))); // w is the "twiddle-factor"<br />
X[m + k] = e + w * o;<br />
X[m + k + (n - m) / 2] = e - w * o;<br />
}<br />
}<br />
}<br />
double signal(double t)<br />
{<br />
double[] freq = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
double sum = 0;<br />
for (int j = 0; j < freq.GetLength(0); j++) // sum several known sinusoids into x[]<br />
sum += Math.Sin(2 * Math.PI * freq[j] * t);<br />
return sum;<br />
}<br />
<br />
void Fill()<br />
{<br />
// generate samples for testing<br />
int N = x.Length;<br />
for (int i = 0; i < N; i++)<br />
{<br />
x[i] = signal((double)i / N);<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
}<br />
<br />
public FT(int N)<br />
{<br />
x = new Complex[N]; // storage for sample data<br />
X = new Complex[N]; // storage for FFT answer<br />
Fill(); <br />
FFT2(ref X, 0, N);<br />
}<br />
}<br />
<br />
class Program<br />
{<br />
static void Main()<br />
{<br />
int N = 64;<br />
FT ft = new FT(N);<br />
Console.WriteLine(" n\tx[]\tX[]\tf");<br />
for (int i = 0; i < N; i++)<br />
{<br />
Console.WriteLine(i.ToString() + "\t" + ft.x[i].Real.ToString("0.###") + "\t"<br />
+ Complex.Abs(ft.X[i]).ToString("0.###") + "\t" + i);<br />
}<br />
Console.ReadKey();<br />
}<br />
}<br />
<br />
===An Example===<br />
https://github.com/kosme/arduinoFFT/tree/master/Examples<br />
<br />
==Authors==<br />
*Jordan Gewirtz<br />
*Nish Chakraburtty<br />
*Chanel Lynn<br />
==Group Link==<br />
eBox project page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX here]<br />
<br />
eBox log page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log here]<br />
==External References==<br />
https://www.youtube.com/watch?v=spUNpyF58BY&t=21s<br />
<br />
https://www.algorithm-archive.org/contents/cooley_tukey/cooley_tukey.html<br />
<br />
https://www.youtube.com/watch?v=XtypWS8HZco&t=22s<br />
<br />
http://people.scs.carleton.ca/~maheshwa/courses/5703COMP/16Fall/FFT_Report.pdf<br />
<br />
https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino&diff=15238Fast Fourier Transform Library & Arduino2018-12-08T23:51:37Z<p>NishChakra: </p>
<hr />
<div>== Overview==<br />
===Introduction===<br />
As the name suggests the Fast Fourier Transform Library enables for the timely computation of a signal's discrete Fourier transform. Instructions on how to download the latest release can be found [https://github.com/kosme/arduinoFFT here]. A fast Fourier transform (fFt) would be of interest to any wishing to take a signal or data set from the time domain to the frequency domain. <br />
[[Category:HowTos]]<br />
[[Category:Programming]]<br />
[[Category:Arduino]]<br />
<br />
==Materials & Prerequisites==<br />
===Materials===<br />
All items one needs to utilize an FFT with an Arduino are:<br />
*Computer<br />
*Arduino<br />
*USB connector<br />
<br />
===Prerequisites===<br />
Next download latest open-source Arduino Software [https://www.arduino.cc/en/Main/Software here].<br />
<br />
==Process==<br />
First, let's begin with a discussion of a general Fourier Transform (FT) and then we will address the Fast Fourier Transform (FFT). The Fourier transform is a mathematical function that decomposes a waveform, which is a function of time, into the frequencies that make it up. The result produced by the Fourier transform is a complex valued function of frequency. The absolute value of the Fourier transform represents the frequency value present in the original function and its complex argument represents the phase offset of the basic sinusoidal in that frequency.<br />
<br />
The Fourier transform is also called a generalization of the Fourier series. This term can also be applied to both the frequency domain representation and the mathematical function used. The Fourier transform helps in extending the Fourier series to non-periodic functions, which allows viewing any function as a sum of simple sinusoids. The definition of which is provided below. Note that we use the discrete time definition of the FT, or a Discrete Fourier Transform (DFT), and not the continuous time definition, the main difference between the two being a summation vs an integral. We make this choice because inputs into computers are discrete data points and not continuous so we can not use an integral, and by extension, we can't use the continuous time definition of the FT. <br />
<br />
The decomposition of functions into their respective frequencies is a very powerful and useful tool, however, an FT requires massive amounts of computational work. For those of you in computer science, an FT would take O(n^2) time. So although we want to use this tool it is computationally expensive. Or at least this was the case until J.W Cooley and John Tukey came on the scene. They came up with the aptly named Cooley–Tukey FFT algorithm which reduced the time cost on a DFT from O(n^2) to O(nlogn). It recursively breaks down the DFT into smaller DFTs and turns the summation into a dynamic programming problem. So we save on time but we increase our space complexity dramatically, however, due to the continued improvement in transistor technology, modern day computing, for all practical purposes, doesn't care about space complexity until it has to. An example of a field that has to would be computational biology, due to the vast number of different genes in existence that all need to be tested. But that's beside the point, let's continue our discussion of an FFT. <br />
<br />
The actual algorithm begins by splitting the matrix into two parts, one with all the even indexed elements, the other part with all the odd indexed elements. We continue spliting the matrices down in the same manner until we can perform a DFT on a manageable matrix. Another way to implement the split, rather than by the even-odd index convention, would be through a reversing the bit value of the array entry's index. You make the choice only on the language you program in; so choose the option that takes up less time to implement for the language. <br />
<br />
Coding it will look like: <br />
<br />
<br />
function cooley_tukey(x)<br />
<br />
N = length(x)<br />
<br />
if (N > 2)<br />
x_odd = cooley_tukey(x[1:2:N])<br />
<br />
x_even = cooley_tukey(x[2:2:N])<br />
else<br />
x_odd = x[1]<br />
<br />
x_even = x[2]<br />
end<br />
n = 0:N-1<br />
<br />
half = div(N,2)<br />
<br />
factor = exp.(-2im*pi*n/N)<br />
<br />
return vcat(x_odd .+ x_even .* factor[1:half], x_odd .- x_even .* factor[1:half])<br />
<br />
end<br />
<br />
Below you can see some classic implementations in other languages, but as you can see the actual implementation is incredibly difficult. You can find an example of a custom FFT at the bottom. Typically one would not code an FFT from scratch unless you had a very specific purpose for it. Many libraries that deal with computational problems regarding any sort of waveform will have an FFT coded in the API that has been vetted by multiple software developers. <br />
<br />
To implement a general FFT in an Arduino here are the steps:<br />
<br />
1. Get your computer, arduino, usb-B cable ready<br />
<br />
2. download the Arduino coding terminal on your computer<br />
<br />
3. run the C++ code given below<br />
<br />
To really see it in action:<br />
<br />
1. Find a digital waveform (an audio signal, voltage signal, anything digital that can be modeled with sinusoids really)<br />
<br />
2. Pass that waveform in as the parameter of the FFT<br />
<br />
3. Print the output<br />
<br />
<br />
===Implementations in different languages===<br />
<br />
'''C++'''<br />
<br />
/* fft.cpp<br />
* <br />
* This is a KISS implementation of<br />
* the Cooley-Tukey recursive FFT algorithm.<br />
* This works, and is visibly clear about what is happening where.<br />
*<br />
* To compile this with the GNU/GCC compiler:<br />
* g++ -o fft fft.cpp -lm<br />
*<br />
* To run the compiled version from a *nix command line:<br />
* ./fft<br />
*<br />
*/<br />
#include <complex><br />
#include <cstdio><br />
<br />
#define M_PI 3.14159265358979323846 // Pi constant with double precision<br />
<br />
using namespace std;<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void separate (complex<double>* a, int n) {<br />
complex<double>* b = new complex<double>[n/2]; // get temp heap storage<br />
for(int i=0; i<n/2; i++) // copy all odd elements to heap storage<br />
b[i] = a[i*2+1];<br />
for(int i=0; i<n/2; i++) // copy all even elements to lower-half of a[]<br />
a[i] = a[i*2];<br />
for(int i=0; i<n/2; i++) // copy all odd (from heap) to upper-half of a[]<br />
a[i+n/2] = b[i];<br />
delete[] b; // delete heap storage<br />
}<br />
<br />
// N must be a power-of-2, or bad things will happen.<br />
// Currently no check for this condition.<br />
//<br />
// N input samples in X[] are FFT'd and results left in X[].<br />
// Because of Nyquist theorem, N samples means <br />
// only first N/2 FFT results in X[] are the answer.<br />
// (upper half of X[] is a reflection with no new information).<br />
void fft2 (complex<double>* X, int N) {<br />
if(N < 2) {<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
} else {<br />
separate(X,N); // all evens to lower half, all odds to upper half<br />
fft2(X, N/2); // recurse even items<br />
fft2(X+N/2, N/2); // recurse odd items<br />
// combine results of two half recursions<br />
for(int k=0; k<N/2; k++) {<br />
complex<double> e = X[k ]; // even<br />
complex<double> o = X[k+N/2]; // odd<br />
// w is the "twiddle-factor"<br />
complex<double> w = exp( complex<double>(0,-2.*M_PI*k/N) );<br />
X[k ] = e + w * o;<br />
X[k+N/2] = e - w * o;<br />
}<br />
}<br />
}<br />
<br />
// simple test program<br />
int main () {<br />
const int nSamples = 64;<br />
double nSeconds = 1.0; // total time for sampling<br />
double sampleRate = nSamples / nSeconds; // n Hz = n / second <br />
double freqResolution = sampleRate / nSamples; // freq step in FFT result<br />
complex<double> x[nSamples]; // storage for sample data<br />
complex<double> X[nSamples]; // storage for FFT answer<br />
const int nFreqs = 5;<br />
double freq[nFreqs] = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
<br />
// generate samples for testing<br />
for(int i=0; i<nSamples; i++) {<br />
x[i] = complex<double>(0.,0.);<br />
// sum several known sinusoids into x[]<br />
for(int j=0; j<nFreqs; j++)<br />
x[i] += sin( 2*M_PI*freq[j]*i/nSamples );<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
// compute fft for this data<br />
fft2(X,nSamples);<br />
<br />
printf(" n\tx[]\tX[]\tf\n"); // header line<br />
// loop to print values<br />
for(int i=0; i<nSamples; i++) {<br />
printf("% 3d\t%+.3f\t%+.3f\t%g\n",<br />
i, x[i].real(), abs(X[i]), i*freqResolution );<br />
}<br />
}<br />
<br />
<br />
'''C#'''<br />
<br />
using System;<br />
using System.Numerics;<br />
<br />
class FT<br />
{<br />
public Complex[] x; // storage for sample data<br />
public Complex[] X; // storage for FFT answer<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void Separate(ref Complex[] a, int m, int n)<br />
{<br />
Complex[] b = new Complex[(n - m) / 2];<br />
for (int i = 0; i < (n - m) / 2; i++) // copy all odd elements to b<br />
b[i] = a[m + i * 2 + 1];<br />
for (int i = 0; i < (n - m) / 2; i++) // copy all even elements to lower-half of a<br />
a[m + i] = a[m + i * 2];<br />
for (int i = 0; i < (n - m) / 2; i++) // copy all odd (from b) to upper-half of a[]<br />
a[m + i + (n - m) / 2] = b[i];<br />
}<br />
<br />
void FFT2(ref Complex[] X, int m, int n) // m: the first element of the array X<br />
// n - 1: the last element of the array X<br />
{<br />
if (n - m < 2)<br />
{<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
}<br />
else<br />
{<br />
Separate(ref X, m, n); // all evens to lower half, all odds to upper half<br />
FFT2(ref X, m, m + (n - m) / 2); // recurse even items<br />
FFT2(ref X, m + (n - m) / 2, n); // recurse odd items <br />
for (int k = 0; k < (n - m) / 2; k++)// combine results of two half recursions<br />
{<br />
Complex e = X[m + k]; // even<br />
Complex o = X[m + k + (n - m) / 2]; // odd <br />
Complex w = Complex.Exp(new Complex(0, -2 * Math.PI * k / (n - m))); // w is the "twiddle-factor"<br />
X[m + k] = e + w * o;<br />
X[m + k + (n - m) / 2] = e - w * o;<br />
}<br />
}<br />
}<br />
double signal(double t)<br />
{<br />
double[] freq = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
double sum = 0;<br />
for (int j = 0; j < freq.GetLength(0); j++) // sum several known sinusoids into x[]<br />
sum += Math.Sin(2 * Math.PI * freq[j] * t);<br />
return sum;<br />
}<br />
<br />
void Fill()<br />
{<br />
// generate samples for testing<br />
int N = x.Length;<br />
for (int i = 0; i < N; i++)<br />
{<br />
x[i] = signal((double)i / N);<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
}<br />
<br />
public FT(int N)<br />
{<br />
x = new Complex[N]; // storage for sample data<br />
X = new Complex[N]; // storage for FFT answer<br />
Fill(); <br />
FFT2(ref X, 0, N);<br />
}<br />
}<br />
<br />
class Program<br />
{<br />
static void Main()<br />
{<br />
int N = 64;<br />
FT ft = new FT(N);<br />
Console.WriteLine(" n\tx[]\tX[]\tf");<br />
for (int i = 0; i < N; i++)<br />
{<br />
Console.WriteLine(i.ToString() + "\t" + ft.x[i].Real.ToString("0.###") + "\t"<br />
+ Complex.Abs(ft.X[i]).ToString("0.###") + "\t" + i);<br />
}<br />
Console.ReadKey();<br />
}<br />
}<br />
<br />
===An Example===<br />
https://github.com/kosme/arduinoFFT/tree/master/Examples<br />
<br />
==Authors==<br />
*Jordan Gewirtz<br />
*Nish Chakraburtty<br />
*Chanel Lynn<br />
==Group Link==<br />
eBox project page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX here]<br />
<br />
eBox log page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log here]<br />
==External References==<br />
https://www.youtube.com/watch?v=spUNpyF58BY&t=21s<br />
<br />
https://www.algorithm-archive.org/contents/cooley_tukey/cooley_tukey.html<br />
<br />
https://www.youtube.com/watch?v=XtypWS8HZco&t=22s<br />
<br />
http://people.scs.carleton.ca/~maheshwa/courses/5703COMP/16Fall/FFT_Report.pdf<br />
<br />
https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino&diff=15237Fast Fourier Transform Library & Arduino2018-12-08T23:44:32Z<p>NishChakra: /* Process */</p>
<hr />
<div>== Overview==<br />
===Introduction===<br />
As the name suggests the Fast Fourier Transform Library enables for the timely computation of a signal's discrete Fourier transform. Instructions on how to download the latest release can be found [https://github.com/kosme/arduinoFFT here]. A fast Fourier transform (fFt) would be of interest to any wishing to take a signal or data set from the time domain to the frequency domain. <br />
[[Category:HowTos]]<br />
[[Category:Programming]]<br />
[[Category:Arduino]]<br />
<br />
==Materials & Prerequisites==<br />
===Materials===<br />
All items one needs to utilize an fFT with an Arduino are:<br />
*Computer<br />
*Arduino<br />
*USB connector<br />
<br />
===Prerequisites===<br />
Next download latest open-source Arduino Software [https://www.arduino.cc/en/Main/Software here].<br />
<br />
==Process==<br />
First, let's begin with a discussion of a general Fourier Transform (FT) and then we will address the Fast Fourier Transform (FFT). The Fourier transform is a mathematical function that decomposes a waveform, which is a function of time, into the frequencies that make it up. The result produced by the Fourier transform is a complex valued function of frequency. The absolute value of the Fourier transform represents the frequency value present in the original function and its complex argument represents the phase offset of the basic sinusoidal in that frequency.<br />
<br />
The Fourier transform is also called a generalization of the Fourier series. This term can also be applied to both the frequency domain representation and the mathematical function used. The Fourier transform helps in extending the Fourier series to non-periodic functions, which allows viewing any function as a sum of simple sinusoids. The definition of which is provided below. Note that we use the discrete time definition of the FT, or a Discrete Fourier Transform (DFT), and not the continuous time definition, the main difference between the two being a summation vs an integral. We make this choice because inputs into computers are discrete data points and not continuous so we can not use an integral, and by extension, we can't use the continuous time definition of the FT. <br />
<br />
The decomposition of functions into their respective frequencies is a very powerful and useful tool, however, an FT requires massive amounts of computational work. For those of you in computer science, an FT would take O(n^2) time. So although we want to use this tool it is computationally expensive. Or at least this was the case until J.W Cooley and John Tukey came on the scene. They came up with the aptly named Cooley–Tukey FFT algorithm which reduced the time cost on a DFT from O(n^2) to O(nlogn). It recursively breaks down the DFT into smaller DFTs and turns the summation into a dynamic programming problem. So we save on time but we increase our space complexity dramatically, however, due to the continued improvement in transistor technology, modern day computing, for all practical purposes, doesn't care about space complexity until it has to. An example of a field that has to would be computational biology, due to the vast number of different genes in existence that all need to be tested. But that's beside the point, let's continue our discussion of an FFT. <br />
<br />
The actual algorithm begins by splitting the matrix into two parts, one with all the even indexed elements, the other part with all the odd indexed elements. We continue spliting the matrices down in the same manner until we can perform a DFT on a manageable matrix. Another way to implement the split, rather than by the even-odd index convention, would be through a reversing the bit value of the array entry's index. You make the choice only on the language you program in; so choose the option that takes up less time to implement for the language. <br />
<br />
Coding it will look like: <br />
<br />
<br />
function cooley_tukey(x)<br />
<br />
N = length(x)<br />
<br />
if (N > 2)<br />
x_odd = cooley_tukey(x[1:2:N])<br />
<br />
x_even = cooley_tukey(x[2:2:N])<br />
else<br />
x_odd = x[1]<br />
<br />
x_even = x[2]<br />
end<br />
n = 0:N-1<br />
<br />
half = div(N,2)<br />
<br />
factor = exp.(-2im*pi*n/N)<br />
<br />
return vcat(x_odd .+ x_even .* factor[1:half], x_odd .- x_even .* factor[1:half])<br />
<br />
end<br />
<br />
Below you can see some classic implementations in other languages, but as you can see the actual implementation is incredibly difficult. You can find an example of a custom FFT at the bottom. Typically one would not code an FFT from scratch unless you had a very specific purpose for it. Many libraries that deal with computational problems regarding any sort of waveform will have an FFT coded in the API that has been vetted by multiple software developers. <br />
<br />
<br />
<br />
<br />
===Implementations in different languages===<br />
<br />
'''C++'''<br />
<br />
/* fft.cpp<br />
* <br />
* This is a KISS implementation of<br />
* the Cooley-Tukey recursive FFT algorithm.<br />
* This works, and is visibly clear about what is happening where.<br />
*<br />
* To compile this with the GNU/GCC compiler:<br />
* g++ -o fft fft.cpp -lm<br />
*<br />
* To run the compiled version from a *nix command line:<br />
* ./fft<br />
*<br />
*/<br />
#include <complex><br />
#include <cstdio><br />
<br />
#define M_PI 3.14159265358979323846 // Pi constant with double precision<br />
<br />
using namespace std;<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void separate (complex<double>* a, int n) {<br />
complex<double>* b = new complex<double>[n/2]; // get temp heap storage<br />
for(int i=0; i<n/2; i++) // copy all odd elements to heap storage<br />
b[i] = a[i*2+1];<br />
for(int i=0; i<n/2; i++) // copy all even elements to lower-half of a[]<br />
a[i] = a[i*2];<br />
for(int i=0; i<n/2; i++) // copy all odd (from heap) to upper-half of a[]<br />
a[i+n/2] = b[i];<br />
delete[] b; // delete heap storage<br />
}<br />
<br />
// N must be a power-of-2, or bad things will happen.<br />
// Currently no check for this condition.<br />
//<br />
// N input samples in X[] are FFT'd and results left in X[].<br />
// Because of Nyquist theorem, N samples means <br />
// only first N/2 FFT results in X[] are the answer.<br />
// (upper half of X[] is a reflection with no new information).<br />
void fft2 (complex<double>* X, int N) {<br />
if(N < 2) {<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
} else {<br />
separate(X,N); // all evens to lower half, all odds to upper half<br />
fft2(X, N/2); // recurse even items<br />
fft2(X+N/2, N/2); // recurse odd items<br />
// combine results of two half recursions<br />
for(int k=0; k<N/2; k++) {<br />
complex<double> e = X[k ]; // even<br />
complex<double> o = X[k+N/2]; // odd<br />
// w is the "twiddle-factor"<br />
complex<double> w = exp( complex<double>(0,-2.*M_PI*k/N) );<br />
X[k ] = e + w * o;<br />
X[k+N/2] = e - w * o;<br />
}<br />
}<br />
}<br />
<br />
// simple test program<br />
int main () {<br />
const int nSamples = 64;<br />
double nSeconds = 1.0; // total time for sampling<br />
double sampleRate = nSamples / nSeconds; // n Hz = n / second <br />
double freqResolution = sampleRate / nSamples; // freq step in FFT result<br />
complex<double> x[nSamples]; // storage for sample data<br />
complex<double> X[nSamples]; // storage for FFT answer<br />
const int nFreqs = 5;<br />
double freq[nFreqs] = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
<br />
// generate samples for testing<br />
for(int i=0; i<nSamples; i++) {<br />
x[i] = complex<double>(0.,0.);<br />
// sum several known sinusoids into x[]<br />
for(int j=0; j<nFreqs; j++)<br />
x[i] += sin( 2*M_PI*freq[j]*i/nSamples );<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
// compute fft for this data<br />
fft2(X,nSamples);<br />
<br />
printf(" n\tx[]\tX[]\tf\n"); // header line<br />
// loop to print values<br />
for(int i=0; i<nSamples; i++) {<br />
printf("% 3d\t%+.3f\t%+.3f\t%g\n",<br />
i, x[i].real(), abs(X[i]), i*freqResolution );<br />
}<br />
}<br />
<br />
<br />
'''C#'''<br />
<br />
using System;<br />
using System.Numerics;<br />
<br />
class FT<br />
{<br />
public Complex[] x; // storage for sample data<br />
public Complex[] X; // storage for FFT answer<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void Separate(ref Complex[] a, int m, int n)<br />
{<br />
Complex[] b = new Complex[(n - m) / 2];<br />
for (int i = 0; i < (n - m) / 2; i++) // copy all odd elements to b<br />
b[i] = a[m + i * 2 + 1];<br />
for (int i = 0; i < (n - m) / 2; i++) // copy all even elements to lower-half of a<br />
a[m + i] = a[m + i * 2];<br />
for (int i = 0; i < (n - m) / 2; i++) // copy all odd (from b) to upper-half of a[]<br />
a[m + i + (n - m) / 2] = b[i];<br />
}<br />
<br />
void FFT2(ref Complex[] X, int m, int n) // m: the first element of the array X<br />
// n - 1: the last element of the array X<br />
{<br />
if (n - m < 2)<br />
{<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
}<br />
else<br />
{<br />
Separate(ref X, m, n); // all evens to lower half, all odds to upper half<br />
FFT2(ref X, m, m + (n - m) / 2); // recurse even items<br />
FFT2(ref X, m + (n - m) / 2, n); // recurse odd items <br />
for (int k = 0; k < (n - m) / 2; k++)// combine results of two half recursions<br />
{<br />
Complex e = X[m + k]; // even<br />
Complex o = X[m + k + (n - m) / 2]; // odd <br />
Complex w = Complex.Exp(new Complex(0, -2 * Math.PI * k / (n - m))); // w is the "twiddle-factor"<br />
X[m + k] = e + w * o;<br />
X[m + k + (n - m) / 2] = e - w * o;<br />
}<br />
}<br />
}<br />
double signal(double t)<br />
{<br />
double[] freq = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
double sum = 0;<br />
for (int j = 0; j < freq.GetLength(0); j++) // sum several known sinusoids into x[]<br />
sum += Math.Sin(2 * Math.PI * freq[j] * t);<br />
return sum;<br />
}<br />
<br />
void Fill()<br />
{<br />
// generate samples for testing<br />
int N = x.Length;<br />
for (int i = 0; i < N; i++)<br />
{<br />
x[i] = signal((double)i / N);<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
}<br />
<br />
public FT(int N)<br />
{<br />
x = new Complex[N]; // storage for sample data<br />
X = new Complex[N]; // storage for FFT answer<br />
Fill(); <br />
FFT2(ref X, 0, N);<br />
}<br />
}<br />
<br />
class Program<br />
{<br />
static void Main()<br />
{<br />
int N = 64;<br />
FT ft = new FT(N);<br />
Console.WriteLine(" n\tx[]\tX[]\tf");<br />
for (int i = 0; i < N; i++)<br />
{<br />
Console.WriteLine(i.ToString() + "\t" + ft.x[i].Real.ToString("0.###") + "\t"<br />
+ Complex.Abs(ft.X[i]).ToString("0.###") + "\t" + i);<br />
}<br />
Console.ReadKey();<br />
}<br />
}<br />
<br />
===An Example===<br />
https://github.com/kosme/arduinoFFT/tree/master/Examples<br />
<br />
==Authors==<br />
*Jordan Gewirtz<br />
*Nish Chakraburtty<br />
*Chanel Lynn<br />
==Group Link==<br />
eBox project page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX here]<br />
<br />
eBox log page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log here]<br />
==External References==<br />
https://www.youtube.com/watch?v=spUNpyF58BY&t=21s<br />
<br />
https://www.algorithm-archive.org/contents/cooley_tukey/cooley_tukey.html<br />
<br />
https://www.youtube.com/watch?v=XtypWS8HZco&t=22s<br />
<br />
http://people.scs.carleton.ca/~maheshwa/courses/5703COMP/16Fall/FFT_Report.pdf<br />
<br />
https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino&diff=15236Fast Fourier Transform Library & Arduino2018-12-08T23:41:04Z<p>NishChakra: /* Process */</p>
<hr />
<div>== Overview==<br />
===Introduction===<br />
As the name suggests the Fast Fourier Transform Library enables for the timely computation of a signal's discrete Fourier transform. Instructions on how to download the latest release can be found [https://github.com/kosme/arduinoFFT here]. A fast Fourier transform (fFt) would be of interest to any wishing to take a signal or data set from the time domain to the frequency domain. <br />
[[Category:HowTos]]<br />
[[Category:Programming]]<br />
[[Category:Arduino]]<br />
<br />
==Materials & Prerequisites==<br />
===Materials===<br />
All items one needs to utilize an fFT with an Arduino are:<br />
*Computer<br />
*Arduino<br />
*USB connector<br />
<br />
===Prerequisites===<br />
Next download latest open-source Arduino Software [https://www.arduino.cc/en/Main/Software here].<br />
<br />
==Process==<br />
First, let's begin with a discussion of a general Fourier Transform (FT) and then we will address the Fast Fourier Transform (FFT). The Fourier transform is a mathematical function that decomposes a waveform, which is a function of time, into the frequencies that make it up. The result produced by the Fourier transform is a complex valued function of frequency. The absolute value of the Fourier transform represents the frequency value present in the original function and its complex argument represents the phase offset of the basic sinusoidal in that frequency.<br />
<br />
The Fourier transform is also called a generalization of the Fourier series. This term can also be applied to both the frequency domain representation and the mathematical function used. The Fourier transform helps in extending the Fourier series to non-periodic functions, which allows viewing any function as a sum of simple sinusoids. The definition of which is provided below. Note that we use the discrete time definition of the FT, or a Discrete Fourier Transform (DFT), and not the continuous time definition, the main difference between the two being a summation vs an integral. We make this choice because inputs into computers are discrete data points and not continuous so we can not use an integral, and by extension, we can't use the continuous time definition of the FT. <br />
<br />
The decomposition of functions into their respective frequencies is a very powerful and useful tool, however, an FT requires massive amounts of computational work. For those of you in computer science, an FT would take O(n^2) time. So although we want to use this tool it is computationally expensive. Or at least this was the case until J.W Cooley and John Tukey came on the scene. They came up with the aptly named Cooley–Tukey FFT algorithm which reduced the time cost on a DFT from O(n^2) to O(nlogn). It recursively breaks down the DFT into smaller DFTs and turns the summation into a dynamic programming problem. So we save on time but we increase our space complexity dramatically, however, due to the continued improvement in transistor technology, modern day computing, for all practical purposes, doesn't care about space complexity until it has to. An example of a field that has to would be computational biology, due to the vast number of different genes in existence that all need to be tested. But that's beside the point, let's continue our discussion of an FFT. <br />
<br />
The actual algorithm begins by splitting the matrix into two parts, one with all the even indexed elements, the other part with all the odd indexed elements. We continue spliting the matrices down in the same manner until we can perform a DFT on a manageable matrix. Another way to implement the split, rather than by the even-odd index convention, would be through a reversing the bit value of the array entry's index. You make the choice only on the language you program in; so choose the option that takes up less time to implement for the language. <br />
<br />
Coding it will look like: <br />
<br />
<br />
function cooley_tukey(x)<br />
<br />
N = length(x)<br />
<br />
if (N > 2)<br />
x_odd = cooley_tukey(x[1:2:N])<br />
<br />
x_even = cooley_tukey(x[2:2:N])<br />
else<br />
x_odd = x[1]<br />
<br />
x_even = x[2]<br />
end<br />
n = 0:N-1<br />
<br />
half = div(N,2)<br />
<br />
factor = exp.(-2im*pi*n/N)<br />
<br />
return vcat(x_odd .+ x_even .* factor[1:half], x_odd .- x_even .* factor[1:half])<br />
<br />
end<br />
<br />
===An Example===<br />
https://github.com/kosme/arduinoFFT/tree/master/Examples<br />
<br />
<br />
===Implementations in different languages===<br />
<br />
'''C++'''<br />
<br />
/* fft.cpp<br />
* <br />
* This is a KISS implementation of<br />
* the Cooley-Tukey recursive FFT algorithm.<br />
* This works, and is visibly clear about what is happening where.<br />
*<br />
* To compile this with the GNU/GCC compiler:<br />
* g++ -o fft fft.cpp -lm<br />
*<br />
* To run the compiled version from a *nix command line:<br />
* ./fft<br />
*<br />
*/<br />
#include <complex><br />
#include <cstdio><br />
<br />
#define M_PI 3.14159265358979323846 // Pi constant with double precision<br />
<br />
using namespace std;<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void separate (complex<double>* a, int n) {<br />
complex<double>* b = new complex<double>[n/2]; // get temp heap storage<br />
for(int i=0; i<n/2; i++) // copy all odd elements to heap storage<br />
b[i] = a[i*2+1];<br />
for(int i=0; i<n/2; i++) // copy all even elements to lower-half of a[]<br />
a[i] = a[i*2];<br />
for(int i=0; i<n/2; i++) // copy all odd (from heap) to upper-half of a[]<br />
a[i+n/2] = b[i];<br />
delete[] b; // delete heap storage<br />
}<br />
<br />
// N must be a power-of-2, or bad things will happen.<br />
// Currently no check for this condition.<br />
//<br />
// N input samples in X[] are FFT'd and results left in X[].<br />
// Because of Nyquist theorem, N samples means <br />
// only first N/2 FFT results in X[] are the answer.<br />
// (upper half of X[] is a reflection with no new information).<br />
void fft2 (complex<double>* X, int N) {<br />
if(N < 2) {<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
} else {<br />
separate(X,N); // all evens to lower half, all odds to upper half<br />
fft2(X, N/2); // recurse even items<br />
fft2(X+N/2, N/2); // recurse odd items<br />
// combine results of two half recursions<br />
for(int k=0; k<N/2; k++) {<br />
complex<double> e = X[k ]; // even<br />
complex<double> o = X[k+N/2]; // odd<br />
// w is the "twiddle-factor"<br />
complex<double> w = exp( complex<double>(0,-2.*M_PI*k/N) );<br />
X[k ] = e + w * o;<br />
X[k+N/2] = e - w * o;<br />
}<br />
}<br />
}<br />
<br />
// simple test program<br />
int main () {<br />
const int nSamples = 64;<br />
double nSeconds = 1.0; // total time for sampling<br />
double sampleRate = nSamples / nSeconds; // n Hz = n / second <br />
double freqResolution = sampleRate / nSamples; // freq step in FFT result<br />
complex<double> x[nSamples]; // storage for sample data<br />
complex<double> X[nSamples]; // storage for FFT answer<br />
const int nFreqs = 5;<br />
double freq[nFreqs] = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
<br />
// generate samples for testing<br />
for(int i=0; i<nSamples; i++) {<br />
x[i] = complex<double>(0.,0.);<br />
// sum several known sinusoids into x[]<br />
for(int j=0; j<nFreqs; j++)<br />
x[i] += sin( 2*M_PI*freq[j]*i/nSamples );<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
// compute fft for this data<br />
fft2(X,nSamples);<br />
<br />
printf(" n\tx[]\tX[]\tf\n"); // header line<br />
// loop to print values<br />
for(int i=0; i<nSamples; i++) {<br />
printf("% 3d\t%+.3f\t%+.3f\t%g\n",<br />
i, x[i].real(), abs(X[i]), i*freqResolution );<br />
}<br />
}<br />
<br />
<br />
'''C#'''<br />
<br />
using System;<br />
using System.Numerics;<br />
<br />
class FT<br />
{<br />
public Complex[] x; // storage for sample data<br />
public Complex[] X; // storage for FFT answer<br />
<br />
// separate even/odd elements to lower/upper halves of array respectively.<br />
// Due to Butterfly combinations, this turns out to be the simplest way <br />
// to get the job done without clobbering the wrong elements.<br />
void Separate(ref Complex[] a, int m, int n)<br />
{<br />
Complex[] b = new Complex[(n - m) / 2];<br />
for (int i = 0; i < (n - m) / 2; i++) // copy all odd elements to b<br />
b[i] = a[m + i * 2 + 1];<br />
for (int i = 0; i < (n - m) / 2; i++) // copy all even elements to lower-half of a<br />
a[m + i] = a[m + i * 2];<br />
for (int i = 0; i < (n - m) / 2; i++) // copy all odd (from b) to upper-half of a[]<br />
a[m + i + (n - m) / 2] = b[i];<br />
}<br />
<br />
void FFT2(ref Complex[] X, int m, int n) // m: the first element of the array X<br />
// n - 1: the last element of the array X<br />
{<br />
if (n - m < 2)<br />
{<br />
// bottom of recursion.<br />
// Do nothing here, because already X[0] = x[0]<br />
}<br />
else<br />
{<br />
Separate(ref X, m, n); // all evens to lower half, all odds to upper half<br />
FFT2(ref X, m, m + (n - m) / 2); // recurse even items<br />
FFT2(ref X, m + (n - m) / 2, n); // recurse odd items <br />
for (int k = 0; k < (n - m) / 2; k++)// combine results of two half recursions<br />
{<br />
Complex e = X[m + k]; // even<br />
Complex o = X[m + k + (n - m) / 2]; // odd <br />
Complex w = Complex.Exp(new Complex(0, -2 * Math.PI * k / (n - m))); // w is the "twiddle-factor"<br />
X[m + k] = e + w * o;<br />
X[m + k + (n - m) / 2] = e - w * o;<br />
}<br />
}<br />
}<br />
double signal(double t)<br />
{<br />
double[] freq = { 2, 5, 11, 17, 29 }; // known freqs for testing<br />
double sum = 0;<br />
for (int j = 0; j < freq.GetLength(0); j++) // sum several known sinusoids into x[]<br />
sum += Math.Sin(2 * Math.PI * freq[j] * t);<br />
return sum;<br />
}<br />
<br />
void Fill()<br />
{<br />
// generate samples for testing<br />
int N = x.Length;<br />
for (int i = 0; i < N; i++)<br />
{<br />
x[i] = signal((double)i / N);<br />
X[i] = x[i]; // copy into X[] for FFT work & result<br />
}<br />
}<br />
<br />
public FT(int N)<br />
{<br />
x = new Complex[N]; // storage for sample data<br />
X = new Complex[N]; // storage for FFT answer<br />
Fill(); <br />
FFT2(ref X, 0, N);<br />
}<br />
}<br />
<br />
class Program<br />
{<br />
static void Main()<br />
{<br />
int N = 64;<br />
FT ft = new FT(N);<br />
Console.WriteLine(" n\tx[]\tX[]\tf");<br />
for (int i = 0; i < N; i++)<br />
{<br />
Console.WriteLine(i.ToString() + "\t" + ft.x[i].Real.ToString("0.###") + "\t"<br />
+ Complex.Abs(ft.X[i]).ToString("0.###") + "\t" + i);<br />
}<br />
Console.ReadKey();<br />
}<br />
}<br />
<br />
==Authors==<br />
*Jordan Gewirtz<br />
*Nish Chakraburtty<br />
*Chanel Lynn<br />
==Group Link==<br />
eBox project page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX here]<br />
<br />
eBox log page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log here]<br />
==External References==<br />
https://www.youtube.com/watch?v=spUNpyF58BY&t=21s<br />
<br />
https://www.algorithm-archive.org/contents/cooley_tukey/cooley_tukey.html<br />
<br />
https://www.youtube.com/watch?v=XtypWS8HZco&t=22s<br />
<br />
http://people.scs.carleton.ca/~maheshwa/courses/5703COMP/16Fall/FFT_Report.pdf<br />
<br />
https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino&diff=15235Fast Fourier Transform Library & Arduino2018-12-08T23:37:51Z<p>NishChakra: /* External References */</p>
<hr />
<div>== Overview==<br />
===Introduction===<br />
As the name suggests the Fast Fourier Transform Library enables for the timely computation of a signal's discrete Fourier transform. Instructions on how to download the latest release can be found [https://github.com/kosme/arduinoFFT here]. A fast Fourier transform (fFt) would be of interest to any wishing to take a signal or data set from the time domain to the frequency domain. <br />
[[Category:HowTos]]<br />
[[Category:Programming]]<br />
[[Category:Arduino]]<br />
<br />
==Materials & Prerequisites==<br />
===Materials===<br />
All items one needs to utilize an fFT with an Arduino are:<br />
*Computer<br />
*Arduino<br />
*USB connector<br />
<br />
===Prerequisites===<br />
Next download latest open-source Arduino Software [https://www.arduino.cc/en/Main/Software here].<br />
<br />
==Process==<br />
First, let's begin with a discussion of a general Fourier Transform (FT) and then we will address the Fast Fourier Transform (FFT). The Fourier transform is a mathematical function that decomposes a waveform, which is a function of time, into the frequencies that make it up. The result produced by the Fourier transform is a complex valued function of frequency. The absolute value of the Fourier transform represents the frequency value present in the original function and its complex argument represents the phase offset of the basic sinusoidal in that frequency.<br />
<br />
The Fourier transform is also called a generalization of the Fourier series. This term can also be applied to both the frequency domain representation and the mathematical function used. The Fourier transform helps in extending the Fourier series to non-periodic functions, which allows viewing any function as a sum of simple sinusoids. The definition of which is provided below. Note that we use the discrete time definition of the FT, or a Discrete Fourier Transform (DFT), and not the continuous time definition, the main difference between the two being a summation vs an integral. We make this choice because inputs into computers are discrete data points and not continuous so we can not use an integral, and by extension, we can't use the continuous time definition of the FT. <br />
<br />
The decomposition of functions into their respective frequencies is a very powerful and useful tool, however, an FT requires massive amounts of computational work. For those of you in computer science, an FT would take O(n^2) time. So although we want to use this tool it is computationally expensive. Or at least this was the case until J.W Cooley and John Tukey came on the scene. They came up with the aptly named Cooley–Tukey FFT algorithm which reduced the time cost on a DFT from O(n^2) to O(nlogn). It recursively breaks down the DFT into smaller DFTs and turns the summation into a dynamic programming problem. So we save on time but we increase our space complexity dramatically, however, due to the continued improvement in transistor technology, modern day computing, for all practical purposes, doesn't care about space complexity until it has to. An example of a field that has to would be computational biology, due to the vast number of different genes in existence that all need to be tested. But that's beside the point, let's continue our discussion of an FFT. <br />
<br />
The actual algorithm begins by splitting the matrix into two parts, one with all the even indexed elements, the other part with all the odd indexed elements. We continue spliting the matrices down in the same manner until we can perform a DFT on a manageable matrix. Another way to implement the split, rather than by the even-odd index convention, would be through a reversing the bit value of the array entry's index. You make the choice only on the language you program in; so choose the option that takes up less time to implement for the language. <br />
<br />
Coding it will look like: <br />
<br />
<br />
function cooley_tukey(x)<br />
<br />
N = length(x)<br />
<br />
if (N > 2)<br />
x_odd = cooley_tukey(x[1:2:N])<br />
<br />
x_even = cooley_tukey(x[2:2:N])<br />
else<br />
x_odd = x[1]<br />
<br />
x_even = x[2]<br />
end<br />
n = 0:N-1<br />
<br />
half = div(N,2)<br />
<br />
factor = exp.(-2im*pi*n/N)<br />
<br />
return vcat(x_odd .+ x_even .* factor[1:half], x_odd .- x_even .* factor[1:half])<br />
<br />
end<br />
<br />
===An Example===<br />
https://github.com/kosme/arduinoFFT/tree/master/Examples<br />
<br />
==Authors==<br />
*Jordan Gewirtz<br />
*Nish Chakraburtty<br />
*Chanel Lynn<br />
==Group Link==<br />
eBox project page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX here]<br />
<br />
eBox log page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log here]<br />
==External References==<br />
https://www.youtube.com/watch?v=spUNpyF58BY&t=21s<br />
<br />
https://www.algorithm-archive.org/contents/cooley_tukey/cooley_tukey.html<br />
<br />
https://www.youtube.com/watch?v=XtypWS8HZco&t=22s<br />
<br />
http://people.scs.carleton.ca/~maheshwa/courses/5703COMP/16Fall/FFT_Report.pdf<br />
<br />
https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino&diff=15234Fast Fourier Transform Library & Arduino2018-12-08T23:35:46Z<p>NishChakra: /* Process */</p>
<hr />
<div>== Overview==<br />
===Introduction===<br />
As the name suggests the Fast Fourier Transform Library enables for the timely computation of a signal's discrete Fourier transform. Instructions on how to download the latest release can be found [https://github.com/kosme/arduinoFFT here]. A fast Fourier transform (fFt) would be of interest to any wishing to take a signal or data set from the time domain to the frequency domain. <br />
[[Category:HowTos]]<br />
[[Category:Programming]]<br />
[[Category:Arduino]]<br />
<br />
==Materials & Prerequisites==<br />
===Materials===<br />
All items one needs to utilize an fFT with an Arduino are:<br />
*Computer<br />
*Arduino<br />
*USB connector<br />
<br />
===Prerequisites===<br />
Next download latest open-source Arduino Software [https://www.arduino.cc/en/Main/Software here].<br />
<br />
==Process==<br />
First, let's begin with a discussion of a general Fourier Transform (FT) and then we will address the Fast Fourier Transform (FFT). The Fourier transform is a mathematical function that decomposes a waveform, which is a function of time, into the frequencies that make it up. The result produced by the Fourier transform is a complex valued function of frequency. The absolute value of the Fourier transform represents the frequency value present in the original function and its complex argument represents the phase offset of the basic sinusoidal in that frequency.<br />
<br />
The Fourier transform is also called a generalization of the Fourier series. This term can also be applied to both the frequency domain representation and the mathematical function used. The Fourier transform helps in extending the Fourier series to non-periodic functions, which allows viewing any function as a sum of simple sinusoids. The definition of which is provided below. Note that we use the discrete time definition of the FT, or a Discrete Fourier Transform (DFT), and not the continuous time definition, the main difference between the two being a summation vs an integral. We make this choice because inputs into computers are discrete data points and not continuous so we can not use an integral, and by extension, we can't use the continuous time definition of the FT. <br />
<br />
The decomposition of functions into their respective frequencies is a very powerful and useful tool, however, an FT requires massive amounts of computational work. For those of you in computer science, an FT would take O(n^2) time. So although we want to use this tool it is computationally expensive. Or at least this was the case until J.W Cooley and John Tukey came on the scene. They came up with the aptly named Cooley–Tukey FFT algorithm which reduced the time cost on a DFT from O(n^2) to O(nlogn). It recursively breaks down the DFT into smaller DFTs and turns the summation into a dynamic programming problem. So we save on time but we increase our space complexity dramatically, however, due to the continued improvement in transistor technology, modern day computing, for all practical purposes, doesn't care about space complexity until it has to. An example of a field that has to would be computational biology, due to the vast number of different genes in existence that all need to be tested. But that's beside the point, let's continue our discussion of an FFT. <br />
<br />
The actual algorithm begins by splitting the matrix into two parts, one with all the even indexed elements, the other part with all the odd indexed elements. We continue spliting the matrices down in the same manner until we can perform a DFT on a manageable matrix. Another way to implement the split, rather than by the even-odd index convention, would be through a reversing the bit value of the array entry's index. You make the choice only on the language you program in; so choose the option that takes up less time to implement for the language. <br />
<br />
Coding it will look like: <br />
<br />
<br />
function cooley_tukey(x)<br />
<br />
N = length(x)<br />
<br />
if (N > 2)<br />
x_odd = cooley_tukey(x[1:2:N])<br />
<br />
x_even = cooley_tukey(x[2:2:N])<br />
else<br />
x_odd = x[1]<br />
<br />
x_even = x[2]<br />
end<br />
n = 0:N-1<br />
<br />
half = div(N,2)<br />
<br />
factor = exp.(-2im*pi*n/N)<br />
<br />
return vcat(x_odd .+ x_even .* factor[1:half], x_odd .- x_even .* factor[1:half])<br />
<br />
end<br />
<br />
===An Example===<br />
https://github.com/kosme/arduinoFFT/tree/master/Examples<br />
<br />
==Authors==<br />
*Jordan Gewirtz<br />
*Nish Chakraburtty<br />
*Chanel Lynn<br />
==Group Link==<br />
eBox project page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX here]<br />
<br />
eBox log page [https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log here]<br />
==External References==</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=15231EBOX2018-12-08T22:52:29Z<p>NishChakra: /* The Software */</p>
<hr />
<div>== Project Proposal ==<br />
=== Overview ===<br />
We created an audio responsive LED lighting system integrated on a desk that can be used as a fun addition to one's home entertainment and lighting systems. The EBOX has 3 modes that the user can set with a tap of a touch sensor to customize the dynamic light patterns to fit any mood.<br />
<br />
=== Group Members ===<br />
Jordan Gewirtz<br />
<br />
Chanel Lynn<br />
<br />
Nish Chakraburtty<br />
<br />
Tony Sancho-Spore (TA)<br />
<br />
Dr. James Feher (Prof)<br />
<br />
===Link to Log===<br />
*[[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
*eBOX WUSTL BOX: https://wustl.app.box.com/folder/57307264614]<br />
*Link to tutorial [https://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino#Materials_.26_Prerequisites here]<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
*User interface<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Soldering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
*Staying under budget<br />
<br />
=== Gantt Chart ===<br />
<br />
<gallery><br />
Gantt Chart (Rev 3).png| Gantt Chart<br />
</gallery><br />
<br />
=== Budget ===<br />
{| class = "wikitable sortable" {{table}}<br />
| align="center" style="background:#f0f0f0;"|'''Item'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price: Actual (Including Shipping)'''<br />
|-<br />
| Arduino [https://store.arduino.cc/usa/arduino-uno-rev3 (Link)]||1||1|| $22.00 ||$0.00 (Provided by TA)|| $22.00 || $0.00<br />
|-<br />
| Transistors [https://www.mouser.com/ProductDetail/ON-Semiconductor-Fairchild/BC547B?qs=UMEuL5FsraB3zD25tclGGQ%3D%3D&gclid=Cj0KCQjwxvbdBRC0ARIsAKmec9aPrjnMgL2Z2kN_UUj-lH33KsgSWltRarCH75kZdbScUbCfsbLc_NUaAjMkEALw_wcB (Link)]||10|||| $0.06 |||| $0.60 ||$0.00 (Provided by TA)<br />
|-<br />
| LED (strips - 6ft) [https://www.amazon.com/Flexible-Daylight-Kitchen-Christmas-Non-waterproof/dp/B00HSF65MC (Link)]||1||1|| $21.99 |||| $21.99 ||<br />
|-<br />
| Arduino Microphone [https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all (Link)]||10||10|| $0.88 ||$0.69|| $8.88 || $6.90<br />
|-<br />
| Table [https://www.ikea.com/us/en/catalog/products/40303444/#/80221352 (Link)] ||1||1|| $39.99 ||$39.99|| $39.99 || $43.86 <br />
|-<br />
|Capacitive Touch Sensors [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen (Link)]|| - || 5 || - || $1.40 || - || $6.99<br />
|-<br />
| Total||14|||||||| $48.78 ||<br />
|}<br />
<br />
== Design And Solutions ==<br />
<br />
=== Steps to Build the EBOX ===<br />
<br />
1. Program the color patterns<br />
<br />
2. Upload the code to the Arduino<br />
<br />
3. Plug leads into the hardware<br />
<br />
4. Solder external power source to lights and Arduino<br />
<br />
5. CAD box to hold the hardware<br />
<br />
6. Assemble table<br />
<br />
7. Secure lights around the underside of the table<br />
<br />
8. Plug in power source adapter to an outlet, place a speaker near the microphone, and enjoy!<br />
<br />
=== Components ===<br />
<br />
LED Light Strip (6ft)<br />
<br />
Arduino Uno<br />
<br />
Capacitive touch sensor<br />
<br />
Sound Detection Sensor Module (Microphone)<br />
<br />
Desk with glass or translucent top<br />
<br />
5V Power adapter<br />
<br />
Leads (wires)<br />
<br />
=== The Software ===<br />
<br />
We wanted to use a Fast Fourier Transform (FFT) in our project implementation as music is just the superposition of a bunch of different frequencies and an FFT would allow us to easily map each superposition to a numeral. <br />
A Fourier Transform is a transformation of a function of time into the frequencies that make it up, but a Fast Fourier Transform is an algorithm that computes the same result but in O(nlogn) time rather than O(n^2) by factorizing the discrete Fourier transform matrix into a product of mostly zeros. We downloaded a Fast Fourier Transform Library ('''referecne/link library''') from an open source to translate the analog sound signals into digital signals with this decrease complexity to allow for a quick response to the audio input. Music or other forms of audio are inputted to the system through the Arduino microphone and the Arduino is programmed to take those analog signals into the FFT (Fast Fourier Transform) operations and the output is series of frequencies in the range of 0-720.<br />
<br />
We imported the FastLED library from the Arduino library database. <br />
<br />
Basic implementation idea:<br />
<br />
Psuedocode:<br />
<br />
First we have to import the library and declare all of our global variables. <br />
make the array that holds the LEDS<br />
<br />
Setup{<br />
<br />
instantiate your power, ground, and digital read pins<br />
<br />
initialize your led strip in order to use the Library <br />
<br />
For (0->numLeds){<br />
address each LED in the Array <br />
}<br />
Show the lights<br />
add a delay so it's not constantly reading<br />
call your average function<br />
}<br />
<br />
<br />
<br />
Main{<br />
Check the counter (Touch Sensor)<br />
Reset the color mode (Options method)<br />
}<br />
<br />
Options{<br />
if (counter value is a certain value){<br />
put it in a cetain mode<br />
}<br />
}<br />
<br />
TouchSensor{<br />
Instantiate the touch sensor and have a counter associated with it mods by the number of options you want to instantiate<br />
}<br />
<br />
Average{<br />
Here you can design the running average that takes in multiple milliseconds of microphone sensor inputs and spits out one value<br />
}<br />
<br />
White mode{<br />
set the lights to white (all rgb values are present in equal amounts)<br />
}<br />
<br />
Off{<br />
set the rgb values to 0<br />
}<br />
<br />
Party mode{<br />
Take a real-time average from the sensor value directly to decide whether or not a big shift in the music has happened (like a drop)<br />
<br />
Use that average to decide if you are in a certain song mode (if you're in the middle of a drop[large] or if you're chilling[normal])<br />
<br />
For each song mode set up if statements that take the running average of values from the average function and if that average is in a certain range then incerement the rgb values on the leds a certain way<br />
<br />
For ( each LED)<br />
increment each rgb value<br />
check the extremes for each LED color <br />
if it goes past 255 (in our case 150) mod the value<br />
if it goes below 0 reset it to 0<br />
else you're good<br />
<br />
}<br />
<br />
<br />
<br />
Explanation of the concept:<br />
<br />
First light up the strip to instantiate the strip. From then we want music responsiveness so we have to have input coming from the microphone. After we get an input we use the FFT to convert it into value. From that frequency value, we can quantify the relative intensity of the music. However, since the microphone is picking up an obscene amount of inputs per second we should take an average every few milliseconds to get a value that we use to change the LED's color so the Arduino doesn't have to do a ridiculous amount of work by changing colors for every single input value (the Arduino would require too much power and circuits would fry). Based on the value increment the RGB value of each LED a certain way (so whether or not 100 corresponds to purple, yellow, or blue and the intensity of that color is up to you). Make sure that the values of each RGB index for each LED has a edge case condition on incrementing the value (the max value for any RGB index is 255 so if you have a bunch of inputs all the RGB values will max out and turn to white light, so you need to make sure that the RGB values mod by 255, or a lower value if you need to draw less power, so that once it hits max red, blue, or green it can reset and keep its dynamics). Now that we have music responsive lights we have to code more modes. In order to do this while allowing for user input to change the modes we employed a touch sensor (any type digital input sensor will work). The touch sensor is binary with it either being touched or not touched. We then instantiate a counter that increments up everytime the sensor is touched. We also include in the counter definition a modular wrap around (like the wrap around in the lights) that mods by the number of modes. Now the counter will only exist as a number between 0 and (numModes -1). We then if statements in our main method: if counter is a certain value then party mode, other value then desk mode, ect...<br />
<br />
=== The Electronics ===<br />
====Background====<br />
The electronics that eBOX contains includes an Arduino Uno [https://store.arduino.cc/usa/arduino-uno-rev3], a WS2812B LED strip [https://randomnerdtutorials.com/guide-for-ws2812b-addressable-rgb-led-strip-with-arduino/] , a KY-038 4 pin microphone [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino] , and a TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/] [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen] , all of which is soldered up to an external power source that has a standard [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] wall outlet adapter.<br />
<br />
====Design Considerations & Challenges Faced====<br />
As discussed in the Software section of this wiki, the Arduino functions as the operator of eBOX. It holds all of the code that allows eBOX to perform its functions as well as serving as the interfacing module with the other hardware components. Detailed specs with respect to the Arduino UNO can be found [https://store.arduino.cc/usa/arduino-uno-rev3 here]. One important aspect to consider is that the Arduino UNO comes with only 2 preset 5v port, but for our setup (see figure below) 3 ports were needed. This potential hardware issue was resolved as the ports of the Arduino can be altered to give out power instead of receive information. In our case, we overrode digital port 13 to be a 5v power port instead. However, it is important to note that only devices that draw low power should be connected to the overrode port to ensure not frying the Arduino; we specifically had the touch sensor be powered by overrode port digital 13 as 2 sensors need approximately 5.5V DC and we only used one. Furthermore, an Arduino was chosen over a Raspberry Pi for simplicity sake. A rule of thumb is that an Arduino is best for repetitive tasks, like performing the same calculations over and over and updating LEDs [https://makezine.com/2015/12/04/admittedly-simplistic-guide-raspberry-pi-vs-arduino/].<br />
<br />
The WS2812B LED strip is a particularly nifty piece of hardware. At 10ft long it provides ample length to satisfy any creative design one is crafting. Furthermore, not only is the strip addressable from Arduino’s fastLED Library, but each individual LED in the strip is addressable with respect to brightness and color. Additionally, the WS2812B LEDs are wired in series allowing for communication via a one-wire interface. This means that one can control each LED in the strip individually using a single Arduino digital pin. This setup also allows for the strip to be cut without damaging the LEDs that precede the cut. With respect to power, the WS2812B LED strip should be powered using 5v where each LED draws about 50mA when set at full brightness. This actually started to become an issue due to the surge protector that was part of our external power source. The surge protector would shut off the supply if the current was approaching 2.4 A. This technical issue was overcome similar to the Arduino issue via a software solution. We limited the how bright the LEDs could get by moding the RGB components by 160 instead of 255. This allowed for eBOX to run longer without running into an over consumption of power issue.<br />
<br />
The KY-038 4 pin microphone allowed for sound detection based off the specs [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino found here]. It is crucial that the microphone has an analog out pin in order for frequency detection to be possible. If the mic only has a digital pin, only threshold sounds detection is possible based on the potentiometer setting.<br />
<br />
The TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration was ideal for functioning as a clean and simple user interface. Essentially a digital signal is sent if a human finger gets close enough to the sensor that a change in capacitance is detected. The finger functions as a dielectric as well as conductor, both contributing to an increase in capacitance. More details on how the finger functions as a dielectric and a conductor, as well as discussion on proximity vs contact can be found [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ here]. The digital signal sent to Arduino due to the change in capacitance was used to change modes from party to lamp to off, enabling a slick user interface to operate eBOX by the touch of a button. <br />
<br />
The adapter for the external power source needed to be usable in most places. That is why we soldered an adapted with a [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] configuration. As previously discussed, the adapter had a built-in surge protector which required us to modulate our energy consumption. The adapter had inputs of 100-240V, 50/60Hz and 0.45A. It outputted 5.25V and 2400mA.<br />
<br />
For the literal hardware set up and configuration see the diagram below <br />
<br />
<gallery><br />
ESE205_Electrical_Diagram_bbb.png| Electrical Diagram <br />
</gallery><br />
<br />
=== The Housing ===<br />
<br />
[[File:Screen Shot 2018-12-07 at 6.52.19 PM.png|thumb|Hardware Box]]<br />
To hold the hardware required for the system, we 3D printed a box using OnShape, a computer-aided design software, that would hold the Arduino and other components. When designing the box, we had to consider how the Arduino would be able to access the lights, touch sensor, and a power source, so we made 3 holes in the box, one on the top and two on either side. This way, the leads from the LED strip could be fed through the top hole, the leads from the external power source could feed through a hole on the side, and the touch sensor could feed through the other hole on the side of the box. We determined that the microphone was sensitive enough that we did not need to consider placing the microphone on outside of the box, so we kept it inside the box to keep the wires out of the way. To ensure that the box would fit smoothly into the table, we excavated one corner so that it would fit into the corner of the table and the user can access the touch sensor that interfaces with the entire system. <br />
<br />
[[File:Screen Shot 2018-12-07 at 7.11.07 PM.png|thumb|Bottom view of the hardware box]]<br />
Keeping in mind that the shell of the box and the excavated corner would take space away from the Arduino, we added about 0.5in to the dimensions of the box to ensure that everything would have space.<br />
<br />
To secure the lights to the table, we super glued the LED strip to the inside suface of the table.<br />
<br />
== Results ==<br />
<br />
Our efforts resulted in a functional led integrated table that met the parameters we set out for ourselves. We successfully designed, coded, and built and dynamically audio responsive LED light show and put it into a table. We did so at more than an affordable price point of $90 ($44 sans IKEA table expenses). Although the brightness modulation was not as extreme as we would have liked it to be, we still had the brightness modulate in response to decibels. An important decision that had to be made was the choice to modulate our individual RGB light wrap around at 150 rather than 255 (see software section of Design&Solutions for further explanation). We did so to decrease power draw and to not activate the surge protector in the external power source's adapter. Unfortunately, this resulted in a more narrow range of brightness intensities. <br />
<br />
=== Shortcomings ===<br />
<br />
All of the modules that we set out to use worked out and synced seamlessly. Challenges we faced included buying the right components that would give us the output we needed to conduct the Fast Fourier Transform, debugging the software, and comparing our initial objectives with the final product we felt that we reach all of our goals. Some restricted access to the workshop barred us from customizing the design of the table, although we still met our desired outcome by using a desk that had an existing transparent glass top.<br />
<br />
=== Potential Next Steps ===<br />
Our next steps would be to think about securing the table further by adding a waterproof seal around the glass to avoid damaging the hardware and the LED lights. This will make the product even more functional in that someone would not have to worry about their beverage affecting the components of the electrical system. Adding some additional user interfaces such as an LCD screen that tells the user what mode the system is in and making the light patterns even more dynamic through the software is in could also be next steps. <br />
=== Poster ===<br />
<gallery><br />
Screen Shot 2018-12-02 at 4.23.55 PM.png|Poster<br />
</gallery><br />
<br />
=== External Links ===<br />
<br />
[https://docs.google.com/presentation/d/1mnPGURRNoGbIu7AR5VZs8qfj3P0mFTK5Hc8BOpOewkI/edit?usp=sharing Project Proposal Presentation Powerpoint Link]<br />
<br />
[https://github.com/chanelilynn/ESE205 Code Repository]<br />
<br />
== References ==<br />
<br />
*https://sites.wustl.edu/ese498vertigodancefloor/ (Move to the Groove Reference) <br />
<br />
'''Software References'''<br />
*https://github.com/kosme/arduinoFFT (Arduino FFT library)<br />
*https:/ing /forum.arduino.cc/index.php?topic=427386.0 (Arduino FFT discussion page)<br />
*https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT tutorial)<br />
*https://playground.arduino.cc/Code/Filters (Real Time Digital Signal Processing Library)<br />
*https://www.instructables.com/id/Arduino-Audio-Input/ (Tutorial to take in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Frequency-Detection/ (Tutorial to analyze in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Audio-Output/ (Tutorial to output audio for FFT ~40KHz)<br />
*https://www.youtube.com/watch?v=NQinj-tlU-M (LED coding walkthrough)<br />
*https://www.arduino.cc/reference/en/ (Arduino Language Reference)<br />
*https://www.youtube.com/watch?v=5oRir4dck_w (ARDUINO LED LIGHTS WORK AND ARE SOUND RECEPTIVE (with opensource code))<br />
*http://genericnerd.blogspot.com/2009/05/arduino-mood-light-controller.html (Tutorial, LED color transitions)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Electrical Design References'''<br />
*https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10 (purchased microphone)<br />
*https://randomnerdtutorials.com/guide-for-microphone-sound-sensor-with-arduino/ (Guide for microphone sound sensor)<br />
*https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ (Understanding Capacitive Touch Sensors (Self-Capacitance Configuration))<br />
*http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/catalex-ttp223b-arduino-capacitive-touch-sensor-tutorial/ (Tutorial Capacitive Touch Sensor Arduino)<br />
*https://www.instructables.com/id/Wire-a-Potentiometer-as-a-Variable-Resistor/ (Potentiometer, Variable Resistor)<br />
*https://www.instructables.com/id/How-to-use-OLED-display-arduino-module/ (Tutorial LED display)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Physical Design References'''<br />
*https://www.youtube.com/watch?v=kj-oZgmRB2w&t=73s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=pMWnsHpDlQE&t=18s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=OasbgnLOuPI (HOW TO BUILD THE TABLE AND INTEGRATE THE LEDS)<br />
<br />
<br />
<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=15230EBOX2018-12-08T22:41:55Z<p>NishChakra: /* The Software */</p>
<hr />
<div>== Project Proposal ==<br />
=== Overview ===<br />
We created an audio responsive LED lighting system integrated on a desk that can be used as a fun addition to one's home entertainment and lighting systems. The EBOX has 3 modes that the user can set with a tap of a touch sensor to customize the dynamic light patterns to fit any mood.<br />
<br />
=== Group Members ===<br />
Jordan Gewirtz<br />
<br />
Chanel Lynn<br />
<br />
Nish Chakraburtty<br />
<br />
Tony Sancho-Spore (TA)<br />
<br />
Dr. James Feher (Prof)<br />
<br />
===Link to Log===<br />
*[[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
*eBOX WUSTL BOX: https://wustl.app.box.com/folder/57307264614]<br />
*Link to tutorial [https://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino#Materials_.26_Prerequisites here]<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
*User interface<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Soldering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
*Staying under budget<br />
<br />
=== Gantt Chart ===<br />
<br />
<gallery><br />
Gantt Chart (Rev 3).png| Gantt Chart<br />
</gallery><br />
<br />
=== Budget ===<br />
{| class = "wikitable sortable" {{table}}<br />
| align="center" style="background:#f0f0f0;"|'''Item'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price: Actual (Including Shipping)'''<br />
|-<br />
| Arduino [https://store.arduino.cc/usa/arduino-uno-rev3 (Link)]||1||1|| $22.00 ||$0.00 (Provided by TA)|| $22.00 || $0.00<br />
|-<br />
| Transistors [https://www.mouser.com/ProductDetail/ON-Semiconductor-Fairchild/BC547B?qs=UMEuL5FsraB3zD25tclGGQ%3D%3D&gclid=Cj0KCQjwxvbdBRC0ARIsAKmec9aPrjnMgL2Z2kN_UUj-lH33KsgSWltRarCH75kZdbScUbCfsbLc_NUaAjMkEALw_wcB (Link)]||10|||| $0.06 |||| $0.60 ||$0.00 (Provided by TA)<br />
|-<br />
| LED (strips - 6ft) [https://www.amazon.com/Flexible-Daylight-Kitchen-Christmas-Non-waterproof/dp/B00HSF65MC (Link)]||1||1|| $21.99 |||| $21.99 ||<br />
|-<br />
| Arduino Microphone [https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all (Link)]||10||10|| $0.88 ||$0.69|| $8.88 || $6.90<br />
|-<br />
| Table [https://www.ikea.com/us/en/catalog/products/40303444/#/80221352 (Link)] ||1||1|| $39.99 ||$39.99|| $39.99 || $43.86 <br />
|-<br />
|Capacitive Touch Sensors [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen (Link)]|| - || 5 || - || $1.40 || - || $6.99<br />
|-<br />
| Total||14|||||||| $48.78 ||<br />
|}<br />
<br />
== Design And Solutions ==<br />
<br />
=== Steps to Build the EBOX ===<br />
<br />
1. Program the color patterns<br />
<br />
2. Upload the code to the Arduino<br />
<br />
3. Plug leads into the hardware<br />
<br />
4. Solder external power source to lights and Arduino<br />
<br />
5. CAD box to hold the hardware<br />
<br />
6. Assemble table<br />
<br />
7. Secure lights around the underside of the table<br />
<br />
8. Plug in power source adapter to an outlet, place a speaker near the microphone, and enjoy!<br />
<br />
=== Components ===<br />
<br />
LED Light Strip (6ft)<br />
<br />
Arduino Uno<br />
<br />
Capacitive touch sensor<br />
<br />
Sound Detection Sensor Module (Microphone)<br />
<br />
Desk with glass or translucent top<br />
<br />
5V Power adapter<br />
<br />
Leads (wires)<br />
<br />
=== The Software ===<br />
<br />
We wanted to use a Fast Fourier Transform (FFT) in our project implementation as music is just the superposition of a bunch of different frequencies and an FFT would allow us to easily map each superposition to a numeral. <br />
A Fourier Transform is a transformation of a function of time into the frequencies that make it up, but a Fast Fourier Transform is an algorithm that computes the same result but in O(nlogn) time rather than O(n^2) by factorizing the discrete Fourier transform matrix into a product of mostly zeros. We downloaded a Fast Fourier Transform Library ('''referecne/link library''') from an open source to translate the analog sound signals into digital signals with this decrease complexity to allow for a quick response to the audio input. Music or other forms of audio are inputted to the system through the Arduino microphone and the Arduino is programmed to take those analog signals into the FFT (Fast Fourier Transform) operations and the output is series of frequencies in the range of 0-720.<br />
<br />
We imported the FastLED library from the Arduino library database. <br />
<br />
Basic implementation idea:<br />
<br />
Psuedocode:<br />
<br />
First we have to import the library and declare all of our global variables. <br />
make the array that holds the LEDS<br />
<br />
Setup{<br />
<br />
instantiate your power, ground, and digital read pins<br />
<br />
initialize your led strip in order to use the Library <br />
<br />
For (0->numLeds){<br />
address each LED in the Array <br />
}<br />
Show the lights<br />
add a delay so it's not constantly reading<br />
call your average function<br />
}<br />
<br />
<br />
<br />
Main{<br />
Check the counter (Touch Sensor)<br />
Reset the color mode (Options method)<br />
}<br />
<br />
Options{<br />
if (counter value is a certain value){<br />
put it in a cetain mode<br />
}<br />
}<br />
<br />
TouchSensor{<br />
Instantiate the touch sensor and have a counter associated with it mods by the number of options you want to instantiate<br />
}<br />
<br />
Average{<br />
Here you can design the running average that takes in multiple milliseconds of microphone sensor inputs and spits out one value<br />
}<br />
<br />
White mode{<br />
set the lights to white (all rgb values are present in equal amounts)<br />
}<br />
<br />
Off{<br />
set the rgb values to 0<br />
}<br />
<br />
Party mode{<br />
Take a real-time average from the sensor value directly to decide whether or not a big shift in the music has happened (like a drop)<br />
<br />
Use that average to decide if you are in a certain song mode (if you're in the middle of a drop[large] or if you're chilling[normal])<br />
<br />
For each song mode set up if statements that take the running average of values from the average function and if that average is in a certain range then incerement the rgb values on the leds a certain way<br />
<br />
For ( each LED)<br />
increment each rgb value<br />
check the extremes for each LED color <br />
if it goes past 255 (in our case 150) mod the value<br />
if it goes below 0 reset it to 0<br />
else you're good<br />
<br />
}<br />
<br />
<br />
<br />
Explanation of the concept:<br />
<br />
First light up the strip to instantiate the strip. From then we want music responsiveness so we have to have input coming from the microphone. After we get an input we use the FFT to convert it into value. From that frequency value, we can quantify the relative intensity of the music. However, since the microphone is picking up an obscene amount of inputs per second we should take an average every few milliseconds to get a value that we use to change the LED's color so the Arduino doesn't have to do a ridiculous amount of work by changing colors for every single input value (the Arduino would require too much power and circuits would fry). Based on the value increment the RGB value of each LED a certain way (up to you). Make sure that the values of each RGB index for each LED has a edge case condition on incrementing the value (the max value for any RGB index is 255 so if you have a bunch of inputs all the RGB values will max out and turn to white light, so you need to make sure that the RGB values mod by 255, or a lower value if you need to draw less power, so that once it hits max red, blue, or green it can reset and keep its dynamics). Now that we have music responsive lights we have to code more modes. In order to do this while allowing for user input to change the modes we employed a touch sensor (any type digital input sensor will work). The touch sensor is binary with it either being touched or not touched. We then instantiate a counter that increments up everytime the sensor is touched. We also include in the counter definition a modular wrap around (like the wrap around in the lights) that mods by the number of modes. Now the counter will only exist as a number between 0 and (numModes -1). We then if statements in our main method: if counter is a certain value then party mode, other value then desk mode, ect...<br />
<br />
=== The Electronics ===<br />
====Background====<br />
The electronics that eBOX contains includes an Arduino Uno [https://store.arduino.cc/usa/arduino-uno-rev3], a WS2812B LED strip [https://randomnerdtutorials.com/guide-for-ws2812b-addressable-rgb-led-strip-with-arduino/] , a KY-038 4 pin microphone [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino] , and a TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/] [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen] , all of which is soldered up to an external power source that has a standard [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] wall outlet adapter.<br />
<br />
====Design Considerations & Challenges Faced====<br />
As discussed in the Software section of this wiki, the Arduino functions as the operator of eBOX. It holds all of the code that allows eBOX to perform its functions as well as serving as the interfacing module with the other hardware components. Detailed specs with respect to the Arduino UNO can be found [https://store.arduino.cc/usa/arduino-uno-rev3 here]. One important aspect to consider is that the Arduino UNO comes with only 2 preset 5v port, but for our setup (see figure below) 3 ports were needed. This potential hardware issue was resolved as the ports of the Arduino can be altered to give out power instead of receive information. In our case, we overrode digital port 13 to be a 5v power port instead. However, it is important to note that only devices that draw low power should be connected to the overrode port to ensure not frying the Arduino; we specifically had the touch sensor be powered by overrode port digital 13 as 2 sensors need approximately 5.5V DC and we only used one. Furthermore, an Arduino was chosen over a Raspberry Pi for simplicity sake. A rule of thumb is that an Arduino is best for repetitive tasks, like performing the same calculations over and over and updating LEDs [https://makezine.com/2015/12/04/admittedly-simplistic-guide-raspberry-pi-vs-arduino/].<br />
<br />
The WS2812B LED strip is a particularly nifty piece of hardware. At 10ft long it provides ample length to satisfy any creative design one is crafting. Furthermore, not only is the strip addressable from Arduino’s fastLED Library, but each individual LED in the strip is addressable with respect to brightness and color. Additionally, the WS2812B LEDs are wired in series allowing for communication via a one-wire interface. This means that one can control each LED in the strip individually using a single Arduino digital pin. This setup also allows for the strip to be cut without damaging the LEDs that precede the cut. With respect to power, the WS2812B LED strip should be powered using 5v where each LED draws about 50mA when set at full brightness. This actually started to become an issue due to the surge protector that was part of our external power source. The surge protector would shut off the supply if the current was approaching 2.4 A. This technical issue was overcome similar to the Arduino issue via a software solution. We limited the how bright the LEDs could get by moding the RGB components by 160 instead of 255. This allowed for eBOX to run longer without running into an over consumption of power issue.<br />
<br />
The KY-038 4 pin microphone allowed for sound detection based off the specs [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino found here]. It is crucial that the microphone has an analog out pin in order for frequency detection to be possible. If the mic only has a digital pin, only threshold sounds detection is possible based on the potentiometer setting.<br />
<br />
The TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration was ideal for functioning as a clean and simple user interface. Essentially a digital signal is sent if a human finger gets close enough to the sensor that a change in capacitance is detected. The finger functions as a dielectric as well as conductor, both contributing to an increase in capacitance. More details on how the finger functions as a dielectric and a conductor, as well as discussion on proximity vs contact can be found [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ here]. The digital signal sent to Arduino due to the change in capacitance was used to change modes from party to lamp to off, enabling a slick user interface to operate eBOX by the touch of a button. <br />
<br />
The adapter for the external power source needed to be usable in most places. That is why we soldered an adapted with a [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] configuration. As previously discussed, the adapter had a built-in surge protector which required us to modulate our energy consumption. The adapter had inputs of 100-240V, 50/60Hz and 0.45A. It outputted 5.25V and 2400mA.<br />
<br />
For the literal hardware set up and configuration see the diagram below <br />
<br />
<gallery><br />
ESE205_Electrical_Diagram_bbb.png| Electrical Diagram <br />
</gallery><br />
<br />
=== The Housing ===<br />
<br />
[[File:Screen Shot 2018-12-07 at 6.52.19 PM.png|thumb|Hardware Box]]<br />
To hold the hardware required for the system, we 3D printed a box using OnShape, a computer-aided design software, that would hold the Arduino and other components. When designing the box, we had to consider how the Arduino would be able to access the lights, touch sensor, and a power source, so we made 3 holes in the box, one on the top and two on either side. This way, the leads from the LED strip could be fed through the top hole, the leads from the external power source could feed through a hole on the side, and the touch sensor could feed through the other hole on the side of the box. We determined that the microphone was sensitive enough that we did not need to consider placing the microphone on outside of the box, so we kept it inside the box to keep the wires out of the way. To ensure that the box would fit smoothly into the table, we excavated one corner so that it would fit into the corner of the table and the user can access the touch sensor that interfaces with the entire system. <br />
<br />
[[File:Screen Shot 2018-12-07 at 7.11.07 PM.png|thumb|Bottom view of the hardware box]]<br />
Keeping in mind that the shell of the box and the excavated corner would take space away from the Arduino, we added about 0.5in to the dimensions of the box to ensure that everything would have space.<br />
<br />
To secure the lights to the table, we super glued the LED strip to the inside suface of the table.<br />
<br />
== Results ==<br />
<br />
Our efforts resulted in a functional led integrated table that met the parameters we set out for ourselves. We successfully designed, coded, and built and dynamically audio responsive LED light show and put it into a table. We did so at more than an affordable price point of $90 ($44 sans IKEA table expenses). Although the brightness modulation was not as extreme as we would have liked it to be, we still had the brightness modulate in response to decibels. An important decision that had to be made was the choice to modulate our individual RGB light wrap around at 150 rather than 255 (see software section of Design&Solutions for further explanation). We did so to decrease power draw and to not activate the surge protector in the external power source's adapter. Unfortunately, this resulted in a more narrow range of brightness intensities. <br />
<br />
=== Shortcomings ===<br />
<br />
All of the modules that we set out to use worked out and synced seamlessly. Challenges we faced included buying the right components that would give us the output we needed to conduct the Fast Fourier Transform, debugging the software, and comparing our initial objectives with the final product we felt that we reach all of our goals. Some restricted access to the workshop barred us from customizing the design of the table, although we still met our desired outcome by using a desk that had an existing transparent glass top.<br />
<br />
=== Potential Next Steps ===<br />
Our next steps would be to think about securing the table further by adding a waterproof seal around the glass to avoid damaging the hardware and the LED lights. This will make the product even more functional in that someone would not have to worry about their beverage affecting the components of the electrical system. Adding some additional user interfaces such as an LCD screen that tells the user what mode the system is in and making the light patterns even more dynamic through the software is in could also be next steps. <br />
=== Poster ===<br />
<gallery><br />
Screen Shot 2018-12-02 at 4.23.55 PM.png|Poster<br />
</gallery><br />
<br />
=== External Links ===<br />
<br />
[https://docs.google.com/presentation/d/1mnPGURRNoGbIu7AR5VZs8qfj3P0mFTK5Hc8BOpOewkI/edit?usp=sharing Project Proposal Presentation Powerpoint Link]<br />
<br />
[https://github.com/chanelilynn/ESE205 Code Repository]<br />
<br />
== References ==<br />
<br />
*https://sites.wustl.edu/ese498vertigodancefloor/ (Move to the Groove Reference) <br />
<br />
'''Software References'''<br />
*https://github.com/kosme/arduinoFFT (Arduino FFT library)<br />
*https:/ing /forum.arduino.cc/index.php?topic=427386.0 (Arduino FFT discussion page)<br />
*https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT tutorial)<br />
*https://playground.arduino.cc/Code/Filters (Real Time Digital Signal Processing Library)<br />
*https://www.instructables.com/id/Arduino-Audio-Input/ (Tutorial to take in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Frequency-Detection/ (Tutorial to analyze in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Audio-Output/ (Tutorial to output audio for FFT ~40KHz)<br />
*https://www.youtube.com/watch?v=NQinj-tlU-M (LED coding walkthrough)<br />
*https://www.arduino.cc/reference/en/ (Arduino Language Reference)<br />
*https://www.youtube.com/watch?v=5oRir4dck_w (ARDUINO LED LIGHTS WORK AND ARE SOUND RECEPTIVE (with opensource code))<br />
*http://genericnerd.blogspot.com/2009/05/arduino-mood-light-controller.html (Tutorial, LED color transitions)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Electrical Design References'''<br />
*https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10 (purchased microphone)<br />
*https://randomnerdtutorials.com/guide-for-microphone-sound-sensor-with-arduino/ (Guide for microphone sound sensor)<br />
*https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ (Understanding Capacitive Touch Sensors (Self-Capacitance Configuration))<br />
*http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/catalex-ttp223b-arduino-capacitive-touch-sensor-tutorial/ (Tutorial Capacitive Touch Sensor Arduino)<br />
*https://www.instructables.com/id/Wire-a-Potentiometer-as-a-Variable-Resistor/ (Potentiometer, Variable Resistor)<br />
*https://www.instructables.com/id/How-to-use-OLED-display-arduino-module/ (Tutorial LED display)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Physical Design References'''<br />
*https://www.youtube.com/watch?v=kj-oZgmRB2w&t=73s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=pMWnsHpDlQE&t=18s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=OasbgnLOuPI (HOW TO BUILD THE TABLE AND INTEGRATE THE LEDS)<br />
<br />
<br />
<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=15229EBOX2018-12-08T22:40:16Z<p>NishChakra: /* The Software */</p>
<hr />
<div>== Project Proposal ==<br />
=== Overview ===<br />
We created an audio responsive LED lighting system integrated on a desk that can be used as a fun addition to one's home entertainment and lighting systems. The EBOX has 3 modes that the user can set with a tap of a touch sensor to customize the dynamic light patterns to fit any mood.<br />
<br />
=== Group Members ===<br />
Jordan Gewirtz<br />
<br />
Chanel Lynn<br />
<br />
Nish Chakraburtty<br />
<br />
Tony Sancho-Spore (TA)<br />
<br />
Dr. James Feher (Prof)<br />
<br />
===Link to Log===<br />
*[[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
*eBOX WUSTL BOX: https://wustl.app.box.com/folder/57307264614]<br />
*Link to tutorial [https://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino#Materials_.26_Prerequisites here]<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
*User interface<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Soldering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
*Staying under budget<br />
<br />
=== Gantt Chart ===<br />
<br />
<gallery><br />
Gantt Chart (Rev 3).png| Gantt Chart<br />
</gallery><br />
<br />
=== Budget ===<br />
{| class = "wikitable sortable" {{table}}<br />
| align="center" style="background:#f0f0f0;"|'''Item'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price: Actual (Including Shipping)'''<br />
|-<br />
| Arduino [https://store.arduino.cc/usa/arduino-uno-rev3 (Link)]||1||1|| $22.00 ||$0.00 (Provided by TA)|| $22.00 || $0.00<br />
|-<br />
| Transistors [https://www.mouser.com/ProductDetail/ON-Semiconductor-Fairchild/BC547B?qs=UMEuL5FsraB3zD25tclGGQ%3D%3D&gclid=Cj0KCQjwxvbdBRC0ARIsAKmec9aPrjnMgL2Z2kN_UUj-lH33KsgSWltRarCH75kZdbScUbCfsbLc_NUaAjMkEALw_wcB (Link)]||10|||| $0.06 |||| $0.60 ||$0.00 (Provided by TA)<br />
|-<br />
| LED (strips - 6ft) [https://www.amazon.com/Flexible-Daylight-Kitchen-Christmas-Non-waterproof/dp/B00HSF65MC (Link)]||1||1|| $21.99 |||| $21.99 ||<br />
|-<br />
| Arduino Microphone [https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all (Link)]||10||10|| $0.88 ||$0.69|| $8.88 || $6.90<br />
|-<br />
| Table [https://www.ikea.com/us/en/catalog/products/40303444/#/80221352 (Link)] ||1||1|| $39.99 ||$39.99|| $39.99 || $43.86 <br />
|-<br />
|Capacitive Touch Sensors [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen (Link)]|| - || 5 || - || $1.40 || - || $6.99<br />
|-<br />
| Total||14|||||||| $48.78 ||<br />
|}<br />
<br />
== Design And Solutions ==<br />
<br />
=== Steps to Build the EBOX ===<br />
<br />
1. Program the color patterns<br />
<br />
2. Upload the code to the Arduino<br />
<br />
3. Plug leads into the hardware<br />
<br />
4. Solder external power source to lights and Arduino<br />
<br />
5. CAD box to hold the hardware<br />
<br />
6. Assemble table<br />
<br />
7. Secure lights around the underside of the table<br />
<br />
8. Plug in power source adapter to an outlet, place a speaker near the microphone, and enjoy!<br />
<br />
=== Components ===<br />
<br />
LED Light Strip (6ft)<br />
<br />
Arduino Uno<br />
<br />
Capacitive touch sensor<br />
<br />
Sound Detection Sensor Module (Microphone)<br />
<br />
Desk with glass or translucent top<br />
<br />
5V Power adapter<br />
<br />
Leads (wires)<br />
<br />
=== The Software ===<br />
<br />
We wanted to use a Fast Fourier Transform (FFT) in our project implementation as music is just the superposition of a bunch of different frequencies and an FFT would allow us to easily map each superposition to a numeral. <br />
A Fourier Transform is a transformation of a function of time into the frequencies that make it up, but a Fast Fourier Transform is an algorithm that computes the same result but in O(nlogn) time rather than O(n^2) by factorizing the discrete Fourier transform matrix into a product of mostly zeros. We downloaded a Fast Fourier Transform Library ('''referecne/link library''') from an open source to translate the analog sound signals into digital signals with this decrease complexity to allow for a quick response to the audio input. Music or other forms of audio are inputted to the system through the Arduino microphone and the Arduino is programmed to take those analog signals into the FFT (Fast Fourier Transform) operations and the output is series of frequencies in the range of 0-720.<br />
<br />
We imported the FastLED library from the Arduino library database. <br />
<br />
Basic implementation idea:<br />
<br />
Psuedocode:<br />
<br />
First we have to import the library and declare all of our global variables. <br />
make the array that holds the LEDS<br />
<br />
Setup{<br />
<br />
instantiate your power, ground, and digital read pins<br />
<br />
initialize your led strip in order to use the Library <br />
<br />
For (0->numLeds){<br />
address each LED in the Array <br />
}<br />
Show the lights<br />
add a delay so it's not constantly reading<br />
call your average function<br />
}<br />
<br />
<br />
<br />
Main{<br />
Check the counter (Touch Sensor)<br />
Reset the color mode (Options method)<br />
}<br />
<br />
Options{<br />
if (counter value is a certain value){<br />
put it in a cetain mode<br />
}<br />
}<br />
<br />
TouchSensor{<br />
Instantiate the touch sensor and have a counter associated with it mods by the number of options you want to instantiate<br />
}<br />
<br />
Average{<br />
Here you can design the running average that takes in multiple milliseconds of microphone sensor inputs and spits out one value<br />
}<br />
<br />
White mode{<br />
set the lights to white (all rgb values are present in equal amounts)<br />
}<br />
<br />
Off{<br />
set the rgb values to 0<br />
}<br />
<br />
Party mode{<br />
Take a real-time average from the sensor value directly to decide whether or not a big shift in the music has happened (like a drop)<br />
<br />
Use that average to decide if you are in a certain song mode (if you're in the middle of a drop[large] or if you're chilling[normal])<br />
<br />
For each song mode set up if statements that take the running average of values from the average function and if that average is in a certain range then incerement the rgb values on the leds a certain way<br />
<br />
For ( each LED)<br />
increment each rgb value<br />
check the extremes for each LED color <br />
if it goes past 255 (in our case 150) mod the value<br />
if it goes below 0 reset it to 0<br />
else you're good<br />
<br />
}<br />
<br />
<br />
<br />
Explanation of the concept:<br />
<br />
We want to first begin by lighting up the strip to instantiate the strip. From then we want music responsiveness so we have to have input coming from the microphone. After we get an input we use the FFT to convert it into value. From that frequency value, we can quantify the relative intensity of the music. However, since the microphone is picking up an obscene amount of inputs per second we should take an average every few milliseconds to get a value that we use to change the LED's color so the Arduino doesn't have to do a ridiculous amount of work by changing colors for every single input value (the Arduino would require too much power and circuits would fry). Based on the value increment the RGB value of each LED a certain way (up to you). Make sure that the values of each RGB index for each LED has a edge case condition on incrementing the value (the max value for any RGB index is 255 so if you have a bunch of inputs all the RGB values will max out and turn to white light, so you need to make sure that the RGB values mod by 255, or a lower value if you need to draw less power, so that once it hits max red, blue, or green it can reset and keep its dynamics). Now that we have music responsive lights we have to code more modes. In order to do this while allowing for user input to change the modes we employed a touch sensor (any type digital input sensor will work). The touch sensor is binary with it either being touched or not touched. We then instantiate a counter that increments up everytime the sensor is touched. We also include in the counter definition a modular wrap around (like the wrap around in the lights) that mods by the number of modes. Now the counter will only exist as a number between 0 and (numModes -1). We then if statements in our main method: if counter is a certain value then party mode, other value then desk mode, ect...<br />
<br />
=== The Electronics ===<br />
====Background====<br />
The electronics that eBOX contains includes an Arduino Uno [https://store.arduino.cc/usa/arduino-uno-rev3], a WS2812B LED strip [https://randomnerdtutorials.com/guide-for-ws2812b-addressable-rgb-led-strip-with-arduino/] , a KY-038 4 pin microphone [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino] , and a TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/] [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen] , all of which is soldered up to an external power source that has a standard [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] wall outlet adapter.<br />
<br />
====Design Considerations & Challenges Faced====<br />
As discussed in the Software section of this wiki, the Arduino functions as the operator of eBOX. It holds all of the code that allows eBOX to perform its functions as well as serving as the interfacing module with the other hardware components. Detailed specs with respect to the Arduino UNO can be found [https://store.arduino.cc/usa/arduino-uno-rev3 here]. One important aspect to consider is that the Arduino UNO comes with only 2 preset 5v port, but for our setup (see figure below) 3 ports were needed. This potential hardware issue was resolved as the ports of the Arduino can be altered to give out power instead of receive information. In our case, we overrode digital port 13 to be a 5v power port instead. However, it is important to note that only devices that draw low power should be connected to the overrode port to ensure not frying the Arduino; we specifically had the touch sensor be powered by overrode port digital 13 as 2 sensors need approximately 5.5V DC and we only used one. Furthermore, an Arduino was chosen over a Raspberry Pi for simplicity sake. A rule of thumb is that an Arduino is best for repetitive tasks, like performing the same calculations over and over and updating LEDs [https://makezine.com/2015/12/04/admittedly-simplistic-guide-raspberry-pi-vs-arduino/].<br />
<br />
The WS2812B LED strip is a particularly nifty piece of hardware. At 10ft long it provides ample length to satisfy any creative design one is crafting. Furthermore, not only is the strip addressable from Arduino’s fastLED Library, but each individual LED in the strip is addressable with respect to brightness and color. Additionally, the WS2812B LEDs are wired in series allowing for communication via a one-wire interface. This means that one can control each LED in the strip individually using a single Arduino digital pin. This setup also allows for the strip to be cut without damaging the LEDs that precede the cut. With respect to power, the WS2812B LED strip should be powered using 5v where each LED draws about 50mA when set at full brightness. This actually started to become an issue due to the surge protector that was part of our external power source. The surge protector would shut off the supply if the current was approaching 2.4 A. This technical issue was overcome similar to the Arduino issue via a software solution. We limited the how bright the LEDs could get by moding the RGB components by 160 instead of 255. This allowed for eBOX to run longer without running into an over consumption of power issue.<br />
<br />
The KY-038 4 pin microphone allowed for sound detection based off the specs [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino found here]. It is crucial that the microphone has an analog out pin in order for frequency detection to be possible. If the mic only has a digital pin, only threshold sounds detection is possible based on the potentiometer setting.<br />
<br />
The TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration was ideal for functioning as a clean and simple user interface. Essentially a digital signal is sent if a human finger gets close enough to the sensor that a change in capacitance is detected. The finger functions as a dielectric as well as conductor, both contributing to an increase in capacitance. More details on how the finger functions as a dielectric and a conductor, as well as discussion on proximity vs contact can be found [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ here]. The digital signal sent to Arduino due to the change in capacitance was used to change modes from party to lamp to off, enabling a slick user interface to operate eBOX by the touch of a button. <br />
<br />
The adapter for the external power source needed to be usable in most places. That is why we soldered an adapted with a [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] configuration. As previously discussed, the adapter had a built-in surge protector which required us to modulate our energy consumption. The adapter had inputs of 100-240V, 50/60Hz and 0.45A. It outputted 5.25V and 2400mA.<br />
<br />
For the literal hardware set up and configuration see the diagram below <br />
<br />
<gallery><br />
ESE205_Electrical_Diagram_bbb.png| Electrical Diagram <br />
</gallery><br />
<br />
=== The Housing ===<br />
<br />
[[File:Screen Shot 2018-12-07 at 6.52.19 PM.png|thumb|Hardware Box]]<br />
To hold the hardware required for the system, we 3D printed a box using OnShape, a computer-aided design software, that would hold the Arduino and other components. When designing the box, we had to consider how the Arduino would be able to access the lights, touch sensor, and a power source, so we made 3 holes in the box, one on the top and two on either side. This way, the leads from the LED strip could be fed through the top hole, the leads from the external power source could feed through a hole on the side, and the touch sensor could feed through the other hole on the side of the box. We determined that the microphone was sensitive enough that we did not need to consider placing the microphone on outside of the box, so we kept it inside the box to keep the wires out of the way. To ensure that the box would fit smoothly into the table, we excavated one corner so that it would fit into the corner of the table and the user can access the touch sensor that interfaces with the entire system. <br />
<br />
[[File:Screen Shot 2018-12-07 at 7.11.07 PM.png|thumb|Bottom view of the hardware box]]<br />
Keeping in mind that the shell of the box and the excavated corner would take space away from the Arduino, we added about 0.5in to the dimensions of the box to ensure that everything would have space.<br />
<br />
To secure the lights to the table, we super glued the LED strip to the inside suface of the table.<br />
<br />
== Results ==<br />
<br />
Our efforts resulted in a functional led integrated table that met the parameters we set out for ourselves. We successfully designed, coded, and built and dynamically audio responsive LED light show and put it into a table. We did so at more than an affordable price point of $90 ($44 sans IKEA table expenses). Although the brightness modulation was not as extreme as we would have liked it to be, we still had the brightness modulate in response to decibels. An important decision that had to be made was the choice to modulate our individual RGB light wrap around at 150 rather than 255 (see software section of Design&Solutions for further explanation). We did so to decrease power draw and to not activate the surge protector in the external power source's adapter. Unfortunately, this resulted in a more narrow range of brightness intensities. <br />
<br />
=== Shortcomings ===<br />
<br />
All of the modules that we set out to use worked out and synced seamlessly. Challenges we faced included buying the right components that would give us the output we needed to conduct the Fast Fourier Transform, debugging the software, and comparing our initial objectives with the final product we felt that we reach all of our goals. Some restricted access to the workshop barred us from customizing the design of the table, although we still met our desired outcome by using a desk that had an existing transparent glass top.<br />
<br />
=== Potential Next Steps ===<br />
Our next steps would be to think about securing the table further by adding a waterproof seal around the glass to avoid damaging the hardware and the LED lights. This will make the product even more functional in that someone would not have to worry about their beverage affecting the components of the electrical system. Adding some additional user interfaces such as an LCD screen that tells the user what mode the system is in and making the light patterns even more dynamic through the software is in could also be next steps. <br />
=== Poster ===<br />
<gallery><br />
Screen Shot 2018-12-02 at 4.23.55 PM.png|Poster<br />
</gallery><br />
<br />
=== External Links ===<br />
<br />
[https://docs.google.com/presentation/d/1mnPGURRNoGbIu7AR5VZs8qfj3P0mFTK5Hc8BOpOewkI/edit?usp=sharing Project Proposal Presentation Powerpoint Link]<br />
<br />
[https://github.com/chanelilynn/ESE205 Code Repository]<br />
<br />
== References ==<br />
<br />
*https://sites.wustl.edu/ese498vertigodancefloor/ (Move to the Groove Reference) <br />
<br />
'''Software References'''<br />
*https://github.com/kosme/arduinoFFT (Arduino FFT library)<br />
*https:/ing /forum.arduino.cc/index.php?topic=427386.0 (Arduino FFT discussion page)<br />
*https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT tutorial)<br />
*https://playground.arduino.cc/Code/Filters (Real Time Digital Signal Processing Library)<br />
*https://www.instructables.com/id/Arduino-Audio-Input/ (Tutorial to take in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Frequency-Detection/ (Tutorial to analyze in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Audio-Output/ (Tutorial to output audio for FFT ~40KHz)<br />
*https://www.youtube.com/watch?v=NQinj-tlU-M (LED coding walkthrough)<br />
*https://www.arduino.cc/reference/en/ (Arduino Language Reference)<br />
*https://www.youtube.com/watch?v=5oRir4dck_w (ARDUINO LED LIGHTS WORK AND ARE SOUND RECEPTIVE (with opensource code))<br />
*http://genericnerd.blogspot.com/2009/05/arduino-mood-light-controller.html (Tutorial, LED color transitions)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Electrical Design References'''<br />
*https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10 (purchased microphone)<br />
*https://randomnerdtutorials.com/guide-for-microphone-sound-sensor-with-arduino/ (Guide for microphone sound sensor)<br />
*https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ (Understanding Capacitive Touch Sensors (Self-Capacitance Configuration))<br />
*http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/catalex-ttp223b-arduino-capacitive-touch-sensor-tutorial/ (Tutorial Capacitive Touch Sensor Arduino)<br />
*https://www.instructables.com/id/Wire-a-Potentiometer-as-a-Variable-Resistor/ (Potentiometer, Variable Resistor)<br />
*https://www.instructables.com/id/How-to-use-OLED-display-arduino-module/ (Tutorial LED display)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Physical Design References'''<br />
*https://www.youtube.com/watch?v=kj-oZgmRB2w&t=73s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=pMWnsHpDlQE&t=18s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=OasbgnLOuPI (HOW TO BUILD THE TABLE AND INTEGRATE THE LEDS)<br />
<br />
<br />
<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=15223EBOX2018-12-08T22:35:38Z<p>NishChakra: /* The Software */</p>
<hr />
<div>== Project Proposal ==<br />
=== Overview ===<br />
We created an audio responsive LED lighting system integrated on a desk that can be used as a fun addition to one's home entertainment and lighting systems. The EBOX has 3 modes that the user can set with a tap of a touch sensor to customize the dynamic light patterns to fit any mood.<br />
<br />
=== Group Members ===<br />
Jordan Gewirtz<br />
<br />
Chanel Lynn<br />
<br />
Nish Chakraburtty<br />
<br />
Tony Sancho-Spore (TA)<br />
<br />
Dr. James Feher (Prof)<br />
<br />
===Link to Log===<br />
*[[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
*eBOX WUSTL BOX: https://wustl.app.box.com/folder/57307264614]<br />
*Link to tutorial [https://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino#Materials_.26_Prerequisites here]<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
*User interface<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Soldering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
*Staying under budget<br />
<br />
=== Gantt Chart ===<br />
<br />
<gallery><br />
Gantt Chart (Rev 3).png| Gantt Chart<br />
</gallery><br />
<br />
=== Budget ===<br />
{| class = "wikitable sortable" {{table}}<br />
| align="center" style="background:#f0f0f0;"|'''Item'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price: Actual (Including Shipping)'''<br />
|-<br />
| Arduino [https://store.arduino.cc/usa/arduino-uno-rev3 (Link)]||1||1|| $22.00 ||$0.00 (Provided by TA)|| $22.00 || $0.00<br />
|-<br />
| Transistors [https://www.mouser.com/ProductDetail/ON-Semiconductor-Fairchild/BC547B?qs=UMEuL5FsraB3zD25tclGGQ%3D%3D&gclid=Cj0KCQjwxvbdBRC0ARIsAKmec9aPrjnMgL2Z2kN_UUj-lH33KsgSWltRarCH75kZdbScUbCfsbLc_NUaAjMkEALw_wcB (Link)]||10|||| $0.06 |||| $0.60 ||$0.00 (Provided by TA)<br />
|-<br />
| LED (strips - 6ft) [https://www.amazon.com/Flexible-Daylight-Kitchen-Christmas-Non-waterproof/dp/B00HSF65MC (Link)]||1||1|| $21.99 |||| $21.99 ||<br />
|-<br />
| Arduino Microphone [https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all (Link)]||10||10|| $0.88 ||$0.69|| $8.88 || $6.90<br />
|-<br />
| Table [https://www.ikea.com/us/en/catalog/products/40303444/#/80221352 (Link)] ||1||1|| $39.99 ||$39.99|| $39.99 || $43.86 <br />
|-<br />
|Capacitive Touch Sensors [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen (Link)]|| - || 5 || - || $1.40 || - || $6.99<br />
|-<br />
| Total||14|||||||| $48.78 ||<br />
|}<br />
<br />
== Design And Solutions ==<br />
<br />
=== Steps to Build the EBOX ===<br />
<br />
1. Program the color patterns<br />
<br />
2. Upload the code to the Arduino<br />
<br />
3. Plug leads into the hardware<br />
<br />
4. Solder external power source to lights and Arduino<br />
<br />
5. CAD box to hold the hardware<br />
<br />
6. Assemble table<br />
<br />
7. Secure lights around the underside of the table<br />
<br />
8. Plug in power source adapter to an outlet, place a speaker near the microphone, and enjoy!<br />
<br />
=== Components ===<br />
<br />
LED Light Strip (6ft)<br />
<br />
Arduino Uno<br />
<br />
Capacitive touch sensor<br />
<br />
Sound Detection Sensor Module (Microphone)<br />
<br />
Desk with glass or translucent top<br />
<br />
5V Power adapter<br />
<br />
Leads (wires)<br />
<br />
=== The Software ===<br />
<br />
We wanted to use a Fast Fourier Transform (FFT) in our project implementation as music is just the superposition of a bunch of different frequencies and an FFT would allow us to easily map each superposition to a numeral. <br />
A Fourier Transform is a transformation of a function of time into the frequencies that make it up, but a Fast Fourier Transform is an algorithm that computes the same result but in O(nlogn) time rather than O(n^2) by factorizing the discrete Fourier transform matrix into a product of mostly zeros. We downloaded a Fast Fourier Transform Library ('''referecne/link library''') from an open source to translate the analog sound signals into digital signals with this decrease complexity to allow for a quick response to the audio input. Music or other forms of audio are inputted to the system through the Arduino microphone and the Arduino is programmed to take those analog signals into the FFT (Fast Fourier Transform) operations and the output is series of frequencies in the range of 0-720.<br />
<br />
We imported the FastLED library from the Arduino library database. <br />
<br />
Basic implementation idea:<br />
<br />
Psuedocode:<br />
<br />
First we have to import the library and declare all of our global variables. <br />
make the array that holds the LEDS<br />
<br />
Setup{<br />
<br />
instantiate your power, ground, and digital read pins<br />
<br />
initialize your led strip in order to use the Library <br />
<br />
For (0->numLeds){<br />
address each LED in the Array <br />
}<br />
Show the lights<br />
add a delay so it's not constantly reading<br />
call your average function<br />
}<br />
<br />
<br />
<br />
Main{<br />
Check the counter (Touch Sensor)<br />
Reset the color mode (Options method)<br />
}<br />
<br />
Options{<br />
if (counter value is a certain value){<br />
put it in a cetain mode<br />
}<br />
}<br />
<br />
TouchSensor{<br />
Instantiate the touch sensor and have a counter associated with it mods by the number of options you want to instantiate<br />
}<br />
<br />
Average{<br />
Here you can design the running average that takes in multiple milliseconds of microphone sensor inputs and spits out one value<br />
}<br />
<br />
White mode{<br />
set the lights to white (all rgb values are present in equal amounts)<br />
}<br />
<br />
Off{<br />
set the rgb values to 0<br />
}<br />
<br />
Party mode{<br />
Take a real-time average from the sensor value directly to decide whether or not a big shift in the music has happened (like a drop)<br />
<br />
Use that average to decide if you are in a certain song mode (if you're in the middle of a drop[large] or if you're chilling[normal])<br />
<br />
For each song mode set up if statements that take the running average of values from the average function and if that average is in a certain range then incerement the rgb values on the leds a certain way<br />
<br />
For ( each LED)<br />
increment each rgb value<br />
check the extremes for each LED color <br />
if it goes past 255 (in our case 150) mod the value<br />
if it goes below 0 reset it to 0<br />
else you're good<br />
<br />
}<br />
<br />
<br />
<br />
Explanation of the concept:<br />
<br />
We want to first begin by lighting up the strip to instantiate the strip. From then we want music responsiveness so we have to have input coming from the microphone. After we get an input we use the FFT to convert it into value. From that frequency value, we can quantify the relative intensity of the music. However, since the microphone is picking up an obscene amount of inputs per second we should take an average every few milliseconds to get a value that we use to change the LED's color so the Arduino doesn't have to do a ridiculous amount of work by changing colors for every single input value (the Arduino would require too much power and circuits would fry). Based on the value increment the RGB value of each LED a certain way (up to you). Make sure that the values of each RGB index for each LED has a edge case condition on incrementing the value (the max value for any RGB index is 255 so if you have a bunch of inputs all the RGB values will max out and turn to white light, so you need to make sure that the RGB values mod by 255, or a lower value if you need to draw less power, so that once it hits max red, blue, or green it can reset and keep its dynamics). Now that we have music responsive lights we have to code more modes.<br />
<br />
=== The Electronics ===<br />
====Background====<br />
The electronics that eBOX contains includes an Arduino Uno [https://store.arduino.cc/usa/arduino-uno-rev3], a WS2812B LED strip [https://randomnerdtutorials.com/guide-for-ws2812b-addressable-rgb-led-strip-with-arduino/] , a KY-038 4 pin microphone [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino] , and a TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/] [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen] , all of which is soldered up to an external power source that has a standard [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] wall outlet adapter.<br />
<br />
====Design Considerations & Challenges Faced====<br />
As discussed in the Software section of this wiki, the Arduino functions as the operator of eBOX. It holds all of the code that allows eBOX to perform its functions as well as serving as the interfacing module with the other hardware components. Detailed specs with respect to the Arduino UNO can be found [https://store.arduino.cc/usa/arduino-uno-rev3 here]. One important aspect to consider is that the Arduino UNO comes with only 2 preset 5v port, but for our setup (see figure below) 3 ports were needed. This potential hardware issue was resolved as the ports of the Arduino can be altered to give out power instead of receive information. In our case, we overrode digital port 13 to be a 5v power port instead. However, it is important to note that only devices that draw low power should be connected to the overrode port to ensure not frying the Arduino; we specifically had the touch sensor be powered by overrode port digital 13 as 2 sensors need approximately 5.5V DC and we only used one. Furthermore, an Arduino was chosen over a Raspberry Pi for simplicity sake. A rule of thumb is that an Arduino is best for repetitive tasks, like performing the same calculations over and over and updating LEDs [https://makezine.com/2015/12/04/admittedly-simplistic-guide-raspberry-pi-vs-arduino/].<br />
<br />
The WS2812B LED strip is a particularly nifty piece of hardware. At 10ft long it provides ample length to satisfy any creative design one is crafting. Furthermore, not only is the strip addressable from Arduino’s fastLED Library, but each individual LED in the strip is addressable with respect to brightness and color. Additionally, the WS2812B LEDs are wired in series allowing for communication via a one-wire interface. This means that one can control each LED in the strip individually using a single Arduino digital pin. This setup also allows for the strip to be cut without damaging the LEDs that precede the cut. With respect to power, the WS2812B LED strip should be powered using 5v where each LED draws about 50mA when set at full brightness. This actually started to become an issue due to the surge protector that was part of our external power source. The surge protector would shut off the supply if the current was approaching 2.4 A. This technical issue was overcome similar to the Arduino issue via a software solution. We limited the how bright the LEDs could get by moding the RGB components by 160 instead of 255. This allowed for eBOX to run longer without running into an over consumption of power issue.<br />
<br />
The KY-038 4 pin microphone allowed for sound detection based off the specs [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino found here]. It is crucial that the microphone has an analog out pin in order for frequency detection to be possible. If the mic only has a digital pin, only threshold sounds detection is possible based on the potentiometer setting.<br />
<br />
The TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration was ideal for functioning as a clean and simple user interface. Essentially a digital signal is sent if a human finger gets close enough to the sensor that a change in capacitance is detected. The finger functions as a dielectric as well as conductor, both contributing to an increase in capacitance. More details on how the finger functions as a dielectric and a conductor, as well as discussion on proximity vs contact can be found [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ here]. The digital signal sent to Arduino due to the change in capacitance was used to change modes from party to lamp to off, enabling a slick user interface to operate eBOX by the touch of a button. <br />
<br />
The adapter for the external power source needed to be usable in most places. That is why we soldered an adapted with a [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] configuration. As previously discussed, the adapter had a built-in surge protector which required us to modulate our energy consumption. The adapter had inputs of 100-240V, 50/60Hz and 0.45A. It outputted 5.25V and 2400mA.<br />
<br />
For the literal hardware set up and configuration see the diagram below <br />
<br />
<gallery><br />
ESE205_Electrical_Diagram_bbb.png| Electrical Diagram <br />
</gallery><br />
<br />
=== The Housing ===<br />
<br />
[[File:Screen Shot 2018-12-07 at 6.52.19 PM.png|thumb|Hardware Box]]<br />
To hold the hardware required for the system, we 3D printed a box using OnShape, a computer-aided design software, that would hold the Arduino and other components. When designing the box, we had to consider how the Arduino would be able to access the lights, touch sensor, and a power source, so we made 3 holes in the box, one on the top and two on either side. This way, the leads from the LED strip could be fed through the top hole, the leads from the external power source could feed through a hole on the side, and the touch sensor could feed through the other hole on the side of the box. We determined that the microphone was sensitive enough that we did not need to consider placing the microphone on outside of the box, so we kept it inside the box to keep the wires out of the way. To ensure that the box would fit smoothly into the table, we excavated one corner so that it would fit into the corner of the table and the user can access the touch sensor that interfaces with the entire system. <br />
<br />
[[File:Screen Shot 2018-12-07 at 7.11.07 PM.png|thumb|Bottom view of the hardware box]]<br />
Keeping in mind that the shell of the box and the excavated corner would take space away from the Arduino, we added about 0.5in to the dimensions of the box to ensure that everything would have space.<br />
<br />
To secure the lights to the table, we super glued the LED strip to the inside suface of the table.<br />
<br />
== Results ==<br />
<br />
Our efforts resulted in a functional led integrated table that met the parameters we set out for ourselves. We successfully designed, coded, and built and dynamically audio responsive LED light show and put it into a table. We did so at more than an affordable price point of $90 ($44 sans IKEA table expenses). Although the brightness modulation was not as extreme as we would have liked it to be, we still had the brightness modulate in response to decibels. An important decision that had to be made was the choice to modulate our individual RGB light wrap around at 150 rather than 255 (see software section of Design&Solutions for further explanation). We did so to decrease power draw and to not activate the surge protector in the external power source's adapter. Unfortunately, this resulted in a more narrow range of brightness intensities. <br />
<br />
=== Shortcomings ===<br />
<br />
All of the modules that we set out to use worked out and synced seamlessly. Challenges we faced included buying the right components that would give us the output we needed to conduct the Fast Fourier Transform, debugging the software, and comparing our initial objectives with the final product we felt that we reach all of our goals. Some restricted access to the workshop barred us from customizing the design of the table, although we still met our desired outcome by using a desk that had an existing transparent glass top.<br />
<br />
=== Potential Next Steps ===<br />
Our next steps would be to think about securing the table further by adding a waterproof seal around the glass to avoid damaging the hardware and the LED lights. This will make the product even more functional in that someone would not have to worry about their beverage affecting the components of the electrical system. Adding some additional user interfaces such as an LCD screen that tells the user what mode the system is in and making the light patterns even more dynamic through the software is in could also be next steps. <br />
=== Poster ===<br />
<gallery><br />
Screen Shot 2018-12-02 at 4.23.55 PM.png|Poster<br />
</gallery><br />
<br />
=== External Links ===<br />
<br />
[https://docs.google.com/presentation/d/1mnPGURRNoGbIu7AR5VZs8qfj3P0mFTK5Hc8BOpOewkI/edit?usp=sharing Project Proposal Presentation Powerpoint Link]<br />
<br />
[https://github.com/chanelilynn/ESE205 Code Repository]<br />
<br />
== References ==<br />
<br />
*https://sites.wustl.edu/ese498vertigodancefloor/ (Move to the Groove Reference) <br />
<br />
'''Software References'''<br />
*https://github.com/kosme/arduinoFFT (Arduino FFT library)<br />
*https:/ing /forum.arduino.cc/index.php?topic=427386.0 (Arduino FFT discussion page)<br />
*https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT tutorial)<br />
*https://playground.arduino.cc/Code/Filters (Real Time Digital Signal Processing Library)<br />
*https://www.instructables.com/id/Arduino-Audio-Input/ (Tutorial to take in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Frequency-Detection/ (Tutorial to analyze in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Audio-Output/ (Tutorial to output audio for FFT ~40KHz)<br />
*https://www.youtube.com/watch?v=NQinj-tlU-M (LED coding walkthrough)<br />
*https://www.arduino.cc/reference/en/ (Arduino Language Reference)<br />
*https://www.youtube.com/watch?v=5oRir4dck_w (ARDUINO LED LIGHTS WORK AND ARE SOUND RECEPTIVE (with opensource code))<br />
*http://genericnerd.blogspot.com/2009/05/arduino-mood-light-controller.html (Tutorial, LED color transitions)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Electrical Design References'''<br />
*https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10 (purchased microphone)<br />
*https://randomnerdtutorials.com/guide-for-microphone-sound-sensor-with-arduino/ (Guide for microphone sound sensor)<br />
*https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ (Understanding Capacitive Touch Sensors (Self-Capacitance Configuration))<br />
*http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/catalex-ttp223b-arduino-capacitive-touch-sensor-tutorial/ (Tutorial Capacitive Touch Sensor Arduino)<br />
*https://www.instructables.com/id/Wire-a-Potentiometer-as-a-Variable-Resistor/ (Potentiometer, Variable Resistor)<br />
*https://www.instructables.com/id/How-to-use-OLED-display-arduino-module/ (Tutorial LED display)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Physical Design References'''<br />
*https://www.youtube.com/watch?v=kj-oZgmRB2w&t=73s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=pMWnsHpDlQE&t=18s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=OasbgnLOuPI (HOW TO BUILD THE TABLE AND INTEGRATE THE LEDS)<br />
<br />
<br />
<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=15221EBOX2018-12-08T22:34:38Z<p>NishChakra: /* The Software */</p>
<hr />
<div>== Project Proposal ==<br />
=== Overview ===<br />
We created an audio responsive LED lighting system integrated on a desk that can be used as a fun addition to one's home entertainment and lighting systems. The EBOX has 3 modes that the user can set with a tap of a touch sensor to customize the dynamic light patterns to fit any mood.<br />
<br />
=== Group Members ===<br />
Jordan Gewirtz<br />
<br />
Chanel Lynn<br />
<br />
Nish Chakraburtty<br />
<br />
Tony Sancho-Spore (TA)<br />
<br />
Dr. James Feher (Prof)<br />
<br />
===Link to Log===<br />
*[[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
*eBOX WUSTL BOX: https://wustl.app.box.com/folder/57307264614]<br />
*Link to tutorial [https://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino#Materials_.26_Prerequisites here]<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
*User interface<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Soldering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
*Staying under budget<br />
<br />
=== Gantt Chart ===<br />
<br />
<gallery><br />
Gantt Chart (Rev 3).png| Gantt Chart<br />
</gallery><br />
<br />
=== Budget ===<br />
{| class = "wikitable sortable" {{table}}<br />
| align="center" style="background:#f0f0f0;"|'''Item'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price: Actual (Including Shipping)'''<br />
|-<br />
| Arduino [https://store.arduino.cc/usa/arduino-uno-rev3 (Link)]||1||1|| $22.00 ||$0.00 (Provided by TA)|| $22.00 || $0.00<br />
|-<br />
| Transistors [https://www.mouser.com/ProductDetail/ON-Semiconductor-Fairchild/BC547B?qs=UMEuL5FsraB3zD25tclGGQ%3D%3D&gclid=Cj0KCQjwxvbdBRC0ARIsAKmec9aPrjnMgL2Z2kN_UUj-lH33KsgSWltRarCH75kZdbScUbCfsbLc_NUaAjMkEALw_wcB (Link)]||10|||| $0.06 |||| $0.60 ||$0.00 (Provided by TA)<br />
|-<br />
| LED (strips - 6ft) [https://www.amazon.com/Flexible-Daylight-Kitchen-Christmas-Non-waterproof/dp/B00HSF65MC (Link)]||1||1|| $21.99 |||| $21.99 ||<br />
|-<br />
| Arduino Microphone [https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all (Link)]||10||10|| $0.88 ||$0.69|| $8.88 || $6.90<br />
|-<br />
| Table [https://www.ikea.com/us/en/catalog/products/40303444/#/80221352 (Link)] ||1||1|| $39.99 ||$39.99|| $39.99 || $43.86 <br />
|-<br />
|Capacitive Touch Sensors [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen (Link)]|| - || 5 || - || $1.40 || - || $6.99<br />
|-<br />
| Total||14|||||||| $48.78 ||<br />
|}<br />
<br />
== Design And Solutions ==<br />
<br />
=== Steps to Build the EBOX ===<br />
<br />
1. Program the color patterns<br />
<br />
2. Upload the code to the Arduino<br />
<br />
3. Plug leads into the hardware<br />
<br />
4. Solder external power source to lights and Arduino<br />
<br />
5. CAD box to hold the hardware<br />
<br />
6. Assemble table<br />
<br />
7. Secure lights around the underside of the table<br />
<br />
8. Plug in power source adapter to an outlet, place a speaker near the microphone, and enjoy!<br />
<br />
=== Components ===<br />
<br />
LED Light Strip (6ft)<br />
<br />
Arduino Uno<br />
<br />
Capacitive touch sensor<br />
<br />
Sound Detection Sensor Module (Microphone)<br />
<br />
Desk with glass or translucent top<br />
<br />
5V Power adapter<br />
<br />
Leads (wires)<br />
<br />
=== The Software ===<br />
<br />
We wanted to use a Fast Fourier Transform (FFT) in our project implementation as music is just the superposition of a bunch of different frequencies and an FFT would allow us to easily map each superposition to a numeral. <br />
A Fourier Transform is a transformation of a function of time into the frequencies that make it up, but a Fast Fourier Transform is an algorithm that computes the same result but in O(nlogn) time rather than O(n^2) by factorizing the discrete Fourier transform matrix into a product of mostly zeros. We downloaded a Fast Fourier Transform Library ('''referecne/link library''') from an open source to translate the analog sound signals into digital signals with this decrease complexity to allow for a quick response to the audio input. Music or other forms of audio are inputted to the system through the Arduino microphone and the Arduino is programmed to take those analog signals into the FFT (Fast Fourier Transform) operations and the output is series of frequencies in the range of 0-720.<br />
<br />
We imported the FastLED library from the Arduino library database. <br />
<br />
Basic implementation idea:<br />
<br />
Psuedocode:<br />
<br />
First we have to import the library and declare all of our global variables. <br />
make the array that holds the LEDS<br />
<br />
Setup{<br />
<br />
instantiate your power, ground, and digital read pins<br />
initialize your led strip in order to use the Library <br />
<br />
For (0->numLeds){<br />
address each LED in the Array <br />
}<br />
Show the lights<br />
add a delay so it's not constantly reading<br />
call your average function<br />
}<br />
<br />
<br />
<br />
Main{<br />
Check the counter (Touch Sensor)<br />
Reset the color mode (Options method)<br />
}<br />
<br />
Options{<br />
if (counter value is a certain value){<br />
put it in a cetain mode<br />
}<br />
}<br />
<br />
TouchSensor{<br />
Instantiate the touch sensor and have a counter associated with it mods by the number of options you want to instantiate<br />
}<br />
<br />
Average{<br />
Here you can design the running average that takes in multiple milliseconds of microphone sensor inputs and spits out one value<br />
}<br />
<br />
White mode{<br />
set the lights to white (all rgb values are present in equal amounts)<br />
}<br />
<br />
Off{<br />
set the rgb values to 0<br />
}<br />
<br />
Party mode{<br />
Take a real-time average from the sensor value directly to decide whether or not a big shift in the music has happened (like a drop)<br />
<br />
Use that average to decide if you are in a certain song mode (if you're in the middle of a drop[large] or if you're chilling[normal])<br />
<br />
For each song mode set up if statements that take the running average of values from the average function and if that average is in a certain range then incerement the rgb values on the leds a certain way<br />
<br />
For ( each LED)<br />
increment each rgb value<br />
check the extremes for each LED color <br />
if it goes past 255 (in our case 150) mod the value<br />
if it goes below 0 reset it to 0<br />
else you're good<br />
<br />
}<br />
<br />
<br />
<br />
Explanation of the concept:<br />
<br />
We want to first begin by lighting up the strip to instantiate the strip. From then we want music responsiveness so we have to have input coming from the microphone. After we get an input we use the FFT to convert it into value. From that frequency value, we can quantify the relative intensity of the music. However, since the microphone is picking up an obscene amount of inputs per second we should take an average every few milliseconds to get a value that we use to change the LED's color so the Arduino doesn't have to do a ridiculous amount of work by changing colors for every single input value (the Arduino would require too much power and circuits would fry). Based on the value increment the RGB value of each LED a certain way (up to you). Make sure that the values of each RGB index for each LED has a edge case condition on incrementing the value (the max value for any RGB index is 255 so if you have a bunch of inputs all the RGB values will max out and turn to white light, so you need to make sure that the RGB values mod by 255, or a lower value if you need to draw less power, so that once it hits max red, blue, or green it can reset and keep its dynamics). Now that we have music responsive lights we have to code more modes.<br />
<br />
=== The Electronics ===<br />
====Background====<br />
The electronics that eBOX contains includes an Arduino Uno [https://store.arduino.cc/usa/arduino-uno-rev3], a WS2812B LED strip [https://randomnerdtutorials.com/guide-for-ws2812b-addressable-rgb-led-strip-with-arduino/] , a KY-038 4 pin microphone [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino] , and a TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/] [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen] , all of which is soldered up to an external power source that has a standard [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] wall outlet adapter.<br />
<br />
====Design Considerations & Challenges Faced====<br />
As discussed in the Software section of this wiki, the Arduino functions as the operator of eBOX. It holds all of the code that allows eBOX to perform its functions as well as serving as the interfacing module with the other hardware components. Detailed specs with respect to the Arduino UNO can be found [https://store.arduino.cc/usa/arduino-uno-rev3 here]. One important aspect to consider is that the Arduino UNO comes with only 2 preset 5v port, but for our setup (see figure below) 3 ports were needed. This potential hardware issue was resolved as the ports of the Arduino can be altered to give out power instead of receive information. In our case, we overrode digital port 13 to be a 5v power port instead. However, it is important to note that only devices that draw low power should be connected to the overrode port to ensure not frying the Arduino; we specifically had the touch sensor be powered by overrode port digital 13 as 2 sensors need approximately 5.5V DC and we only used one. Furthermore, an Arduino was chosen over a Raspberry Pi for simplicity sake. A rule of thumb is that an Arduino is best for repetitive tasks, like performing the same calculations over and over and updating LEDs [https://makezine.com/2015/12/04/admittedly-simplistic-guide-raspberry-pi-vs-arduino/].<br />
<br />
The WS2812B LED strip is a particularly nifty piece of hardware. At 10ft long it provides ample length to satisfy any creative design one is crafting. Furthermore, not only is the strip addressable from Arduino’s fastLED Library, but each individual LED in the strip is addressable with respect to brightness and color. Additionally, the WS2812B LEDs are wired in series allowing for communication via a one-wire interface. This means that one can control each LED in the strip individually using a single Arduino digital pin. This setup also allows for the strip to be cut without damaging the LEDs that precede the cut. With respect to power, the WS2812B LED strip should be powered using 5v where each LED draws about 50mA when set at full brightness. This actually started to become an issue due to the surge protector that was part of our external power source. The surge protector would shut off the supply if the current was approaching 2.4 A. This technical issue was overcome similar to the Arduino issue via a software solution. We limited the how bright the LEDs could get by moding the RGB components by 160 instead of 255. This allowed for eBOX to run longer without running into an over consumption of power issue.<br />
<br />
The KY-038 4 pin microphone allowed for sound detection based off the specs [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino found here]. It is crucial that the microphone has an analog out pin in order for frequency detection to be possible. If the mic only has a digital pin, only threshold sounds detection is possible based on the potentiometer setting.<br />
<br />
The TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration was ideal for functioning as a clean and simple user interface. Essentially a digital signal is sent if a human finger gets close enough to the sensor that a change in capacitance is detected. The finger functions as a dielectric as well as conductor, both contributing to an increase in capacitance. More details on how the finger functions as a dielectric and a conductor, as well as discussion on proximity vs contact can be found [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ here]. The digital signal sent to Arduino due to the change in capacitance was used to change modes from party to lamp to off, enabling a slick user interface to operate eBOX by the touch of a button. <br />
<br />
The adapter for the external power source needed to be usable in most places. That is why we soldered an adapted with a [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] configuration. As previously discussed, the adapter had a built-in surge protector which required us to modulate our energy consumption. The adapter had inputs of 100-240V, 50/60Hz and 0.45A. It outputted 5.25V and 2400mA.<br />
<br />
For the literal hardware set up and configuration see the diagram below <br />
<br />
<gallery><br />
ESE205_Electrical_Diagram_bbb.png| Electrical Diagram <br />
</gallery><br />
<br />
=== The Housing ===<br />
<br />
[[File:Screen Shot 2018-12-07 at 6.52.19 PM.png|thumb|Hardware Box]]<br />
To hold the hardware required for the system, we 3D printed a box using OnShape, a computer-aided design software, that would hold the Arduino and other components. When designing the box, we had to consider how the Arduino would be able to access the lights, touch sensor, and a power source, so we made 3 holes in the box, one on the top and two on either side. This way, the leads from the LED strip could be fed through the top hole, the leads from the external power source could feed through a hole on the side, and the touch sensor could feed through the other hole on the side of the box. We determined that the microphone was sensitive enough that we did not need to consider placing the microphone on outside of the box, so we kept it inside the box to keep the wires out of the way. To ensure that the box would fit smoothly into the table, we excavated one corner so that it would fit into the corner of the table and the user can access the touch sensor that interfaces with the entire system. <br />
<br />
[[File:Screen Shot 2018-12-07 at 7.11.07 PM.png|thumb|Bottom view of the hardware box]]<br />
Keeping in mind that the shell of the box and the excavated corner would take space away from the Arduino, we added about 0.5in to the dimensions of the box to ensure that everything would have space.<br />
<br />
To secure the lights to the table, we super glued the LED strip to the inside suface of the table.<br />
<br />
== Results ==<br />
<br />
Our efforts resulted in a functional led integrated table that met the parameters we set out for ourselves. We successfully designed, coded, and built and dynamically audio responsive LED light show and put it into a table. We did so at more than an affordable price point of $90 ($44 sans IKEA table expenses). Although the brightness modulation was not as extreme as we would have liked it to be, we still had the brightness modulate in response to decibels. An important decision that had to be made was the choice to modulate our individual RGB light wrap around at 150 rather than 255 (see software section of Design&Solutions for further explanation). We did so to decrease power draw and to not activate the surge protector in the external power source's adapter. Unfortunately, this resulted in a more narrow range of brightness intensities. <br />
<br />
=== Shortcomings ===<br />
<br />
All of the modules that we set out to use worked out and synced seamlessly. Challenges we faced included buying the right components that would give us the output we needed to conduct the Fast Fourier Transform, debugging the software, and comparing our initial objectives with the final product we felt that we reach all of our goals. Some restricted access to the workshop barred us from customizing the design of the table, although we still met our desired outcome by using a desk that had an existing transparent glass top.<br />
<br />
=== Potential Next Steps ===<br />
Our next steps would be to think about securing the table further by adding a waterproof seal around the glass to avoid damaging the hardware and the LED lights. This will make the product even more functional in that someone would not have to worry about their beverage affecting the components of the electrical system. Adding some additional user interfaces such as an LCD screen that tells the user what mode the system is in and making the light patterns even more dynamic through the software is in could also be next steps. <br />
=== Poster ===<br />
<gallery><br />
Screen Shot 2018-12-02 at 4.23.55 PM.png|Poster<br />
</gallery><br />
<br />
=== External Links ===<br />
<br />
[https://docs.google.com/presentation/d/1mnPGURRNoGbIu7AR5VZs8qfj3P0mFTK5Hc8BOpOewkI/edit?usp=sharing Project Proposal Presentation Powerpoint Link]<br />
<br />
[https://github.com/chanelilynn/ESE205 Code Repository]<br />
<br />
== References ==<br />
<br />
*https://sites.wustl.edu/ese498vertigodancefloor/ (Move to the Groove Reference) <br />
<br />
'''Software References'''<br />
*https://github.com/kosme/arduinoFFT (Arduino FFT library)<br />
*https:/ing /forum.arduino.cc/index.php?topic=427386.0 (Arduino FFT discussion page)<br />
*https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT tutorial)<br />
*https://playground.arduino.cc/Code/Filters (Real Time Digital Signal Processing Library)<br />
*https://www.instructables.com/id/Arduino-Audio-Input/ (Tutorial to take in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Frequency-Detection/ (Tutorial to analyze in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Audio-Output/ (Tutorial to output audio for FFT ~40KHz)<br />
*https://www.youtube.com/watch?v=NQinj-tlU-M (LED coding walkthrough)<br />
*https://www.arduino.cc/reference/en/ (Arduino Language Reference)<br />
*https://www.youtube.com/watch?v=5oRir4dck_w (ARDUINO LED LIGHTS WORK AND ARE SOUND RECEPTIVE (with opensource code))<br />
*http://genericnerd.blogspot.com/2009/05/arduino-mood-light-controller.html (Tutorial, LED color transitions)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Electrical Design References'''<br />
*https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10 (purchased microphone)<br />
*https://randomnerdtutorials.com/guide-for-microphone-sound-sensor-with-arduino/ (Guide for microphone sound sensor)<br />
*https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ (Understanding Capacitive Touch Sensors (Self-Capacitance Configuration))<br />
*http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/catalex-ttp223b-arduino-capacitive-touch-sensor-tutorial/ (Tutorial Capacitive Touch Sensor Arduino)<br />
*https://www.instructables.com/id/Wire-a-Potentiometer-as-a-Variable-Resistor/ (Potentiometer, Variable Resistor)<br />
*https://www.instructables.com/id/How-to-use-OLED-display-arduino-module/ (Tutorial LED display)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Physical Design References'''<br />
*https://www.youtube.com/watch?v=kj-oZgmRB2w&t=73s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=pMWnsHpDlQE&t=18s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=OasbgnLOuPI (HOW TO BUILD THE TABLE AND INTEGRATE THE LEDS)<br />
<br />
<br />
<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=15208EBOX2018-12-08T21:39:41Z<p>NishChakra: /* Results */</p>
<hr />
<div>== Project Proposal ==<br />
=== Overview ===<br />
We created an audio responsive LED lighting system integrated on a desk that can be used as a fun addition to one's home entertainment and lighting systems. The EBOX has 3 modes that the user can set with a tap of a touch sensor to customize the dynamic light patterns to fit any mood.<br />
<br />
=== Group Members ===<br />
Jordan Gewirtz<br />
<br />
Chanel Lynn<br />
<br />
Nish Chakraburtty<br />
<br />
Tony Sancho-Spore (TA)<br />
<br />
Dr. James Feher (Prof)<br />
<br />
===Link to Log===<br />
*[[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
*eBOX WUSTL BOX: https://wustl.app.box.com/folder/57307264614]<br />
*Link to tutorial [https://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino#Materials_.26_Prerequisites here]<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
*User interface<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Soldering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
*Staying under budget<br />
<br />
=== Gantt Chart ===<br />
<br />
<gallery><br />
Gantt Chart (Rev 3).png| Gantt Chart<br />
</gallery><br />
<br />
=== Budget ===<br />
{| class = "wikitable sortable" {{table}}<br />
| align="center" style="background:#f0f0f0;"|'''Item'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price: Actual (Including Shipping)'''<br />
|-<br />
| Arduino [https://store.arduino.cc/usa/arduino-uno-rev3 (Link)]||1||1|| $22.00 ||$0.00 (Provided by TA)|| $22.00 || $0.00<br />
|-<br />
| Transistors [https://www.mouser.com/ProductDetail/ON-Semiconductor-Fairchild/BC547B?qs=UMEuL5FsraB3zD25tclGGQ%3D%3D&gclid=Cj0KCQjwxvbdBRC0ARIsAKmec9aPrjnMgL2Z2kN_UUj-lH33KsgSWltRarCH75kZdbScUbCfsbLc_NUaAjMkEALw_wcB (Link)]||10|||| $0.06 |||| $0.60 ||$0.00 (Provided by TA)<br />
|-<br />
| LED (strips - 6ft) [https://www.amazon.com/Flexible-Daylight-Kitchen-Christmas-Non-waterproof/dp/B00HSF65MC (Link)]||1||1|| $21.99 |||| $21.99 ||<br />
|-<br />
| Arduino Microphone [https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all (Link)]||10||10|| $0.88 ||$0.69|| $8.88 || $6.90<br />
|-<br />
| Table [https://www.ikea.com/us/en/catalog/products/40303444/#/80221352 (Link)] ||1||1|| $39.99 ||$39.99|| $39.99 || $43.86 <br />
|-<br />
|Capacitive Touch Sensors [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen (Link)]|| - || 5 || - || $1.40 || - || $6.99<br />
|-<br />
| Total||14|||||||| $48.78 ||<br />
|}<br />
<br />
== Design And Solutions ==<br />
<br />
=== Steps to Build the EBOX ===<br />
<br />
1. Program the color patterns<br />
<br />
2. Upload the code to the Arduino<br />
<br />
3. Plug leads into the hardware<br />
<br />
4. Solder external power source to lights and Arduino<br />
<br />
5. CAD box to hold the hardware<br />
<br />
6. Assemble table<br />
<br />
7. Secure lights around the underside of the table<br />
<br />
8. Plug in power source adapter to an outlet, place a speaker near the microphone, and enjoy!<br />
<br />
=== Components ===<br />
<br />
LED Light Strip (6ft)<br />
<br />
Arduino Uno<br />
<br />
Capacitive touch sensor<br />
<br />
Sound Detection Sensor Module (Microphone)<br />
<br />
Desk with glass or translucent top<br />
<br />
5V Power adapter<br />
<br />
Leads (wires)<br />
<br />
=== The Software ===<br />
<br />
The method of approach in terms of software was to program the Arduino to do a running average of the frequencies coming in from the Fast Fourier Transform and send a message to the LED strip to output a certain pattern of lights. <br />
<br />
A Fourier Transform is a transformation of a function of time into the frequencies that make it up, but a Fast Fourier Transform is an algorithm that computes the same result but in nlogn time rather than n^2 by factorizing the discrete Fourier transform matrix into a product of mostly zeros. We downloaded a Fast Fourier Transform Library ('''referecne/link library''') from an open source to translate the analog sound signals into digital signals with this decrease complexity to allow for a quick response to the audio input. Music or other forms of audio are inputted to the system through the Arduino microphone and the Arduino is programmed to take those anolog signals into the FFT (Fast Fourier Transform) operations and the output is series of frequencies in the range of 0-720. <br />
<br />
=== The Electronics ===<br />
====Background====<br />
The electronics that eBOX contains includes an Arduino Uno [https://store.arduino.cc/usa/arduino-uno-rev3], a WS2812B LED strip [https://randomnerdtutorials.com/guide-for-ws2812b-addressable-rgb-led-strip-with-arduino/] , a KY-038 4 pin microphone [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino] , and a TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/] [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen] , all of which is soldered up to an external power source that has a standard [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] wall outlet adapter.<br />
<br />
====Design Considerations & Challenges Faced====<br />
As discussed in the Software section of this wiki, the Arduino functions as the operator of eBOX. It holds all of the code that allows eBOX to perform its functions as well as serving as the interfacing module with the other hardware components. Detailed specs with respect to the Arduino UNO can be found [https://store.arduino.cc/usa/arduino-uno-rev3 here]. One important aspect to consider is that the Arduino UNO comes with only 2 preset 5v port, but for our setup (see figure below) 3 ports were needed. This potential hardware issue was resolved as the ports of the Arduino can be altered to give out power instead of receive information. In our case, we overrode digital port 13 to be a 5v power port instead. However, it is important to note that only devices that draw low power should be connected to the overrode port to ensure not frying the Arduino; we specifically had the touch sensor be powered by overrode port digital 13 as 2 sensors need approximately 5.5V DC and we only used one. Furthermore, an Arduino was chosen over a Raspberry Pi for simplicity sake. A rule of thumb is that an Arduino is best for repetitive tasks, like performing the same calculations over and over and updating LEDs [https://makezine.com/2015/12/04/admittedly-simplistic-guide-raspberry-pi-vs-arduino/].<br />
<br />
The WS2812B LED strip is a particularly nifty piece of hardware. At 10ft long it provides ample length to satisfy any creative design one is crafting. Furthermore, not only is the strip addressable from Arduino’s fastLED Library, but each individual LED in the strip is addressable with respect to brightness and color. Additionally, the WS2812B LEDs are wired in series allowing for communication via a one-wire interface. This means that one can control each LED in the strip individually using a single Arduino digital pin. This setup also allows for the strip to be cut without damaging the LEDs that precede the cut. With respect to power, the WS2812B LED strip should be powered using 5v where each LED draws about 50mA when set at full brightness. This actually started to become an issue due to the surge protector that was part of our external power source. The surge protector would shut off the supply if the current was approaching 2.4 A. This technical issue was overcome similar to the Arduino issue via a software solution. We limited the how bright the LEDs could get by moding the RGB components by 160 instead of 255. This allowed for eBOX to run longer without running into an over consumption of power issue.<br />
<br />
The KY-038 4 pin microphone allowed for sound detection based off the specs [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino found here]. It is crucial that the microphone has an analog out pin in order for frequency detection to be possible. If the mic only has a digital pin, only threshold sounds detection is possible based on the potentiometer setting.<br />
<br />
The TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration was ideal for functioning as a clean and simple user interface. Essentially a digital signal is sent if a human finger gets close enough to the sensor that a change in capacitance is detected. The finger functions as a dielectric as well as conductor, both contributing to an increase in capacitance. More details on how the finger functions as a dielectric and a conductor, as well as discussion on proximity vs contact can be found [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ here]. The digital signal sent to Arduino due to the change in capacitance was used to change modes from party to lamp to off, enabling a slick user interface to operate eBOX by the touch of a button. <br />
<br />
The adapter for the external power source needed to be usable in most places. That is why we soldered an adapted with a [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] configuration. As previously discussed, the adapter had a built-in surge protector which required us to modulate our energy consumption. The adapter had inputs of 100-240V, 50/60Hz and 0.45A. It outputted 5.25V and 2400mA.<br />
<br />
For the literal hardware set up and configuration see the diagram below <br />
<br />
<gallery><br />
ESE205_Electrical_Diagram_bbb.png| Electrical Diagram <br />
</gallery><br />
<br />
=== The Housing ===<br />
<br />
[[File:Screen Shot 2018-12-07 at 6.52.19 PM.png|thumb|Hardware Box]]<br />
To hold the hardware required for the system, we 3D printed a box using OnShape, a computer-aided design software, that would hold the Arduino and other components. When designing the box, we had to consider how the Arduino would be able to access the lights, touch sensor, and a power source, so we made 3 holes in the box, one on the top and two on either side. This way, the leads from the LED strip could be fed through the top hole, the leads from the external power source could feed through a hole on the side, and the touch sensor could feed through the other hole on the side of the box. We determined that the microphone was sensitive enough that we did not need to consider placing the microphone on outside of the box, so we kept it inside the box to keep the wires out of the way. To ensure that the box would fit smoothly into the table, we excavated one corner so that it would fit into the corner of the table and the user can access the touch sensor that interfaces with the entire system. <br />
<br />
[[File:Screen Shot 2018-12-07 at 7.11.07 PM.png|thumb|Bottom view of the hardware box]]<br />
Keeping in mind that the shell of the box and the excavated corner would take space away from the Arduino, we added about 0.5in to the dimensions of the box to ensure that everything would have space.<br />
<br />
To secure the lights to the table, we super glued the LED strip to the inside suface of the table.<br />
<br />
== Results ==<br />
<br />
Our efforts resulted in a functional led integrated table that met the parameters we set out for ourselves. We successfully designed, coded, and built and dynamically audio responsive LED light show and put it into a table. We did so at more than an affordable price point of $90 ($44 sans IKEA table expenses). Although the brightness modulation was not as extreme as we would have liked it to be, we still had the brightness modulate in response to decibels. An important decision that had to be made was the choice to modulate our individual RGB light wrap around at 150 rather than 255 (see software section of Design&Solutions for further explanation). We did so to decrease power draw and to not activate the surge protector in the external power source's adapter. Unfortunately, this resulted in a more narrow range of brightness intensities. <br />
<br />
=== Shortcomings ===<br />
<br />
All of the modules that we set out to use worked out and synced seamlessly. Challenges we faced included buying the right components that would give us the output we needed to conduct the Fast Fourier Transform, debugging the software, and comparing our initial objectives with the final product we felt that we reach all of our goals. Some restricted access to the workshop barred us from customizing the design of the table, although we still met our desired outcome by using a desk that had an existing transparent glass top.<br />
<br />
<br />
=== Potential Next Steps ===<br />
Our next steps would be to think about securing the table further by adding a waterproof seal around the glass to avoid damaging the hardware and the LED lights. This will make the product even more functional in that someone would not have to worry about their beverage affecting the components of the electrical system. Adding some additional user interfaces such as an LCD screen that tells the user what mode the system is in and making the light patterns even more dynamic through the software is in could also be next steps. <br />
=== Poster ===<br />
<gallery><br />
Screen Shot 2018-12-02 at 4.23.55 PM.png|Poster<br />
</gallery><br />
<br />
=== External Links ===<br />
<br />
[https://docs.google.com/presentation/d/1mnPGURRNoGbIu7AR5VZs8qfj3P0mFTK5Hc8BOpOewkI/edit?usp=sharing Project Proposal Presentation Powerpoint Link]<br />
<br />
[https://github.com/chanelilynn/ESE205 Code Repository]<br />
<br />
== References ==<br />
<br />
*https://sites.wustl.edu/ese498vertigodancefloor/ (Move to the Groove Reference) <br />
<br />
'''Software References'''<br />
*https://github.com/kosme/arduinoFFT (Arduino FFT library)<br />
*https:/ing /forum.arduino.cc/index.php?topic=427386.0 (Arduino FFT discussion page)<br />
*https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT tutorial)<br />
*https://playground.arduino.cc/Code/Filters (Real Time Digital Signal Processing Library)<br />
*https://www.instructables.com/id/Arduino-Audio-Input/ (Tutorial to take in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Frequency-Detection/ (Tutorial to analyze in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Audio-Output/ (Tutorial to output audio for FFT ~40KHz)<br />
*https://www.youtube.com/watch?v=NQinj-tlU-M (LED coding walkthrough)<br />
*https://www.arduino.cc/reference/en/ (Arduino Language Reference)<br />
*https://www.youtube.com/watch?v=5oRir4dck_w (ARDUINO LED LIGHTS WORK AND ARE SOUND RECEPTIVE (with opensource code))<br />
*http://genericnerd.blogspot.com/2009/05/arduino-mood-light-controller.html (Tutorial, LED color transitions)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Electrical Design References'''<br />
*https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10 (purchased microphone)<br />
*https://randomnerdtutorials.com/guide-for-microphone-sound-sensor-with-arduino/ (Guide for microphone sound sensor)<br />
*https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ (Understanding Capacitive Touch Sensors (Self-Capacitance Configuration))<br />
*http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/catalex-ttp223b-arduino-capacitive-touch-sensor-tutorial/ (Tutorial Capacitive Touch Sensor Arduino)<br />
*https://www.instructables.com/id/Wire-a-Potentiometer-as-a-Variable-Resistor/ (Potentiometer, Variable Resistor)<br />
*https://www.instructables.com/id/How-to-use-OLED-display-arduino-module/ (Tutorial LED display)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Physical Design References'''<br />
*https://www.youtube.com/watch?v=kj-oZgmRB2w&t=73s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=pMWnsHpDlQE&t=18s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=OasbgnLOuPI (HOW TO BUILD THE TABLE AND INTEGRATE THE LEDS)<br />
<br />
<br />
<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=15204EBOX2018-12-08T21:28:51Z<p>NishChakra: /* Results */</p>
<hr />
<div>== Project Proposal ==<br />
=== Overview ===<br />
We created an audio responsive LED lighting system integrated on a desk that can be used as a fun addition to one's home entertainment and lighting systems. The EBOX has 3 modes that the user can set with a tap of a touch sensor to customize the dynamic light patterns to fit any mood.<br />
<br />
=== Group Members ===<br />
Jordan Gewirtz<br />
<br />
Chanel Lynn<br />
<br />
Nish Chakraburtty<br />
<br />
Tony Sancho-Spore (TA)<br />
<br />
Dr. James Feher (Prof)<br />
<br />
===Link to Log===<br />
*[[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
*eBOX WUSTL BOX: https://wustl.app.box.com/folder/57307264614]<br />
*Link to tutorial [https://classes.engineering.wustl.edu/ese205/core/index.php?title=Fast_Fourier_Transform_Library_%26_Arduino#Materials_.26_Prerequisites here]<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
*User interface<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Soldering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
*Staying under budget<br />
<br />
=== Gantt Chart ===<br />
<br />
<gallery><br />
Gantt Chart (Rev 3).png| Gantt Chart<br />
</gallery><br />
<br />
=== Budget ===<br />
{| class = "wikitable sortable" {{table}}<br />
| align="center" style="background:#f0f0f0;"|'''Item'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price: Actual (Including Shipping)'''<br />
|-<br />
| Arduino [https://store.arduino.cc/usa/arduino-uno-rev3 (Link)]||1||1|| $22.00 ||$0.00 (Provided by TA)|| $22.00 || $0.00<br />
|-<br />
| Transistors [https://www.mouser.com/ProductDetail/ON-Semiconductor-Fairchild/BC547B?qs=UMEuL5FsraB3zD25tclGGQ%3D%3D&gclid=Cj0KCQjwxvbdBRC0ARIsAKmec9aPrjnMgL2Z2kN_UUj-lH33KsgSWltRarCH75kZdbScUbCfsbLc_NUaAjMkEALw_wcB (Link)]||10|||| $0.06 |||| $0.60 ||$0.00 (Provided by TA)<br />
|-<br />
| LED (strips - 6ft) [https://www.amazon.com/Flexible-Daylight-Kitchen-Christmas-Non-waterproof/dp/B00HSF65MC (Link)]||1||1|| $21.99 |||| $21.99 ||<br />
|-<br />
| Arduino Microphone [https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all (Link)]||10||10|| $0.88 ||$0.69|| $8.88 || $6.90<br />
|-<br />
| Table [https://www.ikea.com/us/en/catalog/products/40303444/#/80221352 (Link)] ||1||1|| $39.99 ||$39.99|| $39.99 || $43.86 <br />
|-<br />
|Capacitive Touch Sensors [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen (Link)]|| - || 5 || - || $1.40 || - || $6.99<br />
|-<br />
| Total||14|||||||| $48.78 ||<br />
|}<br />
<br />
== Design And Solutions ==<br />
<br />
=== Steps to Build the EBOX ===<br />
<br />
1. Program the color patterns<br />
<br />
2. Upload the code to the Arduino<br />
<br />
3. Plug leads into the hardware<br />
<br />
4. Solder external power source to lights and Arduino<br />
<br />
5. CAD box to hold the hardware<br />
<br />
6. Assemble table<br />
<br />
7. Secure lights around the underside of the table<br />
<br />
8. Plug in power source adapter to an outlet, place a speaker near the microphone, and enjoy!<br />
<br />
=== Components ===<br />
<br />
LED Light Strip (6ft)<br />
<br />
Arduino Uno<br />
<br />
Capacitive touch sensor<br />
<br />
Sound Detection Sensor Module (Microphone)<br />
<br />
Desk with glass or translucent top<br />
<br />
5V Power adapter<br />
<br />
Leads (wires)<br />
<br />
=== The Software ===<br />
<br />
The method of approach in terms of software was to program the Arduino to do a running average of the frequencies coming in from the Fast Fourier Transform and send a message to the LED strip to output a certain pattern of lights. <br />
<br />
A Fourier Transform is a transformation of a function of time into the frequencies that make it up, but a Fast Fourier Transform is an algorithm that computes the same result but in nlogn time rather than n^2 by factorizing the discrete Fourier transform matrix into a product of mostly zeros. We downloaded a Fast Fourier Transform Library ('''referecne/link library''') from an open source to translate the analog sound signals into digital signals with this decrease complexity to allow for a quick response to the audio input. Music or other forms of audio are inputted to the system through the Arduino microphone and the Arduino is programmed to take those anolog signals into the FFT (Fast Fourier Transform) operations and the output is series of frequencies in the range of 0-720. <br />
<br />
=== The Electronics ===<br />
====Background====<br />
The electronics that eBOX contains includes an Arduino Uno [https://store.arduino.cc/usa/arduino-uno-rev3], a WS2812B LED strip [https://randomnerdtutorials.com/guide-for-ws2812b-addressable-rgb-led-strip-with-arduino/] , a KY-038 4 pin microphone [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino] , and a TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/] [https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen] , all of which is soldered up to an external power source that has a standard [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] wall outlet adapter.<br />
<br />
====Design Considerations & Challenges Faced====<br />
As discussed in the Software section of this wiki, the Arduino functions as the operator of eBOX. It holds all of the code that allows eBOX to perform its functions as well as serving as the interfacing module with the other hardware components. Detailed specs with respect to the Arduino UNO can be found [https://store.arduino.cc/usa/arduino-uno-rev3 here]. One important aspect to consider is that the Arduino UNO comes with only 2 preset 5v port, but for our setup (see figure below) 3 ports were needed. This potential hardware issue was resolved as the ports of the Arduino can be altered to give out power instead of receive information. In our case, we overrode digital port 13 to be a 5v power port instead. However, it is important to note that only devices that draw low power should be connected to the overrode port to ensure not frying the Arduino; we specifically had the touch sensor be powered by overrode port digital 13 as 2 sensors need approximately 5.5V DC and we only used one. Furthermore, an Arduino was chosen over a Raspberry Pi for simplicity sake. A rule of thumb is that an Arduino is best for repetitive tasks, like performing the same calculations over and over and updating LEDs [https://makezine.com/2015/12/04/admittedly-simplistic-guide-raspberry-pi-vs-arduino/].<br />
<br />
The WS2812B LED strip is a particularly nifty piece of hardware. At 10ft long it provides ample length to satisfy any creative design one is crafting. Furthermore, not only is the strip addressable from Arduino’s fastLED Library, but each individual LED in the strip is addressable with respect to brightness and color. Additionally, the WS2812B LEDs are wired in series allowing for communication via a one-wire interface. This means that one can control each LED in the strip individually using a single Arduino digital pin. This setup also allows for the strip to be cut without damaging the LEDs that precede the cut. With respect to power, the WS2812B LED strip should be powered using 5v where each LED draws about 50mA when set at full brightness. This actually started to become an issue due to the surge protector that was part of our external power source. The surge protector would shut off the supply if the current was approaching 2.4 A. This technical issue was overcome similar to the Arduino issue via a software solution. We limited the how bright the LEDs could get by moding the RGB components by 160 instead of 255. This allowed for eBOX to run longer without running into an over consumption of power issue.<br />
<br />
The KY-038 4 pin microphone allowed for sound detection based off the specs [https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/microphones-with-arduino found here]. It is crucial that the microphone has an analog out pin in order for frequency detection to be possible. If the mic only has a digital pin, only threshold sounds detection is possible based on the potentiometer setting.<br />
<br />
The TTP223B digital capacitive touch sensor utilizing the self-capacitance configuration was ideal for functioning as a clean and simple user interface. Essentially a digital signal is sent if a human finger gets close enough to the sensor that a change in capacitance is detected. The finger functions as a dielectric as well as conductor, both contributing to an increase in capacitance. More details on how the finger functions as a dielectric and a conductor, as well as discussion on proximity vs contact can be found [https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ here]. The digital signal sent to Arduino due to the change in capacitance was used to change modes from party to lamp to off, enabling a slick user interface to operate eBOX by the touch of a button. <br />
<br />
The adapter for the external power source needed to be usable in most places. That is why we soldered an adapted with a [https://www.worldstandards.eu/electricity/plugs-and-sockets/ Type A] configuration. As previously discussed, the adapter had a built-in surge protector which required us to modulate our energy consumption. The adapter had inputs of 100-240V, 50/60Hz and 0.45A. It outputted 5.25V and 2400mA.<br />
<br />
For the literal hardware set up and configuration see the diagram below <br />
<br />
<gallery><br />
ESE205_Electrical_Diagram_bbb.png| Electrical Diagram <br />
</gallery><br />
<br />
=== The Housing ===<br />
<br />
[[File:Screen Shot 2018-12-07 at 6.52.19 PM.png|thumb|Hardware Box]]<br />
To hold the hardware required for the system, we 3D printed a box using OnShape, a computer-aided design software, that would hold the Arduino and other components. When designing the box, we had to consider how the Arduino would be able to access the lights, touch sensor, and a power source, so we made 3 holes in the box, one on the top and two on either side. This way, the leads from the LED strip could be fed through the top hole, the leads from the external power source could feed through a hole on the side, and the touch sensor could feed through the other hole on the side of the box. We determined that the microphone was sensitive enough that we did not need to consider placing the microphone on outside of the box, so we kept it inside the box to keep the wires out of the way. To ensure that the box would fit smoothly into the table, we excavated one corner so that it would fit into the corner of the table and the user can access the touch sensor that interfaces with the entire system. <br />
<br />
[[File:Screen Shot 2018-12-07 at 7.11.07 PM.png|thumb|Bottom view of the hardware box]]<br />
Keeping in mind that the shell of the box and the excavated corner would take space away from the Arduino, we added about 0.5in to the dimensions of the box to ensure that everything would have space.<br />
<br />
To secure the lights to the table, we super glued the LED strip to the inside suface of the table.<br />
<br />
== Results ==<br />
<br />
<br />
<br />
=== Shortcomings ===<br />
<br />
All of the modules that we set out to use worked out and synced seamlessly. Challenges we faced included buying the right components that would give us the output we needed to conduct the Fast Fourier Transform, debugging the software, and comparing our initial objectives with the final product we felt that we reach all of our goals. <br />
<br />
=== Potential Next Steps ===<br />
Our next steps would be to think about securing the table further by adding a waterproof seal around the glass to avoid damaging the hardware and the LED lights. This will make the product even more functional in that someone would not have to worry about their beverage affecting the components of the electrical system. Adding some additional user interfaces such as an LCD screen that tells the user what mode the system is in and making the light patterns even more dynamic through the software is in could also be next steps. Some restricted access to the workshop barred us from customizing the design of the table, although we still met our desired outcome by using a desk that had an existing transparent glass top.<br />
<br />
=== Poster ===<br />
<gallery><br />
Screen Shot 2018-12-02 at 4.23.55 PM.png|Poster<br />
</gallery><br />
<br />
=== External Links ===<br />
<br />
[https://docs.google.com/presentation/d/1mnPGURRNoGbIu7AR5VZs8qfj3P0mFTK5Hc8BOpOewkI/edit?usp=sharing Project Proposal Presentation Powerpoint Link]<br />
<br />
[https://github.com/chanelilynn/ESE205 Code Repository]<br />
<br />
== References ==<br />
<br />
*https://sites.wustl.edu/ese498vertigodancefloor/ (Move to the Groove Reference) <br />
<br />
'''Software References'''<br />
*https://github.com/kosme/arduinoFFT (Arduino FFT library)<br />
*https:/ing /forum.arduino.cc/index.php?topic=427386.0 (Arduino FFT discussion page)<br />
*https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/ (Arduino FFT tutorial)<br />
*https://playground.arduino.cc/Code/Filters (Real Time Digital Signal Processing Library)<br />
*https://www.instructables.com/id/Arduino-Audio-Input/ (Tutorial to take in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Frequency-Detection/ (Tutorial to analyze in audio for FFT ~40KHz)<br />
*https://www.instructables.com/id/Arduino-Audio-Output/ (Tutorial to output audio for FFT ~40KHz)<br />
*https://www.youtube.com/watch?v=NQinj-tlU-M (LED coding walkthrough)<br />
*https://www.arduino.cc/reference/en/ (Arduino Language Reference)<br />
*https://www.youtube.com/watch?v=5oRir4dck_w (ARDUINO LED LIGHTS WORK AND ARE SOUND RECEPTIVE (with opensource code))<br />
*http://genericnerd.blogspot.com/2009/05/arduino-mood-light-controller.html (Tutorial, LED color transitions)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Electrical Design References'''<br />
*https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10 (purchased microphone)<br />
*https://randomnerdtutorials.com/guide-for-microphone-sound-sensor-with-arduino/ (Guide for microphone sound sensor)<br />
*https://www.allaboutcircuits.com/technical-articles/introduction-to-capacitive-touch-sensing/ (Understanding Capacitive Touch Sensors (Self-Capacitance Configuration))<br />
*http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/catalex-ttp223b-arduino-capacitive-touch-sensor-tutorial/ (Tutorial Capacitive Touch Sensor Arduino)<br />
*https://www.instructables.com/id/Wire-a-Potentiometer-as-a-Variable-Resistor/ (Potentiometer, Variable Resistor)<br />
*https://www.instructables.com/id/How-to-use-OLED-display-arduino-module/ (Tutorial LED display)<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/ (Simple version of our project)<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4 (Simple tutorial, make LEDs dance)<br />
<br />
'''Physical Design References'''<br />
*https://www.youtube.com/watch?v=kj-oZgmRB2w&t=73s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=pMWnsHpDlQE&t=18s (OnShape Tutorial)<br />
*https://www.youtube.com/watch?v=OasbgnLOuPI (HOW TO BUILD THE TABLE AND INTEGRATE THE LEDS)<br />
<br />
<br />
<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log&diff=14100EBOX Log2018-11-01T22:04:37Z<p>NishChakra: /* October 28 to November 3 */</p>
<hr />
<div>===eBOX Project Page===<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
=== August 26 to September 1===<br />
'''Team''' <br /> <br />
*(1hr) Discussed the very basic idea of the project at the first class August 31.<br />
<br />
=== September 2 to September 8 ===<br />
'''Jordan''' <br /><br />
*(0.5hr) September 6: Learned the basics of using Wiki. Created the Project Page and Log.<br />
'''Team''' <br /><br />
*(1hr) September 7: Team meeting to discuss the project further in depth and to ensure all the team members truly understood the project. Additionally, read up on the night light project to prepare for class, and checked swipe access to the lab, Urbauer 015.<br />
=== September 9 to September 15 ===<br />
'''Team''' <br /><br />
*(1hr) September 11: Extra weekly meeting in the lab. Will look into Arduino vs Raspberry Pi, feasibility of Fast Fourier Transforms (FFT) @40kHz on each, and current literature similar to eBOX (WUSTL Move to the Groove: https://sites.wustl.edu/ese498vertigodancefloor/). Additionally, completed the breadboard for the night light and stored it for safe keeping in the locker.<br />
*(0.5hr) September 14: Traditional weekly meeting in the lab. Told to update log and project page to include better format and information (reference links/research). Getting an Arduino from Tony and by next Friday will attempt to make LED blink from Arduino and import an appropriate LED library for practice. <br />
'''Jordan''' <br /><br />
*(0.25hr) September 12: Added to and reformatted the log to be headed by dates.<br />
*(0.25hr) September 12: Read up on Ardunios and Raspberry Pis and their feasibility of FFT @40KHz with an analog to digital converter as well as WUSTL Move to the Groove. <br />
'''Nish''' <br /><br />
*(0.33hr/20min) September 13: Researched Arduino and Pi to compare and decide which would be better to use for project implementation. Leaning towards Arduino.<br />
<br />
*(0.5hr/30min) September 14: Researched other implementations of music responsive LED's for inspiration and to reinforce learnings towards Arduino.<br />
<br />
=== September 16 to September 22 ===<br />
<br />
'''Team''' <br /><br />
*(0.5hrs) September 21: Rehearsed group presentation.<br />
'''Nish''' <br /><br />
*(1hr/60min) September 16: arduino prep course online (youtube)<br />
*(2hr/120min) September 18: Finished presentation powerpoint, made gant chart, researched additional cost of necessary materials (LED's, arduino microphone shield, tables ect...), assigned initial circuitry research to Jordan. Assigned gant chart and budget supplement wiki posting to chanel. <br />
*(1hr/60min) September 19: arduino prep course online (youtube)<br />
*(2hr/120min) September 22: Made arduino single led light blink, varied time patterns. Wrote code. Conducted research for table construction and LED integration into furniture pieces. Wrote code that needs to be tested for LED strips when strips come in the mail and circuitry is available. <br />
'''Jordan''' <br /><br />
*(2hrs) September 20: Researched the basics of Arduino, and c (structure, syntax, methods, etc...) (relevant links in Project References)<br />
*(1hr) September 21: Researched Arduino circuitry and code to make LEDs on Breadboard blink (relevant links in project references, basics of circuit in Project Electronics). Need to add transistors in series in order to be able to modulate light intensity (not currently picture in Project Electronics). <br />
Basic Circuit Arduino & LEDs:<br />
<br />
Common Ground between Arduino and Breadboard.<br />
<br />
Resistors to be in series with LEDs.<br />
<br />
LED (+/-) Orientation.<br />
<br />
LEDs in series with resistors.<br />
<br />
Completing the circuit from Breadboard back to Arduino.<br />
<br />
<gallery><br />
Common ground.jpeg|Common Ground<br />
resistors to be in series with LEDS.jpeg|Resistors in series<br />
LED orientation.jpeg|LED Orientation (+/-)<br />
LEDs in Series with Resistors.jpeg|LEDs in series with resistors<br />
Complete the circuit.jpeg|Completing the circuit from Breadboard back to Arduino<br />
</gallery><br />
<br />
*(1hr) September 21: Onshape account and tutorial.<br />
*(0.5hrs) September 21: edited and rehearsed class presentation.<br />
'''Chanel''' <br /><br />
*(2hrs) September 20: Found libraries to reference when writing Arduino code for lighting up with music input, downloaded and created account for using Arduino on personal device<br />
<br />
=== September 23 to September 29 ===<br />
'''Jordan''' <br /><br />
*(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
<br />
Night Light Working:<br />
<br />
Circuit to Perfboard Diagram:<br />
<br />
Perfboard Diagram Key:<br />
<br />
Circuit laid out on Perfboard:<br />
<br />
Perfboard Completed:<br />
<br />
*(3hrs) designing microphone circuitry, updating with pictures and diagrams before meeting.<br />
*Microphone Circuit 1:<br />
*[[File:Microphone Circuit Notes.pdf|thumb|Microphone Circuit Notes]]<br />
*[[File:Microphone Circuit Diagram 1.pdf|thumb|Microphone Circuit Diagram]]<br />
*(0.75hrs) Uploaded files to demonstrate progress and reformated various items in the log and project page.<br />
<br />
<gallery><br />
night light circ.JPEG|Night Light Circuit<br />
night light wokring.JPEG|Night Light Working<br />
circ to perf diagram.JPEG|Circuit to perfboad diagram<br />
perf board key.JPEG|Perfboard Diagram Key<br />
circ laid on perf.JPEG|Circuit laid out on perfboard<br />
perf board complete.JPEG|Perfboard Completed<br />
</gallery><br />
<br />
'''Nish''' <br /><br />
*(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
*(6hr/360min): played around with the LED hardware and mangled the strips. Found FastLED library which has pre-coded fft's in it. Made a template for the code that SHOULD be able to interface with the arduino and all the jazz when we get the hardware up and that should be good. By template I mean 240 lines that should work and if not I'll leave debugging to future me and future chanel for later. <br />
'''Chanel''' <br /><br />
*(2.5hr): September 26 Learning Arduino syntax and interfacing code with the hardware (via YouTube)<br />
'''Next Week''' <br /><br />
*Need to actually construct a circuit with an Arduino and make LED Strip dance. So far has only been individual LEDs.<br />
*Need to decide on what parts we need to order for circuit: analog to digital converter, amplifier, etc...; Update theoretical design.<br />
*Uncertain about current design due to minimal prior experience <br />
*Decide on FFT code and understand the principles to be able to explain it to someone unfamiliar with Fourier Transform.<br />
*Draw general design of project demonstrating how we intend to incorporate hardware into table.<br />
<br />
=== September 30 to October 6 ===<br />
'''Jordan''' <br /><br />
*(1hr) September 30: Went over theoretical design of microphone circuit and assessed its validity.<br />
*(1hr) October 2: Examined and played around with arduino microphone that came in.<br />
*(1hr) October 2: Investigated what came builtin with the arduino microphone to determined what, if any, additional circuitry parts were needed.<br />
*(2hr) October 4: Worked on CADing the night light case. <br />
*(1hr) October 5: Fabricated proper cords for connecting arduino microphone to arduino. Checked CAD with TA.<br />
<br />
'''Chanel''' <br /><br />
*(1hr) October 5: Discussed microphone circuitry with TA and Jordan<br />
*(1hr) October 5: Researched serial plotting of microphone input & learned about how to use visualization tools in Arduino for sound <br />
'''Goals for Next 2 Week''' <br /><br />
*Make entire strip of LEDs light up and play around with individual color changes <br />
*Have arduino pick up microphone inputs<br />
*Graph multiple arrays of dummy data using C and arduino<br />
*Finalize everything with respect to design and budget<br />
=== October 7 to October 13 ===<br />
'''Jordan''' <br /><br />
*(1hr) October 9: Researched code in order to register microphone inputs<br />
*(3hr) October 10: Interfaced current microphone with arduino. Learned how to set up arduino to microphone. Learned how to write and updated code that the arduino can process. Learned how to use a potentiometer to adjust threshold detection. Learned how to monitor output prints in Serial Monitor. Concluded that the microphone works, is adjustable, and can register sound above threshold. However, it is only a yes no (0 1) signal. No amplitude or frequency is registered. Thus, we need a different mic as I don't believe a converter for this issue exists nor would be simpler than getting a digital or analog microphone that captures fluctuation in voltage amplitude/frequency.<br />
*(0.5hr) October 10: 3D print for night light finished up. Will be putting finishing touches to case soon to complete preliminary project. Found new microphone.<br />
<br />
'''Nish''' <br /><br />
*(7hr) October 13th: found and bought arduino mic. Played with hardware and made the arduino, mic, led circuit. Confirmed that code works. Got LEDs flashing in non random color patterns to music input. Only got it to do so for 3 minutes before the strip bugged out. Confirmed it was a problem with the data uptake from a wire on the strip and will either need to fix the strip or buy a new one. Moral of the story is big steps were taken and now all we need to do is get the LED strip to function and to put all this in a table. <br />
<br />
'''Goals for Next Week''' <br /><br />
*Get proper microphone, get it and the arduino to register and capture sound amplitudes or frequencies. (COMPLETED TIME TO FORMULATE NEW GOALS) <br />
*https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all<br />
*Reasonably priced pack of 5 that can arrive between October 16 and 19.<br />
=== October 14 to October 20 (Fall Break) ===<br />
'''Jordan''' <br /><br />
*(0.5hr) October 14: New microphones inbound<br />
*(2hr) October 18: Finalized night light case (thumbnails attached)<br />
*Link to CAD: https://cad.onshape.com/documents/840f15204f062ec66137a87a/w/a93c2ec4fc3cf4a8f1049325/e/d3c7d563d9eae4a17240e64c<br />
<gallery><br />
Front of night light.jpeg|Front of Night Light<br />
Back of night light.jpeg|Back of Night Light<br />
</gallery><br />
<br />
'''Nish''' <br /><br />
*(2hr/ 120min) October 14: continued trying to fix the LED strip so data from the arduino can go through<br />
*(2hr/ 120min) October 15: soldered new wires from data input onto the led strips and kept tinkering (got 50% of the leds to work on the strip so it's confirmed it's just a data transfer issue and not an arduino/code/mic issue)<br />
<br />
'''Chanel''' <br /><br />
*(1.5 hrs) October 19: Redesigned Gantt Chart including dates corresponding to those in the weekly log<br />
*(1.5 hrs) October 20: Uploaded new Gantt Chart. Reorganized attached pictures in Wiki in gallery form in the corresponding section in the log<br />
<br />
''Goals for Next Week'' <br /><br />
*Since the FFT is working:<br />
*Continue fixing the LED wiring to ensure complete and proper transfer of data<br />
*Play with code to get fun different patterns of lights<br />
*Begin designing a way for the user to interact/interface with eBOX<br />
*Updated budget, gantt chart, block diagram, clean up wiki pictures (Chanel)<br />
<br />
=== October 21 to October 27 ===<br />
'''Jordan''' <br /><br />
*(1hr) October 23: Researched capacitive touch sensor<br />
*(1hr) October 23: Ideated eBOX user interface concept<br />
*(0.5hr) October 23: Ordered capacitive touch sensor for user interface: https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen <br />
*(2hr) October 24: Consulted on transform and LED code<br />
*(1hr) October 26: Cleaned up Wikis<br />
*(2hr) October 26: debugged code, played with LEDs<br />
'''Nish''' <br /><br />
*(2hr) October 21: Continued to play around with code. Lights still responsive but not giving necessary color ranges.<br />
*(3hr) October 22: Definitively found out that the screw on the sound receptor is a potentiometer. Researched external power source options. Increased the color ranges through code and potentiometer manipulation.<br />
*(5hr) October 25: Discovered that the range of analog outputs put out by our sensor is too small. The code requires a low and a high reading. Found interesting behavior when the gap between low and high increases we get more color ranges however we loose mic sensitivity and the leds start crapping out. Narrow the gap and we get dynamic LED responses but poor color ranges. Currently I believe it is a hardware problem. The current mic isn't sensitive enough to put out a wide variety of analog outputs necessary for the code to manipulate and output the colors we need. Also it doesn't do well when the music source moves far away from the microphone. <br />
*(2hr) October 26: debugged code, played with LEDs<br />
*[[File:LED Code.pdf|LED Code]]<br />
<br />
'''Chanel'''<br />
*(1.5hr) October 25: Made the first draft of the circuit diagram. Uploaded new Gantt Chart.<br />
<gallery><br />
1st draft electrical diagram.jpeg|Electrical Diagram Draft #1<br />
</gallery><br />
<br />
''Goals for Next Week'' <br /><br />
*Diagnose and fix microphone problem and get a large enough sampling range and enough mic sensitivity<br />
Potential Software Solutions:<br />
*https://www.instructables.com/id/Arduino-Audio-Input/<br />
*https://www.instructables.com/id/Arduino-Frequency-Detection/<br />
*https://www.instructables.com/id/Arduino-Audio-Output/<br />
*Fix color range<br />
*code in 2 modes for the LED strip, the party mode that's currently being worked on, and utility mode that just switches to white light<br />
*work on the external power source<br />
<br />
=== October 28 to November 3===<br />
'''Jordan''' <br /><br />
*(2hr) October 31: Obtained proof of concept that the capacitive touch sensors work <br />
<gallery><br />
Proof of concept Capture.JPG|Proof of concept for capacitive touch senor<br />
</gallery><br />
*[[File:Proof of concept code.pdf|Proof of concept for capacitive touch sensor Code]]<br />
<br />
'''Nish''' <br /><br />
*(5hr) November 1: Fixed lights. They now vary in pattern and color and do not just stick at white. Next steps are to hook up an external power source and easily program a white light fixture feature and an off switch. The table was bought at Ikea, with Chanel, and sitting in the lab.<br />
<br />
* Goals for the weekend: build a repository for the code and publish everything. Have Tony help me put together the external power source and wire everything up. If I'm lucky I'll code in the different features and have Tony help me put in the switch. <br />
'''Chanel''' <br /><br />
*(2hr) November 1: Roadtripped through hectic traffic and bought table with Nish. <br />
<br />
eBOX Project Page:<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
[[Category:Logs]]<br />
[[Category:Fall 2018 Logs]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log&diff=14099EBOX Log2018-11-01T22:01:04Z<p>NishChakra: /* October 28 to November 3 */</p>
<hr />
<div>===eBOX Project Page===<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
=== August 26 to September 1===<br />
'''Team''' <br /> <br />
*(1hr) Discussed the very basic idea of the project at the first class August 31.<br />
<br />
=== September 2 to September 8 ===<br />
'''Jordan''' <br /><br />
*(0.5hr) September 6: Learned the basics of using Wiki. Created the Project Page and Log.<br />
'''Team''' <br /><br />
*(1hr) September 7: Team meeting to discuss the project further in depth and to ensure all the team members truly understood the project. Additionally, read up on the night light project to prepare for class, and checked swipe access to the lab, Urbauer 015.<br />
=== September 9 to September 15 ===<br />
'''Team''' <br /><br />
*(1hr) September 11: Extra weekly meeting in the lab. Will look into Arduino vs Raspberry Pi, feasibility of Fast Fourier Transforms (FFT) @40kHz on each, and current literature similar to eBOX (WUSTL Move to the Groove: https://sites.wustl.edu/ese498vertigodancefloor/). Additionally, completed the breadboard for the night light and stored it for safe keeping in the locker.<br />
*(0.5hr) September 14: Traditional weekly meeting in the lab. Told to update log and project page to include better format and information (reference links/research). Getting an Arduino from Tony and by next Friday will attempt to make LED blink from Arduino and import an appropriate LED library for practice. <br />
'''Jordan''' <br /><br />
*(0.25hr) September 12: Added to and reformatted the log to be headed by dates.<br />
*(0.25hr) September 12: Read up on Ardunios and Raspberry Pis and their feasibility of FFT @40KHz with an analog to digital converter as well as WUSTL Move to the Groove. <br />
'''Nish''' <br /><br />
*(0.33hr/20min) September 13: Researched Arduino and Pi to compare and decide which would be better to use for project implementation. Leaning towards Arduino.<br />
<br />
*(0.5hr/30min) September 14: Researched other implementations of music responsive LED's for inspiration and to reinforce learnings towards Arduino.<br />
<br />
=== September 16 to September 22 ===<br />
<br />
'''Team''' <br /><br />
*(0.5hrs) September 21: Rehearsed group presentation.<br />
'''Nish''' <br /><br />
*(1hr/60min) September 16: arduino prep course online (youtube)<br />
*(2hr/120min) September 18: Finished presentation powerpoint, made gant chart, researched additional cost of necessary materials (LED's, arduino microphone shield, tables ect...), assigned initial circuitry research to Jordan. Assigned gant chart and budget supplement wiki posting to chanel. <br />
*(1hr/60min) September 19: arduino prep course online (youtube)<br />
*(2hr/120min) September 22: Made arduino single led light blink, varied time patterns. Wrote code. Conducted research for table construction and LED integration into furniture pieces. Wrote code that needs to be tested for LED strips when strips come in the mail and circuitry is available. <br />
'''Jordan''' <br /><br />
*(2hrs) September 20: Researched the basics of Arduino, and c (structure, syntax, methods, etc...) (relevant links in Project References)<br />
*(1hr) September 21: Researched Arduino circuitry and code to make LEDs on Breadboard blink (relevant links in project references, basics of circuit in Project Electronics). Need to add transistors in series in order to be able to modulate light intensity (not currently picture in Project Electronics). <br />
Basic Circuit Arduino & LEDs:<br />
<br />
Common Ground between Arduino and Breadboard.<br />
<br />
Resistors to be in series with LEDs.<br />
<br />
LED (+/-) Orientation.<br />
<br />
LEDs in series with resistors.<br />
<br />
Completing the circuit from Breadboard back to Arduino.<br />
<br />
<gallery><br />
Common ground.jpeg|Common Ground<br />
resistors to be in series with LEDS.jpeg|Resistors in series<br />
LED orientation.jpeg|LED Orientation (+/-)<br />
LEDs in Series with Resistors.jpeg|LEDs in series with resistors<br />
Complete the circuit.jpeg|Completing the circuit from Breadboard back to Arduino<br />
</gallery><br />
<br />
*(1hr) September 21: Onshape account and tutorial.<br />
*(0.5hrs) September 21: edited and rehearsed class presentation.<br />
'''Chanel''' <br /><br />
*(2hrs) September 20: Found libraries to reference when writing Arduino code for lighting up with music input, downloaded and created account for using Arduino on personal device<br />
<br />
=== September 23 to September 29 ===<br />
'''Jordan''' <br /><br />
*(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
<br />
Night Light Working:<br />
<br />
Circuit to Perfboard Diagram:<br />
<br />
Perfboard Diagram Key:<br />
<br />
Circuit laid out on Perfboard:<br />
<br />
Perfboard Completed:<br />
<br />
*(3hrs) designing microphone circuitry, updating with pictures and diagrams before meeting.<br />
*Microphone Circuit 1:<br />
*[[File:Microphone Circuit Notes.pdf|thumb|Microphone Circuit Notes]]<br />
*[[File:Microphone Circuit Diagram 1.pdf|thumb|Microphone Circuit Diagram]]<br />
*(0.75hrs) Uploaded files to demonstrate progress and reformated various items in the log and project page.<br />
<br />
<gallery><br />
night light circ.JPEG|Night Light Circuit<br />
night light wokring.JPEG|Night Light Working<br />
circ to perf diagram.JPEG|Circuit to perfboad diagram<br />
perf board key.JPEG|Perfboard Diagram Key<br />
circ laid on perf.JPEG|Circuit laid out on perfboard<br />
perf board complete.JPEG|Perfboard Completed<br />
</gallery><br />
<br />
'''Nish''' <br /><br />
*(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
*(6hr/360min): played around with the LED hardware and mangled the strips. Found FastLED library which has pre-coded fft's in it. Made a template for the code that SHOULD be able to interface with the arduino and all the jazz when we get the hardware up and that should be good. By template I mean 240 lines that should work and if not I'll leave debugging to future me and future chanel for later. <br />
'''Chanel''' <br /><br />
*(2.5hr): September 26 Learning Arduino syntax and interfacing code with the hardware (via YouTube)<br />
'''Next Week''' <br /><br />
*Need to actually construct a circuit with an Arduino and make LED Strip dance. So far has only been individual LEDs.<br />
*Need to decide on what parts we need to order for circuit: analog to digital converter, amplifier, etc...; Update theoretical design.<br />
*Uncertain about current design due to minimal prior experience <br />
*Decide on FFT code and understand the principles to be able to explain it to someone unfamiliar with Fourier Transform.<br />
*Draw general design of project demonstrating how we intend to incorporate hardware into table.<br />
<br />
=== September 30 to October 6 ===<br />
'''Jordan''' <br /><br />
*(1hr) September 30: Went over theoretical design of microphone circuit and assessed its validity.<br />
*(1hr) October 2: Examined and played around with arduino microphone that came in.<br />
*(1hr) October 2: Investigated what came builtin with the arduino microphone to determined what, if any, additional circuitry parts were needed.<br />
*(2hr) October 4: Worked on CADing the night light case. <br />
*(1hr) October 5: Fabricated proper cords for connecting arduino microphone to arduino. Checked CAD with TA.<br />
<br />
'''Chanel''' <br /><br />
*(1hr) October 5: Discussed microphone circuitry with TA and Jordan<br />
*(1hr) October 5: Researched serial plotting of microphone input & learned about how to use visualization tools in Arduino for sound <br />
'''Goals for Next 2 Week''' <br /><br />
*Make entire strip of LEDs light up and play around with individual color changes <br />
*Have arduino pick up microphone inputs<br />
*Graph multiple arrays of dummy data using C and arduino<br />
*Finalize everything with respect to design and budget<br />
=== October 7 to October 13 ===<br />
'''Jordan''' <br /><br />
*(1hr) October 9: Researched code in order to register microphone inputs<br />
*(3hr) October 10: Interfaced current microphone with arduino. Learned how to set up arduino to microphone. Learned how to write and updated code that the arduino can process. Learned how to use a potentiometer to adjust threshold detection. Learned how to monitor output prints in Serial Monitor. Concluded that the microphone works, is adjustable, and can register sound above threshold. However, it is only a yes no (0 1) signal. No amplitude or frequency is registered. Thus, we need a different mic as I don't believe a converter for this issue exists nor would be simpler than getting a digital or analog microphone that captures fluctuation in voltage amplitude/frequency.<br />
*(0.5hr) October 10: 3D print for night light finished up. Will be putting finishing touches to case soon to complete preliminary project. Found new microphone.<br />
<br />
'''Nish''' <br /><br />
*(7hr) October 13th: found and bought arduino mic. Played with hardware and made the arduino, mic, led circuit. Confirmed that code works. Got LEDs flashing in non random color patterns to music input. Only got it to do so for 3 minutes before the strip bugged out. Confirmed it was a problem with the data uptake from a wire on the strip and will either need to fix the strip or buy a new one. Moral of the story is big steps were taken and now all we need to do is get the LED strip to function and to put all this in a table. <br />
<br />
'''Goals for Next Week''' <br /><br />
*Get proper microphone, get it and the arduino to register and capture sound amplitudes or frequencies. (COMPLETED TIME TO FORMULATE NEW GOALS) <br />
*https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all<br />
*Reasonably priced pack of 5 that can arrive between October 16 and 19.<br />
=== October 14 to October 20 (Fall Break) ===<br />
'''Jordan''' <br /><br />
*(0.5hr) October 14: New microphones inbound<br />
*(2hr) October 18: Finalized night light case (thumbnails attached)<br />
*Link to CAD: https://cad.onshape.com/documents/840f15204f062ec66137a87a/w/a93c2ec4fc3cf4a8f1049325/e/d3c7d563d9eae4a17240e64c<br />
<gallery><br />
Front of night light.jpeg|Front of Night Light<br />
Back of night light.jpeg|Back of Night Light<br />
</gallery><br />
<br />
'''Nish''' <br /><br />
*(2hr/ 120min) October 14: continued trying to fix the LED strip so data from the arduino can go through<br />
*(2hr/ 120min) October 15: soldered new wires from data input onto the led strips and kept tinkering (got 50% of the leds to work on the strip so it's confirmed it's just a data transfer issue and not an arduino/code/mic issue)<br />
<br />
'''Chanel''' <br /><br />
*(1.5 hrs) October 19: Redesigned Gantt Chart including dates corresponding to those in the weekly log<br />
*(1.5 hrs) October 20: Uploaded new Gantt Chart. Reorganized attached pictures in Wiki in gallery form in the corresponding section in the log<br />
<br />
''Goals for Next Week'' <br /><br />
*Since the FFT is working:<br />
*Continue fixing the LED wiring to ensure complete and proper transfer of data<br />
*Play with code to get fun different patterns of lights<br />
*Begin designing a way for the user to interact/interface with eBOX<br />
*Updated budget, gantt chart, block diagram, clean up wiki pictures (Chanel)<br />
<br />
=== October 21 to October 27 ===<br />
'''Jordan''' <br /><br />
*(1hr) October 23: Researched capacitive touch sensor<br />
*(1hr) October 23: Ideated eBOX user interface concept<br />
*(0.5hr) October 23: Ordered capacitive touch sensor for user interface: https://www.amazon.com/WINGONEER-TTP223B-Digital-Capacitive-Arduino/dp/B06XHJCG1Y/ref=sr_1_fkmr0_1?ie=UTF8&qid=1540571349&sr=8-1-fkmr0&keywords=WINGONEER+DIY+5PCS+TTP223B+Digital+Touch+Capacitive+Sen <br />
*(2hr) October 24: Consulted on transform and LED code<br />
*(1hr) October 26: Cleaned up Wikis<br />
*(2hr) October 26: debugged code, played with LEDs<br />
'''Nish''' <br /><br />
*(2hr) October 21: Continued to play around with code. Lights still responsive but not giving necessary color ranges.<br />
*(3hr) October 22: Definitively found out that the screw on the sound receptor is a potentiometer. Researched external power source options. Increased the color ranges through code and potentiometer manipulation.<br />
*(5hr) October 25: Discovered that the range of analog outputs put out by our sensor is too small. The code requires a low and a high reading. Found interesting behavior when the gap between low and high increases we get more color ranges however we loose mic sensitivity and the leds start crapping out. Narrow the gap and we get dynamic LED responses but poor color ranges. Currently I believe it is a hardware problem. The current mic isn't sensitive enough to put out a wide variety of analog outputs necessary for the code to manipulate and output the colors we need. Also it doesn't do well when the music source moves far away from the microphone. <br />
*(2hr) October 26: debugged code, played with LEDs<br />
*[[File:LED Code.pdf|LED Code]]<br />
<br />
'''Chanel'''<br />
*(1.5hr) October 25: Made the first draft of the circuit diagram. Uploaded new Gantt Chart.<br />
<gallery><br />
1st draft electrical diagram.jpeg|Electrical Diagram Draft #1<br />
</gallery><br />
<br />
''Goals for Next Week'' <br /><br />
*Diagnose and fix microphone problem and get a large enough sampling range and enough mic sensitivity<br />
Potential Software Solutions:<br />
*https://www.instructables.com/id/Arduino-Audio-Input/<br />
*https://www.instructables.com/id/Arduino-Frequency-Detection/<br />
*https://www.instructables.com/id/Arduino-Audio-Output/<br />
*Fix color range<br />
*code in 2 modes for the LED strip, the party mode that's currently being worked on, and utility mode that just switches to white light<br />
*work on the external power source<br />
<br />
=== October 28 to November 3===<br />
'''Jordan''' <br /><br />
*(2hr) October 31: Obtained proof of concept that the capacitive touch sensors work <br />
<gallery><br />
Proof of concept Capture.JPG|Proof of concept for capacitive touch senor<br />
</gallery><br />
*[[File:Proof of concept code.pdf|Proof of concept for capacitive touch sensor Code]]<br />
<br />
'''Nish''' <br /><br />
*(5hr) November 1: Fixed lights. They now vary in pattern and color and do not just stick at white. Next steps are to hook up an external power source and easily program a white light fixture feature and an off switch. The table was bought at Ikea, with Chanel, and sitting in the lab.<br />
<br />
'''Chanel''' <br /><br />
*(2hr) November 1: Roadtripped through hectic traffic and bought table with Nish. <br />
<br />
eBOX Project Page:<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
[[Category:Logs]]<br />
[[Category:Fall 2018 Logs]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log&diff=13733EBOX Log2018-10-18T17:24:40Z<p>NishChakra: /* October 14 to October 20 (Fall Break) */</p>
<hr />
<div>===eBOX Project Page===<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
=== August 26 to September 1===<br />
'''Team''' <br /> <br />
*(1hr) Discussed the very basic idea of the project at the first class August 31.<br />
<br />
=== September 2 to September 8 ===<br />
'''Jordan''' <br /><br />
*(0.5hr) September 6: Learned the basics of using Wiki. Created the Project Page and Log.<br />
'''Team''' <br /><br />
*(1hr) September 7: Team meeting to discuss the project further in depth and to ensure all the team members truly understood the project. Additionally, read up on the night light project to prepare for class, and checked swipe access to the lab, Urbauer 015.<br />
=== September 9 to September 15 ===<br />
'''Team''' <br /><br />
*(1hr) September 11: Extra weekly meeting in the lab. Will look into Arduino vs Raspberry Pi, feasibility of Fast Fourier Transforms (FFT) @40kHz on each, and current literature similar to eBOX (WUSTL Move to the Groove: https://sites.wustl.edu/ese498vertigodancefloor/). Additionally, completed the breadboard for the night light and stored it for safe keeping in the locker.<br />
*(0.5hr) September 14: Traditional weekly meeting in the lab. Told to update log and project page to include better format and information (reference links/research). Getting an Arduino from Tony and by next Friday will attempt to make LED blink from Arduino and import an appropriate LED library for practice. <br />
'''Jordan''' <br /><br />
*(0.25hr) September 12: Added to and reformatted the log to be headed by dates.<br />
*(0.25hr) September 12: Read up on Ardunios and Raspberry Pis and their feasibility of FFT @40KHz with an analog to digital converter as well as WUSTL Move to the Groove. <br />
'''Nish''' <br /><br />
*(0.33hr/20min) September 13: Researched Arduino and Pi to compare and decide which would be better to use for project implementation. Leaning towards Arduino.<br />
<br />
*(0.5hr/30min) September 14: Researched other implementations of music responsive LED's for inspiration and to reinforce learnings towards Arduino.<br />
<br />
=== September 16 to September 22 ===<br />
<br />
'''Team''' <br /><br />
*(0.5hrs) September 21: Rehearsed group presentation.<br />
'''Nish''' <br /><br />
*(1hr/60min) September 16: arduino prep course online (youtube)<br />
*(2hr/120min) September 18: Finished presentation powerpoint, made gant chart, researched additional cost of necessary materials (LED's, arduino microphone shield, tables ect...), assigned initial circuitry research to Jordan. Assigned gant chart and budget supplement wiki posting to chanel. <br />
*(1hr/60min) September 19: arduino prep course online (youtube)<br />
*(2hr/120min) September 22: Made arduino single led light blink, varied time patterns. Wrote code. Conducted research for table construction and LED integration into furniture pieces. Wrote code that needs to be tested for LED strips when strips come in the mail and circuitry is available. <br />
'''Jordan''' <br /><br />
*(2hrs) September 20: Researched the basics of Arduino, and c (structure, syntax, methods, etc...) (relevant links in Project References)<br />
*(1hr) September 21: Researched Arduino circuitry and code to make LEDs on Breadboard blink (relevant links in project references, basics of circuit in Project Electronics). Need to add transistors in series in order to be able to modulate light intensity (not currently picture in Project Electronics). <br />
Basic Circuit Arduino & LEDs:<br />
[[File:Common ground.jpeg|thumb|Common Ground]]<br />
<br />
Common Ground between Arduino and Breadboard.<br />
<br />
[[File:resistors to be in series with LEDS.jpeg|thumb|Resistors in series]]<br />
<br />
Resistors to be in series with LEDs.<br />
<br />
[[File:LED orientation.jpeg|thumb|LED Orientation (+/-)]]<br />
<br />
LED (+/-) Orientation.<br />
<br />
[[File:LEDs in Series with Resistors.jpeg|thumb|LEDs in series with resistors]]<br />
<br />
LEDs in series with resistors.<br />
<br />
[[File:Complete the circuit.jpeg|thumb|Completing the circuit from Breadboard back to Arduino]]<br />
<br />
Completing the circuit from Breadboard back to Arduino.<br />
<br />
*(1hr) September 21: Onshape account and tutorial.<br />
*(0.5hrs) September 21: edited and rehearsed class presentation.<br />
'''Chanel''' <br /><br />
*(2hrs) September 20: Found libraries to reference when writing Arduino code for lighting up with music input, downloaded and created account for using Arduino on personal device<br />
<br />
=== September 23 to September 29 ===<br />
'''Jordan''' <br /><br />
*(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
Night Light Circuit:<br />
[[File:night light circ.JPEG|thumb|Night Light Circuit]]<br />
Night Light Working:<br />
[[File:night light wokring.JPEG|thumb|Night Light Working]]<br />
Circuit to Perfboard Diagram:<br />
[[File:circ to perf diagram.JPEG|thumb|Circuit to perfboad diagram]]<br />
Perfboard Diagram Key:<br />
[[File:perf board key.JPEG|thumb|Perfboard Diagram Key]]<br />
Circuit laid out on Perfboard:<br />
[[File:circ laid on perf.JPEG|thumb|Circuit laid out on perfboard]]<br />
Perfboard Completed:<br />
[[File:perf board complete.JPEG|thumb|Perfboard Completed]]<br />
*(3hrs) designing microphone circuitry, updating with pictures and diagrams before meeting.<br />
*Microphone Circuit 1:<br />
*[[File:Microphone Circuit Notes.pdf|thumb|Microphone Circuit Notes]]<br />
*[[File:Microphone Circuit Diagram 1.pdf|thumb|Microphone Circuit Diagram]]<br />
*(0.75hrs) Uploaded files to demonstrate progress and reformated various items in the log and project page.<br />
<br />
'''Nish''' <br /><br />
*(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
*(6hr/360min): played around with the LED hardware and mangled the strips. Found FastLED library which has pre-coded fft's in it. Made a template for the code that SHOULD be able to interface with the arduino and all the jazz when we get the hardware up and that should be good. By template I mean 240 lines that should work and if not I'll leave debugging to future me and future chanel for later. <br />
'''Chanel''' <br /><br />
*(2.5hr): September 26 Learning Arduino syntax and interfacing code with the hardware (via YouTube)<br />
'''Next Week''' <br /><br />
*Need to actually construct a circuit with an Arduino and make LED Strip dance. So far has only been individual LEDs.<br />
*Need to decide on what parts we need to order for circuit: analog to digital converter, amplifier, etc...; Update theoretical design.<br />
*Uncertain about current design due to minimal prior experience <br />
*Decide on FFT code and understand the principles to be able to explain it to someone unfamiliar with Fourier Transform.<br />
*Draw general design of project demonstrating how we intend to incorporate hardware into table.<br />
<br />
=== September 30 to October 6 ===<br />
'''Jordan''' <br /><br />
*(1hr) September 30: Went over theoretical design of microphone circuit and assessed its validity.<br />
*(1hr) October 2: Examined and played around with arduino microphone that came in.<br />
*(1hr) October 2: Investigated what came builtin with the arduino microphone to determined what, if any, additional circuitry parts were needed.<br />
*(2hr) October 4: Worked on CADing the night light case. <br />
*(1hr) October 5: Fabricated proper cords for connecting arduino microphone to arduino. Checked CAD with TA.<br />
<br />
'''Chanel''' <br /><br />
*(1hr) October 5: Discussed microphone circuitry with TA and Jordan<br />
*(1hr) October 5: Researched serial plotting of microphone input & learned about how to use visualization tools in Arduino for sound <br />
'''Goals for Next 2 Week''' <br /><br />
*Make entire strip of LEDs light up and play around with individual color changes <br />
*Have arduino pick up microphone inputs<br />
*Graph multiple arrays of dummy data using C and arduino<br />
*Finalize everything with respect to design and budget<br />
=== October 7 to October 13 ===<br />
'''Jordan''' <br /><br />
*(1hr) October 9: Researched code in order to register microphone inputs<br />
*(3hr) October 10: Interfaced current microphone with arduino. Learned how to set up arduino to microphone. Learned how to write and updated code that the arduino can process. Learned how to use a potentiometer to adjust threshold detection. Learned how to monitor output prints in Serial Monitor. Concluded that the microphone works, is adjustable, and can register sound above threshold. However, it is only a yes no (0 1) signal. No amplitude or frequency is registered. Thus, we need a different mic as I don't believe a converter for this issue exists nor would be simpler than getting a digital or analog microphone that captures fluctuation in voltage amplitude/frequency.<br />
*(0.5hr) October 10: 3D print for night light finished up. Will be putting finishing touches to case soon to complete preliminary project. Found new microphone.<br />
<br />
'''Nish''' <br /><br />
*(7hr) October 13th: found and bought arduino mic. Played with hardware and made the arduino, mic, led circuit. Confirmed that code works. Got LEDs flashing in non random color patterns to music input. Only got it to do so for 3 minutes before the strip bugged out. Confirmed it was a problem with the data uptake from a wire on the strip and will either need to fix the strip or buy a new one. Moral of the story is big steps were taken and now all we need to do is get the LED strip to function and to put all this in a table. <br />
<br />
'''Goals for Next Week''' <br /><br />
*Get proper microphone, get it and the arduino to register and capture sound amplitudes or frequencies. (COMPLETED TIME TO FORMULATE NEW GOALS) <br />
*https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all<br />
*Reasonably priced pack of 5 that can arrive between October 16 and 19.<br />
=== October 14 to October 20 (Fall Break) ===<br />
'''Jordan''' <br /><br />
*(0.5hr) October 14: New microphones inbound<br />
*(1hr) October 18/19: Finalizing night light case<br />
<br />
'''Nish''' <br /><br />
*(2hr/ 120min) October 14: continued trying to fix the LED strip so data from the arduino can go through<br />
*(2hr/ 120min) October 15: soldered new wires from data input onto the led strips and kept tinkering (got 50% of the leds to work on the strip so it's confirmed it's just a data transfer issue and not an arduino/code/mic issue)<br />
<br />
eBOX Project Page:<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
[[Category:Logs]]<br />
[[Category:Fall 2018 Logs]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log&diff=13671EBOX Log2018-10-16T15:56:11Z<p>NishChakra: /* October 7 to October 13 */</p>
<hr />
<div>===eBOX Project Page===<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
=== August 26 to September 1===<br />
'''Team''' <br /> <br />
*(1hr) Discussed the very basic idea of the project at the first class August 31.<br />
<br />
=== September 2 to September 8 ===<br />
'''Jordan''' <br /><br />
*(0.5hr) September 6: Learned the basics of using Wiki. Created the Project Page and Log.<br />
'''Team''' <br /><br />
*(1hr) September 7: Team meeting to discuss the project further in depth and to ensure all the team members truly understood the project. Additionally, read up on the night light project to prepare for class, and checked swipe access to the lab, Urbauer 015.<br />
=== September 9 to September 15 ===<br />
'''Team''' <br /><br />
*(1hr) September 11: Extra weekly meeting in the lab. Will look into Arduino vs Raspberry Pi, feasibility of Fast Fourier Transforms (FFT) @40kHz on each, and current literature similar to eBOX (WUSTL Move to the Groove: https://sites.wustl.edu/ese498vertigodancefloor/). Additionally, completed the breadboard for the night light and stored it for safe keeping in the locker.<br />
*(0.5hr) September 14: Traditional weekly meeting in the lab. Told to update log and project page to include better format and information (reference links/research). Getting an Arduino from Tony and by next Friday will attempt to make LED blink from Arduino and import an appropriate LED library for practice. <br />
'''Jordan''' <br /><br />
*(0.25hr) September 12: Added to and reformatted the log to be headed by dates.<br />
*(0.25hr) September 12: Read up on Ardunios and Raspberry Pis and their feasibility of FFT @40KHz with an analog to digital converter as well as WUSTL Move to the Groove. <br />
'''Nish''' <br /><br />
*(0.33hr/20min) September 13: Researched Arduino and Pi to compare and decide which would be better to use for project implementation. Leaning towards Arduino.<br />
<br />
*(0.5hr/30min) September 14: Researched other implementations of music responsive LED's for inspiration and to reinforce learnings towards Arduino.<br />
<br />
=== September 16 to September 22 ===<br />
<br />
'''Team''' <br /><br />
*(0.5hrs) September 21: Rehearsed group presentation.<br />
'''Nish''' <br /><br />
*(1hr/60min) September 16: arduino prep course online (youtube)<br />
*(2hr/120min) September 18: Finished presentation powerpoint, made gant chart, researched additional cost of necessary materials (LED's, arduino microphone shield, tables ect...), assigned initial circuitry research to Jordan. Assigned gant chart and budget supplement wiki posting to chanel. <br />
*(1hr/60min) September 19: arduino prep course online (youtube)<br />
*(2hr/120min) September 22: Made arduino single led light blink, varied time patterns. Wrote code. Conducted research for table construction and LED integration into furniture pieces. Wrote code that needs to be tested for LED strips when strips come in the mail and circuitry is available. <br />
'''Jordan''' <br /><br />
*(2hrs) September 20: Researched the basics of Arduino, and c (structure, syntax, methods, etc...) (relevant links in Project References)<br />
*(1hr) September 21: Researched Arduino circuitry and code to make LEDs on Breadboard blink (relevant links in project references, basics of circuit in Project Electronics). Need to add transistors in series in order to be able to modulate light intensity (not currently picture in Project Electronics). <br />
Basic Circuit Arduino & LEDs:<br />
[[File:Common ground.jpeg|thumb|Common Ground]]<br />
<br />
Common Ground between Arduino and Breadboard.<br />
<br />
[[File:resistors to be in series with LEDS.jpeg|thumb|Resistors in series]]<br />
<br />
Resistors to be in series with LEDs.<br />
<br />
[[File:LED orientation.jpeg|thumb|LED Orientation (+/-)]]<br />
<br />
LED (+/-) Orientation.<br />
<br />
[[File:LEDs in Series with Resistors.jpeg|thumb|LEDs in series with resistors]]<br />
<br />
LEDs in series with resistors.<br />
<br />
[[File:Complete the circuit.jpeg|thumb|Completing the circuit from Breadboard back to Arduino]]<br />
<br />
Completing the circuit from Breadboard back to Arduino.<br />
<br />
*(1hr) September 21: Onshape account and tutorial.<br />
*(0.5hrs) September 21: edited and rehearsed class presentation.<br />
'''Chanel''' <br /><br />
*(2hrs) September 20: Found libraries to reference when writing Arduino code for lighting up with music input, downloaded and created account for using Arduino on personal device<br />
<br />
=== September 23 to September 29 ===<br />
'''Jordan''' <br /><br />
*(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
Night Light Circuit:<br />
[[File:night light circ.JPEG|thumb|Night Light Circuit]]<br />
Night Light Working:<br />
[[File:night light wokring.JPEG|thumb|Night Light Working]]<br />
Circuit to Perfboard Diagram:<br />
[[File:circ to perf diagram.JPEG|thumb|Circuit to perfboad diagram]]<br />
Perfboard Diagram Key:<br />
[[File:perf board key.JPEG|thumb|Perfboard Diagram Key]]<br />
Circuit laid out on Perfboard:<br />
[[File:circ laid on perf.JPEG|thumb|Circuit laid out on perfboard]]<br />
Perfboard Completed:<br />
[[File:perf board complete.JPEG|thumb|Perfboard Completed]]<br />
*(3hrs) designing microphone circuitry, updating with pictures and diagrams before meeting.<br />
*Microphone Circuit 1:<br />
*[[File:Microphone Circuit Notes.pdf|thumb|Microphone Circuit Notes]]<br />
*[[File:Microphone Circuit Diagram 1.pdf|thumb|Microphone Circuit Diagram]]<br />
*(0.75hrs) Uploaded files to demonstrate progress and reformated various items in the log and project page.<br />
<br />
'''Nish''' <br /><br />
*(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
*(6hr/360min): played around with the LED hardware and mangled the strips. Found FastLED library which has pre-coded fft's in it. Made a template for the code that SHOULD be able to interface with the arduino and all the jazz when we get the hardware up and that should be good. By template I mean 240 lines that should work and if not I'll leave debugging to future me and future chanel for later. <br />
'''Chanel''' <br /><br />
*(2.5hr): September 26 Learning Arduino syntax and interfacing code with the hardware (via YouTube)<br />
'''Next Week''' <br /><br />
*Need to actually construct a circuit with an Arduino and make LED Strip dance. So far has only been individual LEDs.<br />
*Need to decide on what parts we need to order for circuit: analog to digital converter, amplifier, etc...; Update theoretical design.<br />
*Uncertain about current design due to minimal prior experience <br />
*Decide on FFT code and understand the principles to be able to explain it to someone unfamiliar with Fourier Transform.<br />
*Draw general design of project demonstrating how we intend to incorporate hardware into table.<br />
<br />
=== September 30 to October 6 ===<br />
'''Jordan''' <br /><br />
*(1hr) September 30: Went over theoretical design of microphone circuit and assessed its validity.<br />
*(1hr) October 2: Examined and played around with arduino microphone that came in.<br />
*(1hr) October 2: Investigated what came builtin with the arduino microphone to determined what, if any, additional circuitry parts were needed.<br />
*(2hr) October 4: Worked on CADing the night light case. <br />
*(1hr) October 5: Fabricated proper cords for connecting arduino microphone to arduino. Checked CAD with TA.<br />
<br />
'''Chanel''' <br /><br />
*(1hr) October 5: Discussed microphone circuitry with TA and Jordan<br />
*(1hr) October 5: Researched serial plotting of microphone input & learned about how to use visualization tools in Arduino for sound <br />
'''Goals for Next 2 Week''' <br /><br />
*Make entire strip of LEDs light up and play around with individual color changes <br />
*Have arduino pick up microphone inputs<br />
*Graph multiple arrays of dummy data using C and arduino<br />
*Finalize everything with respect to design and budget<br />
=== October 7 to October 13 ===<br />
'''Jordan''' <br /><br />
*(1hr) October 9: Researched code in order to register microphone inputs<br />
*(3hr) October 10: Interfaced current microphone with arduino. Learned how to set up arduino to microphone. Learned how to write and updated code that the arduino can process. Learned how to use a potentiometer to adjust threshold detection. Learned how to monitor output prints in Serial Monitor. Concluded that the microphone works, is adjustable, and can register sound above threshold. However, it is only a yes no (0 1) signal. No amplitude or frequency is registered. Thus, we need a different mic as I don't believe a converter for this issue exists nor would be simpler than getting a digital or analog microphone that captures fluctuation in voltage amplitude/frequency.<br />
*(0.5hr) October 10: 3D print for night light finished up. Will be putting finishing touches to case soon to complete preliminary project. Found new microphone.<br />
<br />
'''Nish''' <br /><br />
*(7hr) October 13th: found and bought arduino mic. Played with hardware and made the arduino, mic, led circuit. Confirmed that code works. Got LEDs flashing in non random color patterns to music input. Only got it to do so for 3 minutes before the strip bugged out. Confirmed it was a problem with the data uptake from a wire on the strip and will either need to fix the strip or buy a new one. Moral of the story is big steps were taken and now all we need to do is get the LED strip to function and to put all this in a table. <br />
<br />
'''Goals for Next Week''' <br /><br />
*Get proper microphone, get it and the arduino to register and capture sound amplitudes or frequencies. (COMPLETED TIME TO FORMULATE NEW GOALS) <br />
*https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all<br />
*Reasonably priced pack of 5 that can arrive between October 16 and 19.<br />
<br />
eBOX Project Page:<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
[[Category:Logs]]<br />
[[Category:Fall 2018 Logs]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log&diff=13670EBOX Log2018-10-16T15:55:44Z<p>NishChakra: /* October 7 to October 13 */</p>
<hr />
<div>===eBOX Project Page===<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
=== August 26 to September 1===<br />
'''Team''' <br /> <br />
*(1hr) Discussed the very basic idea of the project at the first class August 31.<br />
<br />
=== September 2 to September 8 ===<br />
'''Jordan''' <br /><br />
*(0.5hr) September 6: Learned the basics of using Wiki. Created the Project Page and Log.<br />
'''Team''' <br /><br />
*(1hr) September 7: Team meeting to discuss the project further in depth and to ensure all the team members truly understood the project. Additionally, read up on the night light project to prepare for class, and checked swipe access to the lab, Urbauer 015.<br />
=== September 9 to September 15 ===<br />
'''Team''' <br /><br />
*(1hr) September 11: Extra weekly meeting in the lab. Will look into Arduino vs Raspberry Pi, feasibility of Fast Fourier Transforms (FFT) @40kHz on each, and current literature similar to eBOX (WUSTL Move to the Groove: https://sites.wustl.edu/ese498vertigodancefloor/). Additionally, completed the breadboard for the night light and stored it for safe keeping in the locker.<br />
*(0.5hr) September 14: Traditional weekly meeting in the lab. Told to update log and project page to include better format and information (reference links/research). Getting an Arduino from Tony and by next Friday will attempt to make LED blink from Arduino and import an appropriate LED library for practice. <br />
'''Jordan''' <br /><br />
*(0.25hr) September 12: Added to and reformatted the log to be headed by dates.<br />
*(0.25hr) September 12: Read up on Ardunios and Raspberry Pis and their feasibility of FFT @40KHz with an analog to digital converter as well as WUSTL Move to the Groove. <br />
'''Nish''' <br /><br />
*(0.33hr/20min) September 13: Researched Arduino and Pi to compare and decide which would be better to use for project implementation. Leaning towards Arduino.<br />
<br />
*(0.5hr/30min) September 14: Researched other implementations of music responsive LED's for inspiration and to reinforce learnings towards Arduino.<br />
<br />
=== September 16 to September 22 ===<br />
<br />
'''Team''' <br /><br />
*(0.5hrs) September 21: Rehearsed group presentation.<br />
'''Nish''' <br /><br />
*(1hr/60min) September 16: arduino prep course online (youtube)<br />
*(2hr/120min) September 18: Finished presentation powerpoint, made gant chart, researched additional cost of necessary materials (LED's, arduino microphone shield, tables ect...), assigned initial circuitry research to Jordan. Assigned gant chart and budget supplement wiki posting to chanel. <br />
*(1hr/60min) September 19: arduino prep course online (youtube)<br />
*(2hr/120min) September 22: Made arduino single led light blink, varied time patterns. Wrote code. Conducted research for table construction and LED integration into furniture pieces. Wrote code that needs to be tested for LED strips when strips come in the mail and circuitry is available. <br />
'''Jordan''' <br /><br />
*(2hrs) September 20: Researched the basics of Arduino, and c (structure, syntax, methods, etc...) (relevant links in Project References)<br />
*(1hr) September 21: Researched Arduino circuitry and code to make LEDs on Breadboard blink (relevant links in project references, basics of circuit in Project Electronics). Need to add transistors in series in order to be able to modulate light intensity (not currently picture in Project Electronics). <br />
Basic Circuit Arduino & LEDs:<br />
[[File:Common ground.jpeg|thumb|Common Ground]]<br />
<br />
Common Ground between Arduino and Breadboard.<br />
<br />
[[File:resistors to be in series with LEDS.jpeg|thumb|Resistors in series]]<br />
<br />
Resistors to be in series with LEDs.<br />
<br />
[[File:LED orientation.jpeg|thumb|LED Orientation (+/-)]]<br />
<br />
LED (+/-) Orientation.<br />
<br />
[[File:LEDs in Series with Resistors.jpeg|thumb|LEDs in series with resistors]]<br />
<br />
LEDs in series with resistors.<br />
<br />
[[File:Complete the circuit.jpeg|thumb|Completing the circuit from Breadboard back to Arduino]]<br />
<br />
Completing the circuit from Breadboard back to Arduino.<br />
<br />
*(1hr) September 21: Onshape account and tutorial.<br />
*(0.5hrs) September 21: edited and rehearsed class presentation.<br />
'''Chanel''' <br /><br />
*(2hrs) September 20: Found libraries to reference when writing Arduino code for lighting up with music input, downloaded and created account for using Arduino on personal device<br />
<br />
=== September 23 to September 29 ===<br />
'''Jordan''' <br /><br />
*(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
Night Light Circuit:<br />
[[File:night light circ.JPEG|thumb|Night Light Circuit]]<br />
Night Light Working:<br />
[[File:night light wokring.JPEG|thumb|Night Light Working]]<br />
Circuit to Perfboard Diagram:<br />
[[File:circ to perf diagram.JPEG|thumb|Circuit to perfboad diagram]]<br />
Perfboard Diagram Key:<br />
[[File:perf board key.JPEG|thumb|Perfboard Diagram Key]]<br />
Circuit laid out on Perfboard:<br />
[[File:circ laid on perf.JPEG|thumb|Circuit laid out on perfboard]]<br />
Perfboard Completed:<br />
[[File:perf board complete.JPEG|thumb|Perfboard Completed]]<br />
*(3hrs) designing microphone circuitry, updating with pictures and diagrams before meeting.<br />
*Microphone Circuit 1:<br />
*[[File:Microphone Circuit Notes.pdf|thumb|Microphone Circuit Notes]]<br />
*[[File:Microphone Circuit Diagram 1.pdf|thumb|Microphone Circuit Diagram]]<br />
*(0.75hrs) Uploaded files to demonstrate progress and reformated various items in the log and project page.<br />
<br />
'''Nish''' <br /><br />
*(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
*(6hr/360min): played around with the LED hardware and mangled the strips. Found FastLED library which has pre-coded fft's in it. Made a template for the code that SHOULD be able to interface with the arduino and all the jazz when we get the hardware up and that should be good. By template I mean 240 lines that should work and if not I'll leave debugging to future me and future chanel for later. <br />
'''Chanel''' <br /><br />
*(2.5hr): September 26 Learning Arduino syntax and interfacing code with the hardware (via YouTube)<br />
'''Next Week''' <br /><br />
*Need to actually construct a circuit with an Arduino and make LED Strip dance. So far has only been individual LEDs.<br />
*Need to decide on what parts we need to order for circuit: analog to digital converter, amplifier, etc...; Update theoretical design.<br />
*Uncertain about current design due to minimal prior experience <br />
*Decide on FFT code and understand the principles to be able to explain it to someone unfamiliar with Fourier Transform.<br />
*Draw general design of project demonstrating how we intend to incorporate hardware into table.<br />
<br />
=== September 30 to October 6 ===<br />
'''Jordan''' <br /><br />
*(1hr) September 30: Went over theoretical design of microphone circuit and assessed its validity.<br />
*(1hr) October 2: Examined and played around with arduino microphone that came in.<br />
*(1hr) October 2: Investigated what came builtin with the arduino microphone to determined what, if any, additional circuitry parts were needed.<br />
*(2hr) October 4: Worked on CADing the night light case. <br />
*(1hr) October 5: Fabricated proper cords for connecting arduino microphone to arduino. Checked CAD with TA.<br />
<br />
'''Chanel''' <br /><br />
*(1hr) October 5: Discussed microphone circuitry with TA and Jordan<br />
*(1hr) October 5: Researched serial plotting of microphone input & learned about how to use visualization tools in Arduino for sound <br />
'''Goals for Next 2 Week''' <br /><br />
*Make entire strip of LEDs light up and play around with individual color changes <br />
*Have arduino pick up microphone inputs<br />
*Graph multiple arrays of dummy data using C and arduino<br />
*Finalize everything with respect to design and budget<br />
=== October 7 to October 13 ===<br />
'''Jordan''' <br /><br />
*(1hr) October 9: Researched code in order to register microphone inputs<br />
*(3hr) October 10: Interfaced current microphone with arduino. Learned how to set up arduino to microphone. Learned how to write and updated code that the arduino can process. Learned how to use a potentiometer to adjust threshold detection. Learned how to monitor output prints in Serial Monitor. Concluded that the microphone works, is adjustable, and can register sound above threshold. However, it is only a yes no (0 1) signal. No amplitude or frequency is registered. Thus, we need a different mic as I don't believe a converter for this issue exists nor would be simpler than getting a digital or analog microphone that captures fluctuation in voltage amplitude/frequency.<br />
*(0.5hr) October 10: 3D print for night light finished up. Will be putting finishing touches to case soon to complete preliminary project. Found new microphone.<br />
<br />
'''Nish''' <br /><br />
*(7hr) October 13th: found and bought arduino mic. Played with hardware and made the arduino, mic, led circuit. Confirmed that code works. Got LEDs flashing in non random color patterns to music input. Only got it to do so for 3 minutes before the strip bugged out. Confirmed it was a problem with the data uptake from a wire on the strip and will either need to fix the strip or buy a new one. Moral of the story is big steps were taken and now all we need to do is get the LED strip to function and to put all this in a table. <br />
<br />
'''Goals for Next Week''' <br /><br />
*Get proper microphone, get it and the arduino to register and capture sound amplitudes or frequencies.<br />
*https://www.amazon.com/gp/offer-listing/B0792RL7W5/ref=dp_olp_0?ie=UTF8&condition=all<br />
*Reasonably priced pack of 5 that can arrive between October 16 and 19.<br />
(COMPLETED TIME TO FORMULATE NEW GOALS) <br />
eBOX Project Page:<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
[[Category:Logs]]<br />
[[Category:Fall 2018 Logs]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=13492EBOX2018-10-05T20:42:19Z<p>NishChakra: /* External Links */</p>
<hr />
<div>== Project Proposal ==<br />
=== Overview ===<br />
Tired of the monochromatic lighting of everyday life? Wish that your table would be a visual representation of how you feel Taylor Swift drops a new album and you conduct an impromptu dance party in the safety of your own home? Never fear EBOX is here! EBOX is your newest dorm friend. This coffee table with integrated music responsive LED lights is designed to make your life just a bit more achromatic and diversify your lighting options.<br />
<br />
=== Group Members ===<br />
*Jordan Gewirtz<br />
*Channel Lynn<br />
*Nish Chakraburtty<br />
*Tony Sancho-Spore (TA)<br />
*Dr. James Feher (Prof)<br />
<br />
===Link to Log===<br />
[[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Soldering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
*Staying under budget<br />
<br />
=== Gantt Chart ===<br />
<br />
<gallery><br />
Gant Chart.jpeg| Draft #1<br />
<br />
</gallery><br />
<br />
=== Budget ===<br />
{| class = "wikitable sortable" {{table}}<br />
| align="center" style="background:#f0f0f0;"|'''Item'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''# of Units: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Unit Price: Actual'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price Estimated'''<br />
| align="center" style="background:#f0f0f0;"|'''Total Price: Actual'''<br />
|-<br />
| Arduino||1|||| $1.20 |||| $1.20 ||<br />
|-<br />
| Transistors||10|||| $0.06 |||| $0.60 ||<br />
|-<br />
| LED (strips - 6ft)||1|||| $21.99 |||| $21.99 ||<br />
|-<br />
| Arduino Microphone||1|||| $8.88 |||| $8.88 ||<br />
|-<br />
| Table||1|||| $16.11 |||| $16.11 ||<br />
|-<br />
| Total||14|||||||| $48.78 ||<br />
|}<br />
<br />
== Design And Solutions ==<br />
<br />
=== The Housing ===<br />
<br />
<br />
=== The Electronics ===<br />
<br />
== Results ==<br />
<br />
<br />
<br />
=== Shortcomings ===<br />
<br />
<br />
<br />
=== Poster ===<br />
<br />
<br />
<br />
=== External Links ===<br />
Project Proposal Presentation Powerpoint link: <br />
https://docs.google.com/presentation/d/1mnPGURRNoGbIu7AR5VZs8qfj3P0mFTK5Hc8BOpOewkI/edit?usp=sharing<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
table link: https://www.amazon.com/Furinno-11250BE-WH-2-Tier-Turn-n-Tube/dp/B0083IZWPY/ref=sr_1_5?ie=UTF8&qid=1538772072&sr=8-5&keywords=table<br />
<br />
=== References ===<br />
*https://sites.wustl.edu/ese498vertigodancefloor/ <br />
*https://github.com/kosme/arduinoFFT<br />
*https://forum.arduino.cc/index.php?topic=427386.0<br />
*https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/<br />
*https://www.instructables.com/id/Arduino-Audio-Input/<br />
*https://www.instructables.com/id/Arduino-Frequency-Detection/<br />
*https://www.instructables.com/id/Arduino-Audio-Output/<br />
*https://www.arduino.cc/reference/en/<br />
*https://www.youtube.com/watch?v=e1FVSpkw6q4<br />
*http://genericnerd.blogspot.com/2009/05/arduino-mood-light-controller.html<br />
*https://www.youtube.com/watch?v=kj-oZgmRB2w&t=73s<br />
*https://www.youtube.com/watch?v=pMWnsHpDlQE&t=18s<br />
*https://www.youtube.com/watch?v=OasbgnLOuPI : HOW TO BUILD THE TABLE AND INTEGRATE THE LEDS<br />
*https://www.youtube.com/watch?v=5oRir4dck_w : ARDUINO LED LIGHTS WORK AND ARE SOUND RECEPTIVE (with opensource code)<br />
*https://www.youtube.com/watch?v=NQinj-tlU-M : LED coding walkthrough<br />
*https://www.instructables.com/id/Wire-a-Potentiometer-as-a-Variable-Resistor/<br />
*https://playground.arduino.cc/Code/Filters<br />
*https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10 microphone<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log&diff=13122EBOX Log2018-09-23T22:50:30Z<p>NishChakra: </p>
<hr />
<div>===eBOX Project Page===<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
=== August 26 to September 1===<br />
'''Team''' <br /> <br />
*(1hr) Discussed the very basic idea of the project at the first class August 31.<br />
<br />
=== September 2 to September 8 ===<br />
'''Jordan''' <br /><br />
*(0.5hr) September 6: Learned the basics of using Wiki. Created the Project Page and Log.<br />
'''Team''' <br /><br />
*(1hr) September 7: Team meeting to discuss the project further in depth and to ensure all the team members truly understood the project. Additionally, read up on the night light project to prepare for class, and checked swipe access to the lab, Urbauer 015.<br />
=== September 9 to September 15 ===<br />
'''Team''' <br /><br />
*(1hr) September 11: Extra weekly meeting in the lab. Will look into Arduino vs Raspberry Pi, feasibility of Fast Fourier Transforms (FFT) @40kHz on each, and current literature similar to eBOX (WUSTL Move to the Groove: https://sites.wustl.edu/ese498vertigodancefloor/). Additionally, completed the breadboard for the night light and stored it for safe keeping in the locker.<br />
*(0.5hr) September 14: Traditional weekly meeting in the lab. Told to update log and project page to include better format and information (reference links/research). Getting an Arduino from Tony and by next Friday will attempt to make LED blink from Arduino and import an appropriate LED library for practice. <br />
'''Jordan''' <br /><br />
*(0.25hr) September 12: Added to and reformatted the log to be headed by dates.<br />
*(0.25hr) September 12: Read up on Ardunios and Raspberry Pis and their feasibility of FFT @40KHz with an analog to digital converter as well as WUSTL Move to the Groove. <br />
'''Nish''' <br /><br />
*(0.33hr/20min) September 13: Researched Arduino and Pi to compare and decide which would be better to use for project implementation. Leaning towards Arduino.<br />
<br />
*(0.5hr/30min) September 14: Researched other implementations of music responsive LED's for inspiration and to reinforce learnings towards Arduino.<br />
<br />
=== September 16 to September 22 ===<br />
<br />
'''Team''' <br /><br />
*(0.5hrs) September 21: Rehearsed group presentation.<br />
'''Nish''' <br /><br />
*(1hr/60min) September 16: arduino prep course online (youtube)<br />
*(2hr/120min) September 18: Finished presentation powerpoint, made gant chart, researched additional cost of necessary materials (LED's, arduino microphone shield, tables ect...), assigned initial circuitry research to Jordan. Assigned gant chart and budget supplement wiki posting to chanel. <br />
*(1hr/60min) September 19: arduino prep course online (youtube)<br />
*(2hr/120min) September 22: Made arduino single led light blink, varied time patterns. Wrote code. Conducted research for table construction and LED integration into furniture pieces. Wrote code that needs to be tested for LED strips when strips come in the mail and circuitry is available. <br />
'''Jordan''' <br /><br />
*(2hrs) September 20: Researched the basics of Arduino, and c (structure, syntax, methods, etc...) (relevant links in Project References)<br />
*(1hr) September 21: Researched Arduino circuitry and code to make LEDs on Breadboard blink (relevant links in project references, basics of circuit in Project Electronics). Need to add transistors in series in order to be able to modulate light intensity (not currently picture in Project Electronics). <br />
*(1hr) September 21: Onshape account and tutorial.<br />
*(0.5hrs) September 21: edited and rehearsed class presentation.<br />
<br />
=== September 23 to September 29 ===<br />
'''Jordan''' <br /><br />
*(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
'''Nish''' <br /><br />
*(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
'''Next Week''' <br /><br />
*Need to actually construct a circuit with an Arduino and make LEDs dance. So far has all been theoretical, haven't had the proper cords. But confident that once we do, this should be very quick and easy.<br />
*Need to learn how to solder to finish up night light and then CAD its case.<br />
*Need to decide on what parts we need to order for circuit: analog to digital converter, amplifier, etc...; Sketch theoretical design<br />
eBOX Project Page:<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
[[Category:Logs]]<br />
[[Category:Fall 2018 Logs]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log&diff=13121EBOX Log2018-09-23T22:49:38Z<p>NishChakra: </p>
<hr />
<div>===eBOX Project Page===<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
=== August 26 to September 1===<br />
'''Team''' <br /> <br />
*(1hr) Discussed the very basic idea of the project at the first class August 31.<br />
<br />
=== September 2 to September 8 ===<br />
'''Jordan''' <br /><br />
*(0.5hr) September 6: Learned the basics of using Wiki. Created the Project Page and Log.<br />
'''Team''' <br /><br />
*(1hr) September 7: Team meeting to discuss the project further in depth and to ensure all the team members truly understood the project. Additionally, read up on the night light project to prepare for class, and checked swipe access to the lab, Urbauer 015.<br />
=== September 9 to September 15 ===<br />
'''Team''' <br /><br />
*(1hr) September 11: Extra weekly meeting in the lab. Will look into Arduino vs Raspberry Pi, feasibility of Fast Fourier Transforms (FFT) @40kHz on each, and current literature similar to eBOX (WUSTL Move to the Groove: https://sites.wustl.edu/ese498vertigodancefloor/). Additionally, completed the breadboard for the night light and stored it for safe keeping in the locker.<br />
*(0.5hr) September 14: Traditional weekly meeting in the lab. Told to update log and project page to include better format and information (reference links/research). Getting an Arduino from Tony and by next Friday will attempt to make LED blink from Arduino and import an appropriate LED library for practice. <br />
'''Jordan''' <br /><br />
*(0.25hr) September 12: Added to and reformatted the log to be headed by dates.<br />
*(0.25hr) September 12: Read up on Ardunios and Raspberry Pis and their feasibility of FFT @40KHz with an analog to digital converter as well as WUSTL Move to the Groove. <br />
'''Nish''' <br /><br />
*(0.33hr/20min) September 13: Researched Arduino and Pi to compare and decide which would be better to use for project implementation. Leaning towards Arduino.<br />
<br />
*(0.5hr/30min) September 14: Researched other implementations of music responsive LED's for inspiration and to reinforce learnings towards Arduino.<br />
<br />
=== September 16 to September 22 ===<br />
<br />
'''Team''' <br /><br />
*(0.5hrs) September 21: Rehearsed group presentation.<br />
'''Nish''' <br /><br />
*(1hr/60min) September 16: arduino prep course online (youtube)<br />
*(2hr/120min) September 18: Finished presentation powerpoint, made gant chart, researched additional cost of necessary materials (LED's, arduino microphone shield, tables ect...), assigned initial circuitry research to Jordan. Assigned gant chart and budget supplement wiki posting to chanel. <br />
*(1hr/60min) September 19: arduino prep course online (youtube)<br />
*(2hr/120min) September 22: Made arduino single led light blink, varied time patterns. Wrote code. Conducted research for table construction and LED integration into furniture pieces. Wrote code that needs to be tested for LED strips when strips come in the mail and circuitry is available. <br />
'''Jordan''' <br /><br />
*(2hrs) September 20: Researched the basics of Arduino, and c (structure, syntax, methods, etc...) (relevant links in Project References)<br />
*(1hr) September 21: Researched Arduino circuitry and code to make LEDs on Breadboard blink (relevant links in project references, basics of circuit in Project Electronics). Need to add transistors in series in order to be able to modulate light intensity (not currently picture in Project Electronics). <br />
*(1hr) September 21: Onshape account and tutorial.<br />
*(0.5hrs) September 21: edited and rehearsed class presentation.<br />
<br />
=== September 23 to September 29 ===<br />
'''Jordan''' <br /><br />
(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
'''Nish''' <br /><br />
(3hr/180min): soldering, perfboard diagrams, case rendering tutorials (night light is now attached to a perfboard)<br />
'''Next Week''' <br /><br />
*Need to actually construct a circuit with an Arduino and make LEDs dance. So far has all been theoretical, haven't had the proper cords. But confident that once we do, this should be very quick and easy.<br />
*Need to learn how to solder to finish up night light and then CAD its case.<br />
*Need to decide on what parts we need to order for circuit: analog to digital converter, amplifier, etc...; Sketch theoretical design<br />
eBOX Project Page:<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
[[Category:Logs]]<br />
[[Category:Fall 2018 Logs]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=12648EBOX2018-09-14T19:13:24Z<p>NishChakra: /* References */</p>
<hr />
<div>== Project Proposal ==<br />
=== Overview ===<br />
Tired of the monochromatic lighting of everyday life? Wish that your table would be a visual representation of how you feel Taylor Swift drops a new album and you conduct an impromptu dance party in the safety of your own home? Never fear EBOX is here! EBOX is your newest dorm friend. This coffee table with integrated music responsive LED lights is designed to make your life just a bit more achromatic and diversify your lighting options.<br />
<br />
=== Group Members ===<br />
*Jordan Gewirtz<br />
*Channel Lynn<br />
*Nish Chakraburtty<br />
*Tony Sancho-Spore (TA)<br />
*Dr. James Feher (Prof)<br />
<br />
===Link to Log===<br />
[[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Soldering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
*Staying under budget<br />
<br />
=== Gantt Chart ===<br />
<br />
<br />
=== Budget ===<br />
{| class="wikitable sortable"<br />
|-<br />
! Item !! # of Units: Estimated !! # of Units: Actual !! Unit Price: Estimated !! Unit Price: Actual !! Total Price: Estimated !! Total Price: Actual<br />
|-<br />
| Arduino || 1 || - || $1.20 || - || $1.20 || -<br />
|-<br />
| Transistors || 10 || - || - || - || - || -<br />
|-<br />
| LED (strips - 6ft) || - || - || - || - || - || -<br />
|-<br />
| LED (individual) || - || - || - || - || - || -<br />
|-<br />
| - || - || - || - || - || - || -<br />
|}<br />
<br />
== Design And Solutions ==<br />
<br />
=== The Housing ===<br />
<br />
<br />
=== The Electronics ===<br />
<br />
<br />
<br />
== Results ==<br />
<br />
<br />
<br />
=== Shortcomings ===<br />
<br />
<br />
<br />
=== Poster ===<br />
<br />
<br />
<br />
=== External Links ===<br />
<br />
=== References ===<br />
*https://sites.wustl.edu/ese498vertigodancefloor/ <br />
*https://github.com/kosme/arduinoFFT<br />
*https://forum.arduino.cc/index.php?topic=427386.0<br />
*https://www.norwegiancreations.com/2017/08/what-is-fft-and-how-can-you-implement-it-on-an-arduino/<br />
*https://www.instructables.com/id/Sound-Reactive-LED-strip/<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=12632EBOX2018-09-14T18:48:22Z<p>NishChakra: /* Project Proposal */</p>
<hr />
<div>== Project Proposal ==<br />
=== Overview ===<br />
Tired of the monochromatic lighting of everyday life? Wish that your table would be a visual representation of how you feel Taylor Swift drops a new album and you conduct an impromptu dance party in the safety of your own home? Never fear EBOX is here! EBOX is your newest dorm friend. This coffee table with integrated music responsive LED lights is designed to make your life just a bit more achromatic and diversify your lighting options.<br />
<br />
=== Group Members ===<br />
*Jordan Gewirtz<br />
*Channel Lynn<br />
*Nish Chakraburtty<br />
*Tony Sancho-Spore<br />
*Dr. James Feher<br />
<br />
===Link to Log===<br />
[[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Sautering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
<br />
=== Gantt Chart ===<br />
<br />
<br />
=== Budget ===<br />
<br />
== Design And Solutions ==<br />
<br />
=== The Housing ===<br />
<br />
<br />
=== The Electronics ===<br />
<br />
<br />
<br />
== Results ==<br />
<br />
<br />
<br />
=== Shortcomings ===<br />
<br />
<br />
<br />
=== Poster ===<br />
<br />
<br />
<br />
=== External Links ===<br />
<br />
=== References ===<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=12630EBOX2018-09-14T18:41:12Z<p>NishChakra: /* Project Overview */</p>
<hr />
<div>== Project Proposal ==<br />
=== Overview ===<br />
Tired of the monochromatic lighting of everyday life? Wish that your table would be a visual representation of how you feel Taylor Swift drops a new album and you conduct an impromptu dance party in the safety of your own home? Never fear EBOX is here! EBOX is your newest dorm friend. This coffee table with integrated music responsive LED lights is designed to make your life just a bit more achromatic and diversify your lighting options.<br />
<br />
=== Group Members ===<br />
*Jordan Gewirtz<br />
*Channel Lynn<br />
*Nish Chakraburtty<br />
===Link to Log===<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Sautering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
<br />
=== Gantt Chart ===<br />
<br />
<br />
=== Budget ===<br />
<br />
== Design And Solutions ==<br />
<br />
=== The Housing ===<br />
<br />
<br />
=== The Electronics ===<br />
<br />
<br />
<br />
== Results ==<br />
<br />
<br />
<br />
=== Shortcomings ===<br />
<br />
<br />
<br />
=== Poster ===<br />
<br />
<br />
<br />
=== External Links ===<br />
<br />
=== References ===<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=12629EBOX2018-09-14T18:39:24Z<p>NishChakra: /* Challenges */</p>
<hr />
<div>== Project Overview ==<br />
eBOX is an LED music box that will be able to take in music and output light patterns corresponding to the beats.<br />
=== Group Members ===<br />
*Jordan Gewirtz<br />
*Channel Lynn<br />
*Nish Chakraburtty<br />
===Link to Log===<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
=== Project Proposal ===<br />
Tired of the monochromatic lighting of everyday life? Wish that your table would be a visual representation of how you feel Taylor Swift drops a new album and you conduct an impromptu dance party in the safety of your own home? Never fear EBOX is here! EBOX is your newest dorm friend. This coffee table with integrated music responsive LED lights is designed to make your life just a bit more achromatic and diversify your lighting options.<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
<br />
=== Challenges ===<br />
*learn Arduino <br />
*Sautering<br />
*learn complex circuitry <br />
*carpentry <br />
*writing the code and interfacing the Arduino with the LEDs and Sound receptor<br />
*Learn to not short our entire project<br />
*Learn how to use transistors<br />
*Make sure nothing blows up<br />
<br />
=== Gantt Chart ===<br />
<br />
<br />
=== Budget ===<br />
<br />
<br />
<br />
== Design And Solutions ==<br />
<br />
=== The Housing ===<br />
<br />
<br />
=== The Electronics ===<br />
<br />
<br />
<br />
== Results ==<br />
<br />
<br />
<br />
=== Shortcomings ===<br />
<br />
<br />
<br />
=== Poster ===<br />
<br />
<br />
<br />
=== External Links ===<br />
<br />
=== References ===<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=12628EBOX2018-09-14T18:34:24Z<p>NishChakra: /* Objectives */</p>
<hr />
<div>== Project Overview ==<br />
eBOX is an LED music box that will be able to take in music and output light patterns corresponding to the beats.<br />
=== Group Members ===<br />
*Jordan Gewirtz<br />
*Channel Lynn<br />
*Nish Chakraburtty<br />
===Link to Log===<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
=== Project Proposal ===<br />
Tired of the monochromatic lighting of everyday life? Wish that your table would be a visual representation of how you feel Taylor Swift drops a new album and you conduct an impromptu dance party in the safety of your own home? Never fear EBOX is here! EBOX is your newest dorm friend. This coffee table with integrated music responsive LED lights is designed to make your life just a bit more achromatic and diversify your lighting options.<br />
<br />
=== Objectives ===<br />
*Use an Arduino to implement a Fast Fourier Transform(FFT)<br />
*Integrate the FFT through the Arduino with our LED lights<br />
*Make the LED lights respond music with a specific, non-random color scheme<br />
*Have the Light intensity change with the decibel level of the music<br />
<br />
=== Challenges ===<br />
<br />
<br />
<br />
=== Gantt Chart ===<br />
<br />
<br />
=== Budget ===<br />
<br />
<br />
<br />
== Design And Solutions ==<br />
<br />
=== The Housing ===<br />
<br />
<br />
=== The Electronics ===<br />
<br />
<br />
<br />
== Results ==<br />
<br />
<br />
<br />
=== Shortcomings ===<br />
<br />
<br />
<br />
=== Poster ===<br />
<br />
<br />
<br />
=== External Links ===<br />
<br />
=== References ===<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX&diff=12625EBOX2018-09-14T18:29:57Z<p>NishChakra: /* Project Proposal */</p>
<hr />
<div>== Project Overview ==<br />
eBOX is an LED music box that will be able to take in music and output light patterns corresponding to the beats.<br />
=== Group Members ===<br />
*Jordan Gewirtz<br />
*Channel Lynn<br />
*Nish Chakraburtty<br />
===Link to Log===<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
=== Project Proposal ===<br />
Tired of the monochromatic lighting of everyday life? Wish that your table would be a visual representation of how you feel Taylor Swift drops a new album and you conduct an impromptu dance party in the safety of your own home? Never fear EBOX is here! EBOX is your newest dorm friend. This coffee table with integrated music responsive LED lights is designed to make your life just a bit more achromatic and diversify your lighting options.<br />
<br />
=== Objectives ===<br />
<br />
<br />
<br />
=== Challenges ===<br />
<br />
<br />
<br />
=== Gantt Chart ===<br />
<br />
<br />
=== Budget ===<br />
<br />
<br />
<br />
== Design And Solutions ==<br />
<br />
=== The Housing ===<br />
<br />
<br />
=== The Electronics ===<br />
<br />
<br />
<br />
== Results ==<br />
<br />
<br />
<br />
=== Shortcomings ===<br />
<br />
<br />
<br />
=== Poster ===<br />
<br />
<br />
<br />
=== External Links ===<br />
<br />
<br />
<br />
eBOX Log [[eBOX_Log|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log]]<br />
[[Category:Projects]]<br />
[[Category:Fall 2018 Projects]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX_Log&diff=12621EBOX Log2018-09-14T17:44:16Z<p>NishChakra: /* September 12 */</p>
<hr />
<div>===eBOX Project Page===<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
=== August 31 ===<br />
'''Team''' <br /> <br />
*(1hr) Discussed the very basic idea of the project at the first class.<br />
<br />
=== September 6 ===<br />
'''Jordan''' <br /><br />
*(0.5hr) Learned the basics of using Wiki. Created the Project Page and Log.<br />
=== September 7 ===<br />
'''Team''' <br /><br />
*(1hr) Team meeting to discuss the project further in depth and to ensure all the team members truly understood the project. Additionally, read up on the night light project to prepare for class, and checked swipe access to the lab, Urbauer 015.<br />
=== September 11 ===<br />
'''Team''' <br /><br />
*(1hr) Extra weekly meeting in the lab. Will look into Arduino vs Raspberry Pi, feasibility of Fast Fourier Transforms (FFT) @40kHz on each, and current literature similar to eBOX (WUSTL Move to the Groove: https://sites.wustl.edu/ese498vertigodancefloor/). Additionally, completed the breadboard for the night light and stored it for safe keeping in the locker.<br />
<br />
=== September 12 ===<br />
'''Jordan''' <br /><br />
*(0.25hr) Added to and reformatted the log to be headed by dates.<br />
*(0.25hr) Read up on Ardunios and Raspberry Pis and their feasibility of FFT @40KHz with an analog to digital converter as well as WUSTL Move to the Groove. <br />
<br />
=== September 13 ===<br />
'''Nish''' <br /><br />
*(0.33hr/20min) Researched Arduino and Pi to compare and decide which would be better to use for project implementation. Leaning towards Arduino.<br />
<br />
=== September 14 ===<br />
'''Nish''' <br /><br />
*(0.5hr/30min) Researched other implementations of music responsive LED's for inspiration and to reinforce learnings towards Arduino.<br />
<br />
eBOX Project Page:<br />
[[eBOX|https://classes.engineering.wustl.edu/ese205/core/index.php?title=EBOX#Link_to_Log]]<br />
[[Category:Logs]]<br />
[[Category:Fall 2018 Logs]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Swim_Sheets_Log&diff=6633Swim Sheets Log2017-10-18T03:12:31Z<p>NishChakra: </p>
<hr />
<div>Weekly log for Swim Sheets project<br /><br />
<br />
Hailey Jenkins, Rebecca Bruce, Nish Chakraburtty<br /><br />
<br />
Here is a link to the project's main page: https://classes.engineering.wustl.edu/ese205/core/index.php?title=Swim_Sheets#Overview<br />
<br />
==Week of September 1-September==<br />
<br />
This week, we formed our group and decided on our project. We came up with the idea of creating an app that will allow timers at swim meets to input the time into, in order to streamline the process of timing for competitions.<br />
<br />
==Week of September 8-September 15==<br />
<br /><br />
We met with our TA Amelia to discuss our project ideas and finalize our project proposal. <br />
<br />
We worked on our initial project proposal and developed our gantt chart to prepare for the semester. We considered the steps of creating an iPhone app and discussed the possible ways to approach the project. <br />
<br />
We worked on research for the project goals. Hailey researched how to create a database and found bluehost as a possible webpage host for our database. This has a cost of $3.95 that would need to be budgeted for. Bluehost would allow us to link our database to the app that we will code because it is a mySQL database.<br />
<br />
Nish and Rebecca worked on the layout for the app. They developed 5 different screens. The first one consists of a welcome input for the date, meet, and timekeeper's name. The second page consists of the event, heat, lane and if the person at the block matches the name that appears on the screen. Based on if the name is correct, the screen will either go to a place to enter the time or a screen to enter the correct name. The 5th page is for the recap of the information and gives the user the ability to move to the next race or exit the meet.<br />
<br />
==Week of September 15-September 22==<br />
<br /><br />
This week we focused on more research for our project. In order to be ready to start developing the database and begin coding for the app within the next week.<br />
<br />
Hailey researched about creating a database and started an account with BlueHost, which is a mySQL database. She went through the PHP tutorials and used youtube videos to better understand how to create a database that can hold a table and have data imported. She spent about 5 hours working this week.<br />
<br />
Rebecca downloaded Xcode 9 and Swift 4 and began the program called swift tour. Swift is a programming language that is supported by apple and used for iOS, MacOS, watchOS, and tvOS app development. It uses similar language to C and objective C. She spent about an hour this week doing research.<br />
<br />
Nish also downloaded Xcode an began learning how to operate C in order to be able to program the app. He spent about two hours this week researching Xcode.<br />
<br />
==Week of September 22-September 29==<br />
<br /><br />
This week, Hailey looked into pre-existing apps such as meet mobile and meet manager as a possible way to connect our data and for a method of inserting our information; however, the price to work with meet manager is above our price range for the project. She also worked on setting up the database by creating a table to insert data into under Bluehost. She did this by going to myPHP and setting up a table that includes Swimmer's First Name, Swimmer's Last Name, Meet Name, Team Name, Event Number, Heat Number, Lane Number, and time. She also generated an ERD that is posted on the project page as a pdf that gives an overview of how the database flows. Overall, she has spent 4 hours working this week.<br />
<br />
Rebecca spent 3 hours setting up her Xcode and creating a test app interface. She ran into a problem with making her apple ID comparable with the apple developer website; this problem will need to be resolved before beginning coding for the app. All code that she completed is currently stored on her laptop.<br />
<br />
Nish spent about 30 minutes working with simple print statements and algorithms in swift this week.<br />
<br />
==Week of September 29-October 6==<br />
<br />
Hailey did more research in meet mobile; however, the site that meet mobile is run under, active.com, has protective measures that prohibit us from viewing the coding they used as a means to help in our project. She worked on getting a service.php up and running this week. Some complications arose as the coding she used was making the service.php page say "error establishing connection". In order to resolve this, she will be calling the database hosting site, bluehost,to get advice on how to work around this problem. Overall, she spent about 3 hours working this week.<br />
<br />
Rebecca and Nish worked on putting the powerpoint presentation together for our group project presentation this Friday, October 6th. Here is the link to our powerpoint presentation. [[File:Swim_sheet_.pdf]]<br />
<br />
Rebecca began research on how to use drop down boxes on swift, which was difficult as drop down menu is a web control term. To get around this problem, she used UIPickerViewDataSource and UIPickerViewDelegate. She is going to start working on the code this weekend and will hopefully have a functional drop box by next Friday. She put in 4 to 5 hours of work.<br />
<br />
Nish worked through swift tutorials for an hour this week. <br />
<br />
<br />
<br />
==Week of October 6-October 13==<br />
Hailey met with Professor Feher on October 11 to work on developing a new structure for the database tables. The new format that will be used will have a table for the meet, a table for the swimmer, a table for the roster, and a table for results. This meeting lasted about 1 hour. She also generated an ERD to follow the new format for the database; this has been uploaded to the main project page. It took about an hour to generate this. She did about an hour research on how to code in SQL formats in order to better understand how to write the commands that the app will need.<br />
<br />
This week Rebecca uploaded a copy of the new story bored (To be used by the app) and worked on creating a functioning "MainStoryBoard" on Xcode. Rebecca has called the new Xcode protect "SwimSheet:1" The first page of the layout is in place and she is learning how to I"mplementing Multiple View Controllers".<br />
Coding and research 2 hours (10/13/17) <br />
<br />
This week Nish learned PHP. He downloaded xampp and notepad ++ in order to run preliminary tests. He began coding a rough input webpage that will allow someone to upload a .csv file (from excel) into the database. Reseach and coding: 4 hours (10/9/17, 10/10/17, 10/12/17, 10/13/17)<br />
[[File:PageLayOut.JPG|thumb|Layout for swift app]]<br />
<br />
<br />
==Week of October 13-October 20==<br />
Rebecca completed the draft layout of the app pages with button transitions that she had started working on yesterday. The [https://www.huffingtonpost.com/dulio-denis/ios-quick-read-implementi_4_b_6923788.html iOS article ] was very helpful with explaining how to make a new View Controller class for each page. After testing the transitions the next step is now to change the button on page 5 (change name page) into a ''textfield'' that will then store the input and send it back to the database with a note of the change. In order to display the dater from the database on the app (pages 2, 3,4) we will use "WebKit View". This Kit displays embedded web content and allows for web navigation. Rebecca needs to talk to Nish and Hailey about the communication between the app and the web database. In the mean time she will learn more about the kit. <br />
(2.5 hours code - 10/14/2017)<br />
<br />
Hailey spent two hours researching the SQL terms required to be able to import, select, and insert data into the various data tables that are shown in the ERD posted on the main wiki page. She read through descriptions on this website: http://beginner-sql-tutorial.com/sql-select-statement.htm and began experimenting with coding between the tables in the myphp page. She spent 2.5 hours talking bluehost representatives, first over chat and then on a phone call in order to get the website domain up and running. After working through the issues involved, she switched the domain design to weebly from wordpress because weebly is better suited for custom databases. The website, swimsheets.com, now pulls up without displaying a forbidden 403 error. (10/14) On 10/17, she spent an hour and a half doing the SQL coding to connect the different data tables together according to the setup of the ERD. She used the inner join command for SQL to do this.<br />
<br />
<br />
(10/16/17) Nish spent one-hour coding a file input for .csv files in php and getting that code to return a .txt file with necessary input data parsed and organized. Currently the code only uploads the file. Troubleshooting the second feature of the code begins tomorrow. <br />
(10/17/17) Nish spent one hour troubleshooting a pathway error. Could not resolve issue. Bringing up error tomorrow at the meeting with Fehrer. <br />
[[File:SwimSheets layout.png|thumb|left|1st draft working transitions with buttons ]]<br />
<br />
[[Category:Logs]]<br />
[[Category:Fall 2017 Logs]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Swim_Sheets_Log&diff=6620Swim Sheets Log2017-10-17T01:19:38Z<p>NishChakra: </p>
<hr />
<div>Weekly log for Swim Sheets project<br /><br />
<br />
Hailey Jenkins, Rebecca Bruce, Nish Chakraburtty<br /><br />
<br />
Here is a link to the project's main page: https://classes.engineering.wustl.edu/ese205/core/index.php?title=Swim_Sheets#Overview<br />
<br />
==Week of September 1-September==<br />
<br />
This week, we formed our group and decided on our project. We came up with the idea of creating an app that will allow timers at swim meets to input the time into, in order to streamline the process of timing for competitions.<br />
<br />
==Week of September 8-September 15==<br />
<br /><br />
We met with our TA Amelia to discuss our project ideas and finalize our project proposal. <br />
<br />
We worked on our initial project proposal and developed our gantt chart to prepare for the semester. We considered the steps of creating an iPhone app and discussed the possible ways to approach the project. <br />
<br />
We worked on research for the project goals. Hailey researched how to create a database and found bluehost as a possible webpage host for our database. This has a cost of $3.95 that would need to be budgeted for. Bluehost would allow us to link our database to the app that we will code because it is a mySQL database.<br />
<br />
Nish and Rebecca worked on the layout for the app. They developed 5 different screens. The first one consists of a welcome input for the date, meet, and timekeeper's name. The second page consists of the event, heat, lane and if the person at the block matches the name that appears on the screen. Based on if the name is correct, the screen will either go to a place to enter the time or a screen to enter the correct name. The 5th page is for the recap of the information and gives the user the ability to move to the next race or exit the meet.<br />
<br />
==Week of September 15-September 22==<br />
<br /><br />
This week we focused on more research for our project. In order to be ready to start developing the database and begin coding for the app within the next week.<br />
<br />
Hailey researched about creating a database and started an account with BlueHost, which is a mySQL database. She went through the PHP tutorials and used youtube videos to better understand how to create a database that can hold a table and have data imported. She spent about 5 hours working this week.<br />
<br />
Rebecca downloaded Xcode 9 and Swift 4 and began the program called swift tour. Swift is a programming language that is supported by apple and used for iOS, MacOS, watchOS, and tvOS app development. It uses similar language to C and objective C. She spent about an hour this week doing research.<br />
<br />
Nish also downloaded Xcode an began learning how to operate C in order to be able to program the app. He spent about two hours this week researching Xcode.<br />
<br />
==Week of September 22-September 29==<br />
<br /><br />
This week, Hailey looked into pre-existing apps such as meet mobile and meet manager as a possible way to connect our data and for a method of inserting our information; however, the price to work with meet manager is above our price range for the project. She also worked on setting up the database by creating a table to insert data into under Bluehost. She did this by going to myPHP and setting up a table that includes Swimmer's First Name, Swimmer's Last Name, Meet Name, Team Name, Event Number, Heat Number, Lane Number, and time. She also generated an ERD that is posted on the project page as a pdf that gives an overview of how the database flows. Overall, she has spent 4 hours working this week.<br />
<br />
Rebecca spent 3 hours setting up her Xcode and creating a test app interface. She ran into a problem with making her apple ID comparable with the apple developer website; this problem will need to be resolved before beginning coding for the app. All code that she completed is currently stored on her laptop.<br />
<br />
Nish spent about 30 minutes working with simple print statements and algorithms in swift this week.<br />
<br />
==Week of September 29-October 6==<br />
<br />
Hailey did more research in meet mobile; however, the site that meet mobile is run under, active.com, has protective measures that prohibit us from viewing the coding they used as a means to help in our project. She worked on getting a service.php up and running this week. Some complications arose as the coding she used was making the service.php page say "error establishing connection". In order to resolve this, she will be calling the database hosting site, bluehost,to get advice on how to work around this problem. Overall, she spent about 3 hours working this week.<br />
<br />
Rebecca and Nish worked on putting the powerpoint presentation together for our group project presentation this Friday, October 6th. Here is the link to our powerpoint presentation. [[File:Swim_sheet_.pdf]]<br />
<br />
Rebecca began research on how to use drop down boxes on swift, which was difficult as drop down menu is a web control term. To get around this problem, she used UIPickerViewDataSource and UIPickerViewDelegate. She is going to start working on the code this weekend and will hopefully have a functional drop box by next Friday. She put in 4 to 5 hours of work.<br />
<br />
Nish worked through swift tutorials for an hour this week. <br />
<br />
<br />
<br />
==Week of October 6-October 13==<br />
Hailey met with Professor Feher on October 11 to work on developing a new structure for the database tables. The new format that will be used will have a table for the meet, a table for the swimmer, a table for the roster, and a table for results. This meeting lasted about 1 hour. She also generated an ERD to follow the new format for the database; this has been uploaded to the main project page. It took about an hour to generate this. She did about an hour research on how to code in SQL formats in order to better understand how to write the commands that the app will need.<br />
<br />
This week Rebecca uploaded a copy of the new story bored (To be used by the app) and worked on creating a functioning "MainStoryBoard" on Xcode. Rebecca has called the new Xcode protect "SwimSheet:1" The first page of the layout is in place and she is learning how to I"mplementing Multiple View Controllers".<br />
Coding and research 2 hours (10/13/17) <br />
<br />
This week Nish learned PHP. He downloaded xampp and notepad ++ in order to run preliminary tests. He began coding a rough input webpage that will allow someone to upload a .csv file (from excel) into the database. Reseach and coding: 4 hours (10/9/17, 10/10/17, 10/12/17, 10/13/17)<br />
[[File:PageLayOut.JPG|thumb|Layout for swift app]]<br />
<br />
<br />
==Week of October 13-October 20==<br />
Rebecca completed the draft layout of the app pages with button transitions that she had started working on yesterday. The [https://www.huffingtonpost.com/dulio-denis/ios-quick-read-implementi_4_b_6923788.html iOS article ] was very helpful with explaining how to make a new View Controller class for each page. After testing the transitions the next step is now to change the button on page 5 (change name page) into a ''textfield'' that will then store the input and send it back to the database with a note of the change. In order to display the dater from the database on the app (pages 2, 3,4) we will use "WebKit View". This Kit displays embedded web content and allows for web navigation. Rebecca needs to talk to Nish and Hailey about the communication between the app and the web database. In the mean time she will learn more about the kit. <br />
(2.5 hours code - 10/14/2017)<br />
<br />
Hailey spent two hours researching the SQL terms required to be able to import, select, and insert data into the various data tables that are shown in the ERD posted on the main wiki page. She read through descriptions on this website: http://beginner-sql-tutorial.com/sql-select-statement.htm and began experimenting with coding between the tables in the myphp page. She spent 2.5 hours talking bluehost representatives, first over chat and then on a phone call in order to get the website domain up and running. After working through the issues involved, she switched the domain design to weebly from wordpress because weebly is better suited for custom databases. The website, swimsheets.com, now pulls up without displaying a forbidden 403 error.<br />
<br />
<br />
(10/16/17) Nish spent one-hour coding a file input for .csv files in php and getting that code to return a .txt file with necessary input data parsed and organized. Currently the code only uploads the file. Troubleshooting the second feature of the code begins tomorrow. <br />
[[File:SwimSheets layout.png|thumb|left|1st draft working transitions with buttons ]]<br />
<br />
[[Category:Logs]]<br />
[[Category:Fall 2017 Logs]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Swim_Sheets_Log&diff=6619Swim Sheets Log2017-10-17T01:19:19Z<p>NishChakra: </p>
<hr />
<div>Weekly log for Swim Sheets project<br /><br />
<br />
Hailey Jenkins, Rebecca Bruce, Nish Chakraburt<br /><br />
<br />
Here is a link to the project's main page: https://classes.engineering.wustl.edu/ese205/core/index.php?title=Swim_Sheets#Overview<br />
<br />
==Week of September 1-September==<br />
<br />
This week, we formed our group and decided on our project. We came up with the idea of creating an app that will allow timers at swim meets to input the time into, in order to streamline the process of timing for competitions.<br />
<br />
==Week of September 8-September 15==<br />
<br /><br />
We met with our TA Amelia to discuss our project ideas and finalize our project proposal. <br />
<br />
We worked on our initial project proposal and developed our gantt chart to prepare for the semester. We considered the steps of creating an iPhone app and discussed the possible ways to approach the project. <br />
<br />
We worked on research for the project goals. Hailey researched how to create a database and found bluehost as a possible webpage host for our database. This has a cost of $3.95 that would need to be budgeted for. Bluehost would allow us to link our database to the app that we will code because it is a mySQL database.<br />
<br />
Nish and Rebecca worked on the layout for the app. They developed 5 different screens. The first one consists of a welcome input for the date, meet, and timekeeper's name. The second page consists of the event, heat, lane and if the person at the block matches the name that appears on the screen. Based on if the name is correct, the screen will either go to a place to enter the time or a screen to enter the correct name. The 5th page is for the recap of the information and gives the user the ability to move to the next race or exit the meet.<br />
<br />
==Week of September 15-September 22==<br />
<br /><br />
This week we focused on more research for our project. In order to be ready to start developing the database and begin coding for the app within the next week.<br />
<br />
Hailey researched about creating a database and started an account with BlueHost, which is a mySQL database. She went through the PHP tutorials and used youtube videos to better understand how to create a database that can hold a table and have data imported. She spent about 5 hours working this week.<br />
<br />
Rebecca downloaded Xcode 9 and Swift 4 and began the program called swift tour. Swift is a programming language that is supported by apple and used for iOS, MacOS, watchOS, and tvOS app development. It uses similar language to C and objective C. She spent about an hour this week doing research.<br />
<br />
Nish also downloaded Xcode an began learning how to operate C in order to be able to program the app. He spent about two hours this week researching Xcode.<br />
<br />
==Week of September 22-September 29==<br />
<br /><br />
This week, Hailey looked into pre-existing apps such as meet mobile and meet manager as a possible way to connect our data and for a method of inserting our information; however, the price to work with meet manager is above our price range for the project. She also worked on setting up the database by creating a table to insert data into under Bluehost. She did this by going to myPHP and setting up a table that includes Swimmer's First Name, Swimmer's Last Name, Meet Name, Team Name, Event Number, Heat Number, Lane Number, and time. She also generated an ERD that is posted on the project page as a pdf that gives an overview of how the database flows. Overall, she has spent 4 hours working this week.<br />
<br />
Rebecca spent 3 hours setting up her Xcode and creating a test app interface. She ran into a problem with making her apple ID comparable with the apple developer website; this problem will need to be resolved before beginning coding for the app. All code that she completed is currently stored on her laptop.<br />
<br />
Nish spent about 30 minutes working with simple print statements and algorithms in swift this week.<br />
<br />
==Week of September 29-October 6==<br />
<br />
Hailey did more research in meet mobile; however, the site that meet mobile is run under, active.com, has protective measures that prohibit us from viewing the coding they used as a means to help in our project. She worked on getting a service.php up and running this week. Some complications arose as the coding she used was making the service.php page say "error establishing connection". In order to resolve this, she will be calling the database hosting site, bluehost,to get advice on how to work around this problem. Overall, she spent about 3 hours working this week.<br />
<br />
Rebecca and Nish worked on putting the powerpoint presentation together for our group project presentation this Friday, October 6th. Here is the link to our powerpoint presentation. [[File:Swim_sheet_.pdf]]<br />
<br />
Rebecca began research on how to use drop down boxes on swift, which was difficult as drop down menu is a web control term. To get around this problem, she used UIPickerViewDataSource and UIPickerViewDelegate. She is going to start working on the code this weekend and will hopefully have a functional drop box by next Friday. She put in 4 to 5 hours of work.<br />
<br />
Nish worked through swift tutorials for an hour this week. <br />
<br />
<br />
<br />
==Week of October 6-October 13==<br />
Hailey met with Professor Feher on October 11 to work on developing a new structure for the database tables. The new format that will be used will have a table for the meet, a table for the swimmer, a table for the roster, and a table for results. This meeting lasted about 1 hour. She also generated an ERD to follow the new format for the database; this has been uploaded to the main project page. It took about an hour to generate this. She did about an hour research on how to code in SQL formats in order to better understand how to write the commands that the app will need.<br />
<br />
This week Rebecca uploaded a copy of the new story bored (To be used by the app) and worked on creating a functioning "MainStoryBoard" on Xcode. Rebecca has called the new Xcode protect "SwimSheet:1" The first page of the layout is in place and she is learning how to I"mplementing Multiple View Controllers".<br />
Coding and research 2 hours (10/13/17) <br />
<br />
This week Nish learned PHP. He downloaded xampp and notepad ++ in order to run preliminary tests. He began coding a rough input webpage that will allow someone to upload a .csv file (from excel) into the database. Reseach and coding: 4 hours (10/9/17, 10/10/17, 10/12/17, 10/13/17)<br />
[[File:PageLayOut.JPG|thumb|Layout for swift app]]<br />
<br />
<br />
==Week of October 13-October 20==<br />
Rebecca completed the draft layout of the app pages with button transitions that she had started working on yesterday. The [https://www.huffingtonpost.com/dulio-denis/ios-quick-read-implementi_4_b_6923788.html iOS article ] was very helpful with explaining how to make a new View Controller class for each page. After testing the transitions the next step is now to change the button on page 5 (change name page) into a ''textfield'' that will then store the input and send it back to the database with a note of the change. In order to display the dater from the database on the app (pages 2, 3,4) we will use "WebKit View". This Kit displays embedded web content and allows for web navigation. Rebecca needs to talk to Nish and Hailey about the communication between the app and the web database. In the mean time she will learn more about the kit. <br />
(2.5 hours code - 10/14/2017)<br />
<br />
Hailey spent two hours researching the SQL terms required to be able to import, select, and insert data into the various data tables that are shown in the ERD posted on the main wiki page. She read through descriptions on this website: http://beginner-sql-tutorial.com/sql-select-statement.htm and began experimenting with coding between the tables in the myphp page. She spent 2.5 hours talking bluehost representatives, first over chat and then on a phone call in order to get the website domain up and running. After working through the issues involved, she switched the domain design to weebly from wordpress because weebly is better suited for custom databases. The website, swimsheets.com, now pulls up without displaying a forbidden 403 error.<br />
<br />
<br />
(10/16/17) Nish spent one-hour coding a file input for .csv files in php and getting that code to return a .txt file with necessary input data parsed and organized. Currently the code only uploads the file. Troubleshooting the second feature of the code begins tomorrow. <br />
[[File:SwimSheets layout.png|thumb|left|1st draft working transitions with buttons ]]<br />
<br />
[[Category:Logs]]<br />
[[Category:Fall 2017 Logs]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Swim_Sheets_Log&diff=6617Swim Sheets Log2017-10-15T17:08:56Z<p>NishChakra: </p>
<hr />
<div>Weekly log for Swim Sheets project<br /><br />
<br />
Hailey Jenkins, Rebecca Bruce, Nish Chakraburt<br /><br />
<br />
Here is a link to the project's main page: https://classes.engineering.wustl.edu/ese205/core/index.php?title=Swim_Sheets#Overview<br />
<br />
==Week of September 1-September==<br />
<br />
This week, we formed our group and decided on our project. We came up with the idea of creating an app that will allow timers at swim meets to input the time into, in order to streamline the process of timing for competitions.<br />
<br />
==Week of September 8-September 15==<br />
<br /><br />
We met with our TA Amelia to discuss our project ideas and finalize our project proposal. <br />
<br />
We worked on our initial project proposal and developed our gantt chart to prepare for the semester. We considered the steps of creating an iPhone app and discussed the possible ways to approach the project. <br />
<br />
We worked on research for the project goals. Hailey researched how to create a database and found bluehost as a possible webpage host for our database. This has a cost of $3.95 that would need to be budgeted for. Bluehost would allow us to link our database to the app that we will code because it is a mySQL database.<br />
<br />
Nish and Rebecca worked on the layout for the app. They developed 5 different screens. The first one consists of a welcome input for the date, meet, and timekeeper's name. The second page consists of the event, heat, lane and if the person at the block matches the name that appears on the screen. Based on if the name is correct, the screen will either go to a place to enter the time or a screen to enter the correct name. The 5th page is for the recap of the information and gives the user the ability to move to the next race or exit the meet.<br />
<br />
==Week of September 15-September 22==<br />
<br /><br />
This week we focused on more research for our project. In order to be ready to start developing the database and begin coding for the app within the next week.<br />
<br />
Hailey researched about creating a database and started an account with BlueHost, which is a mySQL database. She went through the PHP tutorials and used youtube videos to better understand how to create a database that can hold a table and have data imported. She spent about 5 hours working this week.<br />
<br />
Rebecca downloaded Xcode 9 and Swift 4 and began the program called swift tour. Swift is a programming language that is supported by apple and used for iOS, MacOS, watchOS, and tvOS app development. It uses similar language to C and objective C. She spent about an hour this week doing research.<br />
<br />
Nish also downloaded Xcode an began learning how to operate C in order to be able to program the app. He spent about two hours this week researching Xcode.<br />
<br />
==Week of September 22-September 29==<br />
<br /><br />
This week, Hailey looked into pre-existing apps such as meet mobile and meet manager as a possible way to connect our data and for a method of inserting our information; however, the price to work with meet manager is above our price range for the project. She also worked on setting up the database by creating a table to insert data into under Bluehost. She did this by going to myPHP and setting up a table that includes Swimmer's First Name, Swimmer's Last Name, Meet Name, Team Name, Event Number, Heat Number, Lane Number, and time. She also generated an ERD that is posted on the project page as a pdf that gives an overview of how the database flows. Overall, she has spent 4 hours working this week.<br />
<br />
Rebecca spent 3 hours setting up her Xcode and creating a test app interface. She ran into a problem with making her apple ID comparable with the apple developer website; this problem will need to be resolved before beginning coding for the app. All code that she completed is currently stored on her laptop.<br />
<br />
Nish spent about 30 minutes working with simple print statements and algorithms in swift this week.<br />
<br />
==Week of September 29-October 6==<br />
<br />
Hailey did more research in meet mobile; however, the site that meet mobile is run under, active.com, has protective measures that prohibit us from viewing the coding they used as a means to help in our project. She worked on getting a service.php up and running this week. Some complications arose as the coding she used was making the service.php page say "error establishing connection". In order to resolve this, she will be calling the database hosting site, bluehost,to get advice on how to work around this problem. Overall, she spent about 3 hours working this week.<br />
<br />
Rebecca and Nish worked on putting the powerpoint presentation together for our group project presentation this Friday, October 6th. Here is the link to our powerpoint presentation. [[File:Swim_sheet_.pdf]]<br />
<br />
Rebecca began research on how to use drop down boxes on swift, which was difficult as drop down menu is a web control term. To get around this problem, she used UIPickerViewDataSource and UIPickerViewDelegate. She is going to start working on the code this weekend and will hopefully have a functional drop box by next Friday. She put in 4 to 5 hours of work.<br />
<br />
Nish worked through swift tutorials for an hour this week. <br />
<br />
<br />
<br />
==Week of October 6-October 13==<br />
Hailey met with Professor Feher on October 11 to work on developing a new structure for the database tables. The new format that will be used will have a table for the meet, a table for the swimmer, a table for the roster, and a table for results. This meeting lasted about 1 hour. She also generated an ERD to follow the new format for the database; this has been uploaded to the main project page. It took about an hour to generate this. She did about an hour research on how to code in SQL formats in order to better understand how to write the commands that the app will need.<br />
<br />
This week Rebecca uploaded a copy of the new story bored (To be used by the app) and worked on creating a functioning "MainStoryBoard" on Xcode. Rebecca has called the new Xcode protect "SwimSheet:1" The first page of the layout is in place and she is learning how to I"mplementing Multiple View Controllers".<br />
Coding and research 2 hours (10/13/17) <br />
<br />
This week Nish learned PHP. He downloaded xampp and notepad ++ in order to run preliminary tests. He began coding a rough input webpage that will allow someone to upload a .csv file (from excel) into the database. Reseach and coding: 4 hours (10/9/17, 10/10/17, 10/12/17, 10/13/17)<br />
[[File:PageLayOut.JPG|thumb|Layout for swift app]]<br />
<br />
<br />
==Week of October 13-October 20==<br />
Rebecca completed the draft layout of the app pages with button transitions that she had started working on yesterday. The [https://www.huffingtonpost.com/dulio-denis/ios-quick-read-implementi_4_b_6923788.html iOS article ] was very helpful with explaining how to make a new View Controller class for each page. After testing the transitions the next step is now to change the button on page 5 (change name page) into a ''textfield'' that will then store the input and send it back to the database with a note of the change. In order to display the dater from the database on the app (pages 2, 3,4) we will use "WebKit View". This Kit displays embedded web content and allows for web navigation. Rebecca needs to talk to Nish and Hailey about the communication between the app and the web database. In the mean time she will learn more about the kit. <br />
(2.5 hours code - 10/14/2017)<br />
<br />
Hailey spent two hours researching the SQL terms required to be able to import, select, and insert data into the various data tables that are shown in the ERD posted on the main wiki page. She read through descriptions on this website: http://beginner-sql-tutorial.com/sql-select-statement.htm and began experimenting with coding between the tables in the myphp page. She spent 2.5 hours talking bluehost representatives, first over chat and then on a phone call in order to get the website domain up and running. After working through the issues involved, she switched the domain design to weebly from wordpress because weebly is better suited for custom databases. The website, swimsheets.com, now pulls up without displaying a forbidden 403 error.<br />
<br />
[[File:SwimSheets layout.png|thumb|left|1st draft working transitions with buttons ]]<br />
<br />
[[Category:Logs]]<br />
[[Category:Fall 2017 Logs]]</div>NishChakrahttps://classes.engineering.wustl.edu/ese205/core/index.php?title=Swim_Sheets&diff=6421Swim Sheets2017-10-08T17:15:14Z<p>NishChakra: </p>
<hr />
<div>==Overview==<br />
A common problem at swim meets is the backup that occurs from timers having to record the times for each swim on paper. The times then have to be manually entered in case one of the touchpads in the water does not register the swimmers touch, resulting in a false time. The objective of our project is to create an IPhone app to assist with swim meets. We want timers at swim meets to be able to input the time they recorded for the swimmer, based on the event number, lane number, and heat number, into the app instead of writing it on paper. This will allow the times recorded to go directly into the database instead of having to be manually entered at the conclusion of each swim event.<br />
<br />
==Team Members==<br />
Hailey Jenkins<br /><br />
Rebecca Bruce<br /><br />
Nish Chakraburtty<br /><br />
TA: Amelia Delzell<br /><br />
<br />
==Objectives==<br />
We want the IPhone app’s interface to prompt the user for the event number, heat number, and lane number. The app should then return the swimmer’s name based off the psych sheet for the overall meet. The user can then double check the accuracy of the name and override it if necessary. Once the swim is complete, a time will be entered and stored in an excel spreadsheet that could then be inputted into a swim database at a later time.<br /><br />
<br />
<br />
The main goals of this app are to:<br /><br />
1. Create a database that takes in the psych sheet and can report the swimmers name.<br /><br />
<br />
2. Prompt the user for event number, heat number, and lane number<br /><br />
<br />
3. Display data in an organized manner for overall meet results and analysis.<br /><br />
<br />
4. The database should take in an input of data, consisting of rosters, events, heat, and lane. These should be imported into the database from a .txt file that can be used by various teams to import into the database.<br /><br />
<br />
5. Results will be generated and be viewable from the database for the coaches use. These results can also be exported into a spreadsheet for viewing.<br /><br />
<br />
6. The data for each race will be received from inputs from the app, not an external source.<br /><br />
<br />
==Challenges==<br />
Learn how to create a public IP address to update the times.<br /><br />
<br />
Learn how to create a database and PHP files. <br /><br />
<br />
Learn how to use Apple’s IDE to create the application.<br /><br />
<br />
Learn how to import the data from a document.<br /><br />
<br />
Learn how to use the iCloud server.<br /><br />
<br />
Learn how to override errors in the input process.<br /><br />
<br />
==Gantt Chart==<br />
<br />
[[ File:Gantt chart.pdf]]<br />
<br />
==Budget==<br />
<br />
Blue Host: $3.95 per month for 3 months<br />
<br />
==ERD==<br />
<br />
[[File:ERD.pdf]]<br />
<br />
[[Category:Projects]]<br />
[[Category:Fall 2017 Projects]]</div>NishChakra