loading

Ever talk into a fan as a child because it made that cool robot sound? It is a universal memory for most people these days. I created a fan that's soul purpose is modulate your voice and bring you back to that childhood memory. So it's a fan that will only work when you speak into it. This instructable is made to document my journey of making this experimental contraption and to also guide anyone who would like to recreate a sound activated fan.

Step 1: Choose Equipment. a Fan, Arduino, and Sound Sensor.

A table or standing fan for a sound activated fan is optimal because the user must put their face close to the blades to speak into it. I chose a simple $12 table fan. It oscillates but it's not necessary, in fact, it's better if it doesn't, because it should stay still for the user.

Arduino UNO is the controller used. Price is around $25. You can purchase one through their website https://www.arduino.cc/en/main/arduinoBoardUno

The sound sensor is for arduino and I purchased mine through amazon prime, $10 for a pack of three. You only need one for this project technically but since they are so cheap it is smart to buy more than one an case anything happens to your sensor.

My relay switch was made in my class, made out of a relay and an extension chord soldered to the relay switch.

Equipment accessories to include are:

  • 3 jumpers (male and female parts)
  • 9v battery
  • a relay switch
  • velcro addhesive
  • electrical tape
  • a breadboard

Step 2: Find a Code to Do a Simple LED Light Up Test.

So when someone speaks into the fan just right, the fan should turn on so the user's voice keeps the fan on long enough to modulate their voice in a fun way. Choose a code that will take input from the sound sensor, run through the arduino, and turn the fan on.

To find my code I searched the internet for arduino projects that included a sound sensor. The one I found used a sensor and arduino to light up with music. http://www.princetronics.com/sound-sensitive-light...\

Arduino Pin Sound Sensor Pins

A0 AO

GND GND

5V VCC

Digital Pin 2 DO

int DO = 2; //Pin for Digital Output - DO
int DA = A0; // Pin for Analog Output - AO

int threshold =53 ; //Set minimum threshold for LED lit

nt sensorvalue = 0;

void setup() {

Serial.begin(9600);

pinMode(6, OUTPUT);

}

void loop() {

sensorvalue = analogRead(DA); //Read the analog value

Serial.print("Analog: ");

Serial.print(sensorvalue); //Print the analog value

Serial.print(" ");

Serial.print("Digital: ");

Serial.println(digitalRead(DO)); //Print the digital value

if (sensorvalue >= threshold) { //Compare analog value with threshold

digitalWrite(6, HIGH);

} else {

digitalWrite(6, LOW);

}

}

The serial port read that my sensor picked up sound at Analog: 50/51, so I declared threshold to be 53. When the sensor picks up a sound that read greater that 53, the LEDS light up.

It definitely works. After my LEDS lit up with the music, I began to figure out how to change lighting LEDS as my output to turning on a fan.

Step 3: Add a Relay Switch

This relay replaces DO/ digital pin 2 for the input and the other end of the rely is put into ground on the arduino. I choose digital pin 6 to connect my relay. My fan's power supply (the plug) is plugged into the relay and the relay is plugged into an outlet. Now the intput from Digital pin 6 will switch the relay on when sensor value reaches over 53 and switch the relay off when the sensor value reads below 53. This in turn turns my fan on and off depending on which way the rely is switched to. (The clicking sound you hear in the video is the relay switching on and off).

Step 4: Test Voice Serial.print- Edit Code

The big issue with the sensor, is that it's either too sensitive and picks up background that turns the fan on, or you have to scream into the sensor for the sensor value to pick up enough to reach the threshold. Also when the sensor is too sensitive it will pick up on it's own noise and run on itself. The ways to fix this is to reconstruct your code and adjust your potentiometer on the sensor. The potentiometer on the sensor is the very small screw on the blue box on the sensor. If you watch your serial.print, you will see which way to turn your screw for higher or lower sensitivity to sound the sensor will pick up. What worked for me was to delete threshold as a variable and just use a sensor value in my if statement (if sensor value is greater or equal to 908, turn fan on, else turn fan off). I also added a delay so that when the fan is turned on by a user the fan will run a quarter of a second on it's own. This keeps a good time for the fan to stay on for the user.

int DA = A0; // Pin for Analog Output - AO

int sensorvalue = 0;

void setup() {

Serial.begin(9600);

pinMode(6, OUTPUT);

}

void loop() {

sensorvalue = analogRead(DA); //Read the analog value

Serial.print("Analog: ");

Serial.print(sensorvalue); //Print the analog value

Serial.print(" ");

Serial.print("Digital: ");

Serial.println(digitalRead(DO)); //Print the digital value

if (sensorvalue >= 908 ) { //Compare analog value with sersorvalue

digitalWrite(6, HIGH);

delay(250); // Keeps the fan on for a quarter of a second after it is turned on.

} else {

digitalWrite(6, LOW);

}

}

Analog: is reading at 905 on average.

Step 5: Set Up Hardware to the Fan.

The user will face the front face of the fan when they speak into it. This requires the sensor to be in the front of the fan facing the user. The best place to put place my sensor was in the front middle plastic disc. For optimal performance the sensor must not be blocked by any plastic, so I drilled a hole for the sensor and it's potentiometer. Now sound is not obstructed at all and the sound of the blades is partially to the sensor and the potentiometer will not be moved or bumped unless the user decides for it to be adjusted.

The sensor is placed inside the front plastic and secured through the make-shift hole with electrical tape on the back.

Now that the sensor is in place, it's jumpers that connect to the arduino (that's placed at the bottom of the fan) are not long enough to reach it. So unless you use jumpers that are at least 10 inches or longer, you must do what I did, which was simply solder more wire to lengthen the jumpers.

Step 6: Secure Arduino, Relay and Power Supply.

The fan I used has a hollowed base that it sits on. I used this space to place my remaining hardware. I secured the back of the arduino and the bottom of the base with Velcro so I can take the controller off when needed. The relay was carefully tucked under the base as well next to the arduino and secured with electrical tape. The power supply, a 9V battery, is also secured with electrical tape close enough to the arduino so that it can be connected. I drilled 3 holes in the back of the base of the fan. One, for the jumpers to feed into the arduino. The second and third are to stick the relay chords through, this allows the base to be completely flat on a table, the chords won't make it wobble.

Step 7: Talk Like a Robot, Have Fun!

<p>2 output pins in parallel? maybe, but you can not short-circuit them together: if during the setup or a transition one pin is high and the other one low (even for few microseconds), your Arduino is gone... it may work with a couple of diodes, but then the transistor is cheaper and more efficient (diodes have a voltage drop of 0.7V, a saturated BC547 a Vce of just 0,18V)</p>
<p>Nice idea, just a comment: the relay you are using (as I can see from the picture a JQC-3F-5V) needs a current of about 65mA to be activated, while the max output current into/from any Arduino output pin is 40mA. I suggest to drive the relay through a transistor (i.e. BC547)</p>
Random thought, why not 2 pins for 80mA?
<p>masfiora I did not know about the max 40mA for the arduino. I have learned something new... Thanks John :)</p>
<p>Wow! Does it turn on and off constantly if people are having a conversation at a distance?</p>
<p>No not at a distance, unless they are screaming at each other, then it might pick up their sound. The optimal distance to speak into the fan is 6-7 inches from the front. </p>

About This Instructable

2,209views

40favorites

License:

More by hfholden:Sound Activated Fan  
Add instructable to: