You are on page 1of 9

Ferrofluid Display

Gagik Hakobyan
AEP 3630

Objective

Receive input from user

Touch

Tilt

Future: Sound

Activate corresponding magnets

Activate magnets manually turned on by button press

Increase field strength as tilt angle increases

Schematic

Materials & Cost


Materials

Cost

Arduino Leonardo

$21

1lb Magnet Wire

$20

Laser Jet Toner

$15

Breadboard

$7

NTD4963N Power MOSFET x6

$1.20

1N5822 Schottky Diode x6

$1.20

1F Capacitor

$0.20

Hot Rolled Steel Cores* x6

$0

100k Resistor x2

$0

268W Power Supply (Salvaged)

$0

*Donated by the physics supply shop

How it works

Phone generates sine wave signal

6 frequencies

Sends out signal through audio jack

Arduino picks up signal and determines amplitudes*

Discrete Fourier transform into 6 frequencies.

Turns on transistors through PWM

Magnets are inductors, averaging signal

Produces a cool buzz!

Schottky diodes prevent MOSFETS from being fried

*Not perfect, some frequencies leak into others

Lets see how it works!

Now for how it should work

Unfortunately, this requires


WAY more power

http://www.wondermagnet.com/images/ferro1.jpg

Some Android Code


private
private
private
private
private
private
private

final double duration = .1; //seconds


final int sampleRate = 48000;
final int numSamples = (int)(duration*(double)sampleRate);
final int numChannels = 6;
double samples[][] = new double[numChannels][numSamples];
int numActive = 0;
boolean enabled[] = new boolean[numChannels];

public AudioTrack track;


Timer timer;
private double preOut[] = new double[numSamples];
private byte output[] = new byte[numSamples*2];

@Override
protected void onResume() {
super.onResume();
//fill in samples[][]
for (int i=0; i<numChannels; i++) {
double alpha = 2*Math.PI/sampleRate;
if (i==0) alpha*=200;
else if (i==1) alpha*=300;
else if (i==2) alpha*=400;
else if (i==3) alpha*=600;
else if (i==4) alpha*=700;
else if (i==5) alpha*=1200;
for (int j=0; j<numSamples; j++) {
samples[i][j] = Math.cos(j*alpha)/numChannels;
}
}
for (int i=0; i<numSamples; i++) {
preOut[i]=0;
}

Arduino Code
#define PI 3.14159
int real[6][84];
int imag[6][84];
int input[84];
double retotal;
double imtotal;
double preOut[6];
byte output[6];
void setup() {
// Fill out the waveforms
for (int i=0; i<6; i++) {
double alpha = 2.0*PI;
if (i==0) alpha/=42.0;
if (i==1) alpha/=28.0;
if (i==2) alpha/=21.0;
if (i==3) alpha/=14.0;
if (i==4) alpha/=12.0;
if (i==5) alpha/=7.0;
for (int j=0; j<84; j++) {
real[i][j] = cos(alpha*j)*512;
imag[i][j] = sin(alpha*j)*512;
}
}
for (int i=0; i<84; i++) input[i]=0;
Serial.begin(9800);
}
void loop() {
// Read 84 values from the ADC
for (int i=0; i<84; i++) {
input[i]=analogRead(A0);
}

// Process these values


for (int i=0; i<6; i++) {
retotal=imtotal=0;
for (int j=0; j<84; j++) {
retotal+=1.0*real[i][j%84]*input[j];
imtotal+=1.0*imag[i][j%84]*input[j];
}
preOut[i]=sqrt(retotal*retotal+imtotal*imtotal);
}
output[0]=byte(preOut[0]/800001.0*255);
if (preOut[0]>800000) output[0]=255;
output[1]=byte(preOut[1]/750001.0*255);
if (preOut[1]>750000) output[1]=255;
output[2]=byte(preOut[2]/700001.0*255);
if (preOut[2]>700000) output[2]=255;
output[3]=byte(preOut[3]/650001.0*255);
if (preOut[3]>650000) output[3]=255;
output[4]=byte(preOut[4]/600001.0*255);
if (preOut[4]>600000) output[4]=255;
output[5]=byte(preOut[5]/300001.0*255);
if (preOut[5]>300000) output[5]=255;
analogWrite(3, output[0]);
analogWrite(5, output[1]);
analogWrite(6, output[2]);
analogWrite(9, output[3]);
analogWrite(10, output[4]);
analogWrite(11, output[5]);
for (int i=0; i<6; i++) {
Serial.print(output[i]);
Serial.print(" ");
}
Serial.println();
}

You might also like