You are on page 1of 12

technology workshop craft home food play outside costumes

Sound Activated Fan


by hfholden on April 26, 2016

Table of Contents

Sound Activated Fan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: Sound Activated Fan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: Choose equipment. A fan, arduino, and sound sensor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: Find a code to do a Simple LED light up test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 3: Add a relay switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Step 4: Test voice serial.print- edit code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Step 5: Set up hardware to the fan. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Step 6: Secure arduino, relay and power supply. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Step 7: Talk like a robot, have fun!••. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

http://www.instructables.com/id/Sound-Activated-Fan/
Intro: Sound Activated Fan
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

http://www.instructables.com/id/Sound-Activated-Fan/
http://www.instructables.com/id/Sound-Activated-Fan/
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.

http://www.instructables.com/id/Sound-Activated-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).

http://www.instructables.com/id/Sound-Activated-Fan/
Image Notes
http://www.instructables.com/id/Sound-Activated-Fan/
1. The relay is pin 6 and GND. digital pin 2 still has a jumper but is not needed.

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.

http://www.instructables.com/id/Sound-Activated-Fan/
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.

http://www.instructables.com/id/Sound-Activated-Fan/
http://www.instructables.com/id/Sound-Activated-Fan/
http://www.instructables.com/id/Sound-Activated-Fan/
Image Notes
1. These holes allow room for the cords to fit through. Now, the stand is flat and
sturdy.

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!••

http://www.instructables.com/id/Sound-Activated-Fan/
Related Instructables

How To: Add


Sound To An Active Sound
Add Sound to Intel® Edison Sound activated High-End Sound
Animation by Mixer by raikut
Projects. by Hands-on Day light up shirt by with 7 Inch
5: Voice Radiu§ Touchscreen
cquestinnov Effix9000
Activated Bulb Control Based
by gckulo on Raspberry Pi
and Max2Play
by Max2Play

Advertisements

Comments
2 comments Add Comment

wold630 says: Apr 27, 2016. 9:43 AM REPLY


Wow! Does it turn on and off constantly if people are having a conversation at a distance?

hfholden says: Apr 27, 2016. 11:41 AM REPLY


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.

http://www.instructables.com/id/Sound-Activated-Fan/

You might also like