Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
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 hour612

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
310 projects • 311 followers
Just your average MAKER

Comments