Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Arnov Sharma
Published © LGPL

DIY Handheld Fan

Made a DC Handheld Fan from scratch using 3D Printed parts and a custom PCB. An Attiny13A powers the whole setup.

BeginnerFull instructions provided1 hour640

Things used in this project

Hardware components

DC motor (generic)
×1
Microchip attiny13
×1
Arduino Nano R3
Arduino Nano R3
×1

Software apps and online services

Fusion
Autodesk Fusion
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

Mid Body

NET

TOP Motor Mount

Schematics

sch

Code

code

C/C++
const int switchPin = 4; 
const int FANPin = 0;
int FANMode = 1; 

void setup() 
{
    pinMode(FANPin, OUTPUT);
    pinMode(switchPin, INPUT_PULLUP);
    digitalWrite(FANPin, LOW);
     
}
void loop()
{ 
    if (digitalRead(switchPin) ==LOW) 
    { 
        FANMode = FANMode + 1;
        if (FANMode == 4)
        {
            FANMode = 1;
        }
    }
    if (FANMode == 1)
    {
        digitalWrite(FANPin, LOW);
        delay(200);
    }
    else if (FANMode == 2)
    {
        digitalWrite(FANPin, HIGH);
        delay(200);
    }
    else if (FANMode == 3)
    {
        analogWrite(FANPin, 50);
        delay(200);        
    }
    //delay(200); // see text
}

Credits

Arnov Sharma
321 projects • 327 followers
Just your average MAKER
Contact

Comments

Please log in or sign up to comment.