Mini Fan

Mini Fan

tilt

Simple Arduino example to power fan every second.


Components

1 x mini fan
1 x Arduino Uno
1 x breadboard
alligator clips
jumper wires
 

Setup

  
Use alligator clips to connect:
    Blue to jumper wire to GND
    Red to jumper wire to pin 13
    Similar setup for vibrating motor


Arduino sketch

This is just the blink example.
Adapted from Adafruit example.
/*
  Blink
  Turns on an mini fan 
  on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// give it a name:
int fanPin = 13;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(fanPin, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(fanPin, HIGH);   // turn the fan on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(fanPin, LOW);    // turn the fan off by making the voltage LOW
  delay(1000);               // wait for a second
}