Canreef Aquatics Bulletin Board  

Go Back   Canreef Aquatics Bulletin Board > General > DIY

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 11-13-2010, 03:38 PM
plutoniumJoe's Avatar
plutoniumJoe plutoniumJoe is offline
Member
 
Join Date: Oct 2008
Location: Vancouver
Posts: 283
plutoniumJoe is on a distinguished road
Default Hooking it up to the Arduino

As I stated earlier this will also control my dosing system so it has more than you need for this project but....



To make it all work I used the Arduino Digital Blink Program.

/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.

This example code is in the public domain.
*/

void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}

void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}

According to this code the arduino will send a signal to the digital pin 13 to turn it on and off every 1000 milliseconds (1 sec) I modified it to every 15000 milliseconds for our purposes. You will need to connect one of the wires from your relay to the 5v spot on the arduino and the other to the digital pin denoted in your program. Every 15seconds the arduino will turn on the pin and complete the circuit which will activate the relay. When the relay is active the power will be given to the NO wire on the receptacle and when the pin is off (relay off) the power will be given to the NC wire giving you alternating pulses to your power heads.

I ended up getting a nice little 1" wave in my tank and my frogspawn moved to and fro. One of the koralia is loud so I need to look at that but oveall I am rather happy. Now on to the dosing side of it all.
__________________
210 Gallon slowly gaining population.

Foxface, Naso, Coral Beauty, 2 Clowns, 2 Chromis, Orange Anthias, and Striped Goby.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 05:43 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.