Arduino Servo Fan Control

Before you try to dr this, I have included a video to combat the tl crowd. You’re quite welcome. See below.

Now I’ll explain. I may even toss in a snippet…who knows.

Basically, I found myself with a few free hours, an Arduino, a bunch of random components in my lab (read: garage) at my disposal, and no real plan of attack. Result? Arduino/servo motor controlled fan.

Jump off component…silver spray painted Altoids can. Nice…chop that sucker up so I can smash a servo motor in there.

minty
+1 minty

Well done. See…

works well
dang, son

Lady Ada uses these for some random projects. If you can stomach a whole bunch of crappy mints, you have a nice little Arduino-sized metal casing. Of course, it poses a grounding threat, which I experienced working with my motor shield a while back. That said…keep a few around. I have put this one to use before.

Next step…testing the servo

wires
wires for the win

For this, I broke out my motor shield. It doesn’t have any features that would benefit this project…the servo areas are basically just power, ground, and control. Control pumps into the 16B 10 port, like a jumper…that works for my debug.

Next, implement a fan.

big fan
I'm a big fan.

I snagged this fan from an old tower, I think. I really don’t know. It seemed to react well to a 9V battery, so I tried it with a 5V source…same deal. Awesome. I used a zip tie to fasten this to that, that being the Altoids enclosure.

This thing needs a base…man-clamp to the rescue:

secured
man-clamp

I picked this up, to use it as a soldering base. That ‘x-tra’ hands piece of shit that I have previously posted in pictures didn’t cut it. This is the manly version. And, it works great for this project, I believe…you can decide based upon the vid. Here is what it looks like, with some more detail.

fan
clamp in action

Let’s add some code…oh no…sounds like we’ve reached the BALLIN ASS SNIPPET ZONE

#include

Servo myservo; // servo opbect

int pos = 0; // initialize

void setup()
{
myservo.attach(10); // digi pin 10

void loop()
{
for(pos = 0; pos < 180; pos += 1) // from 1 to 180 { myservo.write(pos); // moves servo delay(20); // waits 20 ms } for(pos = 180; pos>=1; pos-=1) // sweeps span between 180 and 1
{
myservo.write(pos); // moves servo
delay(20); // waits 20 ms
}
}

If that looks familiar, it is because it pretty much the sweep example from the Arduino IDE. No changes necessary…I like when that happens.

Here is the final product:

fan
I'm a big fan of this little fan. Sorry.

Not bad, for a quick slam-together exercise. It isn’t really robotic, since it has no sensors. I could bump this up a notch with some IR LEDs, or my PIR sensor, but that is for another time.

Blah blah blah, stay tuned, blah blah. Until then.