Fan Project

Hello, I am interested in starting a new project using a normal house fan and programming an arduino circuit to turn the fan on for a specific amount of time and off for a specific amount of time plus it will be on a loop. For instance fan will be on for 2 min and off for 3 min then repeat. I am new to this and wanting to do this intro project with some students for an organization I volunteer for. I am guessing it would be a very simple program, just need info on materials and possibly troubleshooting with the software programming.

Thanks and would greatly appreciate any and all help.

using a normal house fan

I guess that means 110VAC, or 220VAC.
Your arduino can send a digital signal to a SSL (Solid State Relay), designed for AC.
Warning: when working with 110 or 220 Volts, it can be dangerous.

Warning: when working with 110 or 220 Volts, it can be dangerous.

Using a PowerTail, with all that stuff integrated is perfectly safe, though a bit more expensive.

What type of programming code would work best for the timing of the on and off for the fan? Any bit helps!!

What type of programming code would work best for the timing of the on and off for the fan? Any bit helps!!

The Arduino doesn't know what time it is, unless you tell it. The cheapest way to tell it is a RTC (real time clock). They are available for different prices. Don't get the cheapest, the DS1307. Spend a little more and get a more accurate clock.

A RTC may be good if you want it to be accurate for a long time, but the time library keeps pretty good time also.

#include <Time.h>

int nightLight = 7;
void setup() {                
  setTime(8,30,41,23,8,2013); // hour minute second day month year( 6:00 PM)

But if you just want it to repeat ever few minutes, you don't really need to know what time it is do you?
Look at the example program "blink without delay".

If you aren't doing it as a learning exercise, that seems like the sort of problem that could be solved by a 555 hardware timer. If you want to use an Arduino for the sake of it, this seems no more complex than the ubiquitous blinking LED and nothing said so far implies any need for a real time clock.

The easy way:

// untested code

const byte fanPin = 9;    // Replace this with the pin you actually use

void setup()
{
  pinMode(fanPin, OUTPUT);
}

void loop()
{
  digitalWrite(fanPin, HIGH);
  delay(120000UL);   // two minutes on
  digitalWrite(fanPin, LOW);
  delay(180000UL);  // Three minutes off
}

and nothing said so far implies any need for a real time clock.

Mea culpa. I misread the original post. I thought is said on and off at specific times, not for specific intervals.