Victor AltamiranoEdOliver
Published © MIT

MOSMusic

Portable lighting station synchronized with music, with the Infineon CoolMOS C7 MOSFET.

AdvancedFull instructions provided5 hours3,265

Things used in this project

Hardware components

CoolMOS C7 Gold SJ MOSFET
Infineon CoolMOS C7 Gold SJ MOSFET
×1
MOC3021 (Optoisolator Triac Driver)
×4
2N6073AG
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
SparkFun Wire Wrap
×1
Wire Electric Gauge at least 18 AWG
×1
Capacitor 1 µF
Capacitor 1 µF
×4
Resistor 220 ohm
Resistor 220 ohm
×4
Resistor 100k ohm
Resistor 100k ohm
×4
Resistor 10k ohm
Resistor 10k ohm
×1
Resistor 330 ohm
Resistor 330 ohm
×1
Lightbulb socket
×4
Lightbulb
×4
Residential Polarized Plug
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
12 Volts Source (For Arduino)
×1
Sound Sensor
×1
Alligator Clips
Alligator Clips
×4
Copper Clad PCB
×1

Software apps and online services

Arduino IDE
Arduino IDE
Proteus Design Suite

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Ferric Chloride
Sharpie Pen.
Isopropyl Alcohol
Solder Wire

Story

Read more

Custom parts and enclosures

4 Module DXF

4 Module PDF

Single Module DXF

Single Module PDF

Schematics

Schematic Circuit

Code

Arduino Code

Arduino
Sensor reading and Light Bulbs output sequence
int analog1=0;
int analogm=0;
double basemean=0;
int base=0;
int gain=-5;
unsigned int sensibility=5;
int counter=0;

void setup() 
{
pinMode(LED_BUILTIN,OUTPUT);
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
digitalWrite(2,LOW);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
digitalWrite(5,LOW);
Serial.begin(115200);
for(int i=0;i<100;i++)
{
basemean+=analogRead(A0);
}
base=(basemean/100)+gain;
analogm=analogRead(A0);
digitalWrite(LED_BUILTIN,LOW);
}

void loop() 
{
  analog1=analogRead(A0);

    if(abs(analog1-analogm)<sensibility && counter>=10)
  {
    digitalWrite(2,LOW);
    digitalWrite(3,LOW);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
  }
   else if (abs(analog1-analogm)<sensibility && counter<10)
  {
    counter+=1;
  }
  else
  {
    counter=0;
    if(analog1>=(base-30) && analog1<(base-10))
  {
    digitalWrite(2,LOW);
    digitalWrite(3,LOW);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
  }
    else if(analog1>=(base-10) && analog1<(base))
  {
    digitalWrite(2,HIGH);
    digitalWrite(3,LOW);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
  }
    else if(analog1>=(base) && analog1<(base+10))
  {
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
  }
    else if(analog1>=(base+10) && analog1<(base+20))
  {
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,HIGH);
    digitalWrite(5,LOW);
  }
    else if(analog1>=(base+20) && analog1<(base+50))
  {
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,HIGH);
    digitalWrite(5,HIGH);
  }  
  }
  analogm=analog1;
  delay(50);
}

MOSMusic

Credits

Victor Altamirano

Victor Altamirano

8 projects • 18 followers
I am a Biomedical engineer who likes to develop hardware and software solutions.
EdOliver

EdOliver

11 projects • 11 followers
Engineer, Scientist, Maker.

Comments