This is an arduino based repeating cycle timer. The times are set in the sketch and cannot be modified during operation.

It is durable, reliable, simple and cheaper than a comparable unit.

This relay is rated for 10 amps. The relay will melt if you exceed the maximum load. a space heater, water pump or large fan will draw more current and should be used carefully.

Step 1: Arduino Repeat Cycle Timer

The parts list:

Arduino: 26$


1 Channel Relay: 5$


Project Box: 6$


Re-purposed Xbox 360 cord: Free$

Cable Grip: 2.5$


Jumper wire kit: 13$


Outlet: 1$


I've used some risers for the relay and rigged my own risers for the Arduino from a Windex bottle straw and some nuts and bolts

Step 2: Install Into Box and Wire

i'd like to make a fancy wiring diagram with http://fritzing.org/home/ and add it here but....

The 12v wiring is

3.3v to VCC

Gnd to gnd

Pin 2 to IN

For the 120 v I've included a image of how I've wired the relay. you just run the common wire into the centre of the relay and then connect the N/C (normally closed) side of the terminal block to the outlet.

maybe ill update my Instructable with some diagrams in the future but for now this is what you get.

first I used a drill and file to create a hole for USB port and dc barrel jack to fit

second I marked the arduino's holes on the bottom of the project box for the risers to go into.

I've used a lighter and hair dry to soften the plastic when reaming or threading any holes to avoid the plastic cracking

I've also used a lighter the soften the risers into the plastic

I've also added a few air holes to allow heat to escape the box and used the cord grip to secure the power source the relay will get hot

I then used my dremel to cut the lid of the box to allow the 120v outlet fit.

Step 3: The Code

Here is the code

Change the offTime and onTime values to adjust the cycle times they are in milliseconds here's a link to a converter


I have plagiarized this code from other arduino projects and it works. the other project included multiple simultaneous functions and inputs this one does not.

I am aware of the the option to use delay instead of complex timer values and math.

<p>Great project. I really like the project box. For safety I might break the Black &quot;HOT&quot; cable through the relay instead of the White &quot;Neutral&quot; </p>
<p>what difference would it make ?</p>
For safety reasons and I would change the normally close to the normally open connection and change the program with the inverse times as well
<p>As someone who went to school to become an apprentice electrician, NEVER EVER switch a neutral. There is a good chance that if something goes wrong, YOU WILL DIE as the hot is still energized. </p>
<p>you will not die i'm a power engineer and i've been shocked enough times</p>
<p>It would make a difference between &quot;DEAD or ALIVE&quot;!!!!!! If you brake the &quot;neutral&quot; the &quot;HOT/black&quot; is still alive, and if you are gounded to something &amp; touch that lead/black = DEAD YOU ARE!!!!</p>
<p>I think a 5v switched 120v solid state relay would be better for longevity and you could get a higher output capicity </p>
<p>But if you have taken a &quot;doze&quot; of say: 120VAC/60Hz @ 50mA, you wouldn''t be here among us writing your stupid messages, (there maybe a &quot;heavenly&quot; internet there through which you could communicate with us living people down here, please send me the &quot;url to heaven&quot;, so I could communicate with THE GREAT MASTER OF UNIVERSUM himself) :) :)</p>
<p>1. You say &quot;120V at 15A&quot;, 15Amps = 15,000mA. They estimate that You can't hold 120ACV with a Amperege of a 10mA, (READ 10milliamps), without damage. So Your 15A could kill about ~1,000 people at one stroke, (20mA/person)</p><p>2. It doesn't matter which side you &quot;cut&quot; your &quot;load&quot;, the heat generated is allways the amount of power going thrue the wires. P=U*I =&gt; where P=power=Watt, U=Potential niveau difference=Volt, I=Current=Ampere. Wery often the the result of, (UxI), Power (W) results in &quot;heat&quot; (heaters), or in &quot;motion&quot; (motors)....etc.</p>
<p>Re: &quot;what difference does it make?&quot;</p><p>In the USA, it's the convention and required the National Electrical Code. </p><p>It's doubtful these low cost relay modules meet any electrical standards.</p><p>The below info is from a medical source. Skin resistance does play a roll. </p><p>1 mA;<br>Barely perceptible </p><p>16 mA; Maximum current an average man can grasp and &ldquo;let go&rdquo; </p><p>20 mA Paralysis of respiratory muscles </p><p>100 mA; Ventricular fibrillation threshold </p><p>2 A; Cardiac standstill and internal organ damage </p><p>15/20 A; Common fuse breaker opens circuit</p>
<p>This is an awesome Arduino timer.</p>
<p>This would be a really cool way to make a simple automation system.</p>

About This Instructable



More by fahking:Precision Arduino 120v Incubation Temperature Controller / Thermostat Arduino Repeat Cycle Timer 
Add instructable to: