Introduction: Arduino Repeat Cycle Timer

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$

http://www.canadarobotix.com/arduino-microcontroll...

1 Channel Relay: 5$

http://www.canadarobotix.com/mechanical-switches/1...

Project Box: 6$

http://www.walmart.ca/en/ip/lock-lock-800-ml-recta...

Re-purposed Xbox 360 cord: Free$

Cable Grip: 2.5$

http://www.digikey.ca/product-search/en/cables-wir...

Jumper wire kit: 13$

http://www.digikey.ca/product-detail/en/bud-indust...

Outlet: 1$

https://www.lowes.ca/building-supplies/electrical/...

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

https://www.google.ca/?ion=1&espv=2#q=minutes%20to...

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.

Comments

author
blanca2 made it! (author)2016-07-18

Great project. I really like the project box. For safety I might break the Black "HOT" cable through the relay instead of the White "Neutral"

author
fahking made it! (author)fahking2016-07-18

what difference would it make ?

author
jester928 made it! (author)jester9282016-09-10

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

author
devicemodder made it! (author)devicemodder2016-07-20

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.

author
fahking made it! (author)fahking2016-08-20

you will not die i'm a power engineer and i've been shocked enough times

author
KISELIN made it! (author)KISELIN2016-07-18

It would make a difference between "DEAD or ALIVE"!!!!!! If you brake the "neutral" the "HOT/black" is still alive, and if you are gounded to something & touch that lead/black = DEAD YOU ARE!!!!

author
djmeta4 made it! (author)2016-07-21

I think a 5v switched 120v solid state relay would be better for longevity and you could get a higher output capicity

author
KISELIN made it! (author)2016-07-19

But if you have taken a "doze" of say: 120VAC/60Hz @ 50mA, you wouldn''t be here among us writing your stupid messages, (there maybe a "heavenly" internet there through which you could communicate with us living people down here, please send me the "url to heaven", so I could communicate with THE GREAT MASTER OF UNIVERSUM himself) :) :)

author
KISELIN made it! (author)2016-07-19

1. You say "120V at 15A", 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)

2. It doesn't matter which side you "cut" your "load", the heat generated is allways the amount of power going thrue the wires. P=U*I => where P=power=Watt, U=Potential niveau difference=Volt, I=Current=Ampere. Wery often the the result of, (UxI), Power (W) results in "heat" (heaters), or in "motion" (motors)....etc.

author
curiosity36 made it! (author)2016-07-18

Re: "what difference does it make?"

In the USA, it's the convention and required the National Electrical Code.

It's doubtful these low cost relay modules meet any electrical standards.

The below info is from a medical source. Skin resistance does play a roll.

1 mA;
Barely perceptible

16 mA; Maximum current an average man can grasp and “let go”

20 mA Paralysis of respiratory muscles

100 mA; Ventricular fibrillation threshold

2 A; Cardiac standstill and internal organ damage

15/20 A; Common fuse breaker opens circuit

author
DylanD581 made it! (author)2016-07-17

This is an awesome Arduino timer.

author
DIY Hacks and How Tos made it! (author)2016-07-16

This would be a really cool way to make a simple automation system.