Shahariar
Published © CC BY-NC

Rainbow Mist Machine

Let's make some fog!

BeginnerFull instructions provided6 hours1,238

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
CoolMOS C7 Gold SJ MOSFET
Infineon CoolMOS C7 Gold SJ MOSFET
×1
CPU Casing Fan
×1
Back Box Single Gang
×1
RGB Diffused Common Cathode
RGB Diffused Common Cathode
×1
SparkFun 4N35 Optocoupler
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Resistor 100k ohm
Resistor 100k ohm
×1
Resistor 330 ohm
Resistor 330 ohm
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Lead Acid Battery 12V 7.5Ah
×1
Resistor 100 ohm
Resistor 100 ohm
×1
Kanthal Wire 0.8 Ohms 80 Watt Coil
×1
Cotton Ball
×1
Vegetable Glycerin
×1
Propylene glycol
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Schematics

rmm

v1

Code

RMM

C/C++
Ver final
const int redPin = 11;
const int greenPin = 10;
const int bluePin = 9;
const int coolmos_drive = 8;
unsigned long cooldown_timer =4;

void setup() 
{
  setColourRgb(0,0,0);
  pinMode(coolmos_drive,OUTPUT);
  
  
}

void loop() 
{
  while( (millis()/1000)<cooldown_timer)
  {
    coolMOS_On();
  unsigned int rgbColour[3];

  rgbColour[0] = 255;
  rgbColour[1] = 0;
  rgbColour[2] = 0;  

  for (int decColour = 0; decColour < 3; decColour += 1) {
    int incColour = decColour == 2 ? 0 : decColour + 1;

    for(int i = 0; i < 255; i += 1) {
      rgbColour[decColour] -= 1;
      rgbColour[incColour] += 1;
      
      setColourRgb(rgbColour[0], rgbColour[1], rgbColour[2]);
      delay(5);
    }
  }
  }
  
  cooldown_timer = (millis()/1000)+4;
  while( (millis()/1000)<cooldown_timer)
  {
    coolMOS_Off(); // let the coil cooldown
    // keep rgb glowing
  unsigned int rgbColour[3];

  rgbColour[0] = 255;
  rgbColour[1] = 0;
  rgbColour[2] = 0;  

  for (int decColour = 0; decColour < 3; decColour += 1) {
    int incColour = decColour == 2 ? 0 : decColour + 1;

    for(int i = 0; i < 255; i += 1) {
      rgbColour[decColour] -= 1;
      rgbColour[incColour] += 1;
      
      setColourRgb(rgbColour[0], rgbColour[1], rgbColour[2]);
      delay(5);
    }
  }
  }
  cooldown_timer = (millis()/1000)+4;

 
  
}

void setColourRgb(unsigned int red, unsigned int green, unsigned int blue) 
{
  analogWrite(redPin, red);
  analogWrite(greenPin, green);
  analogWrite(bluePin, blue);
}
void coolMOS_On (void)
{
  digitalWrite(coolmos_drive,HIGH);
}

void coolMOS_Off (void)
{
  digitalWrite(coolmos_drive,LOW);
}

Credits

Shahariar

Shahariar

74 projects • 265 followers
"What Kills a 'Great life' is a 'Good Life', which is Living a Life Inside While Loop"
Thanks to Jamesotron.

Comments