The Planted Tank Forum - Reply to Topic
Planted Tank Forums
Your Tanks Image Hosting *Tank Tracker * Plant Profiles Fish Profiles Planted Tank Guide Photo Gallery Articles

Go Back   The Planted Tank Forum > Specific Aspects of a Planted Tank > DIY > Hunter X's Arduino Whole Tank Controller (52K Warning)

Thread: Hunter X's Arduino Whole Tank Controller (52K Warning) Reply to Thread
Title:
  
Message:
Post Icons
You may choose an icon for your message from the following list:
 

Register Now

In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in

Human Verification

In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.



Additional Options
Miscellaneous Options

Topic Review (Newest First)
11-10-2014 02:18 PM
PhysicsDude55
Quote:
Originally Posted by bigd603 View Post
The biggest I could find at RadioShack last night was 18. Think that's OK? I haven't opened it so I could still return it.
18 gauge is fine... Its perfectly safe to run 5 amps or so through 18 gauge. The biggest worry is to make sure that whatever wires have 120V mains voltage on them should be rated for 120V.
11-10-2014 10:11 AM
HunterX Hey bigD how are you doing? How are the boards working. Are you using the Atlas Ph chip. I noticed it in the picture of your boards. If so what version and how is it working for you. Mine runs great when I load only their code. When I add their code to my sketch it starts responding funny after it reports the PH 12 times. It reports more then 1 reading per line which makes it very hard to display the PH reading on the LCD.
11-08-2014 07:51 PM
salman I got 14ga at lowes. The sell by foot. I think it was around $0.30/ft


Sent from my iPhone using Tapatalk
11-08-2014 07:21 PM
bigd603 The biggest I could find at RadioShack last night was 18. Think that's OK? I haven't opened it so I could still return it.
11-08-2014 01:54 PM
theknight
Quote:
Originally Posted by bigd603 View Post
Hey guys, its been a while. What gauge wire do you recommend to connect between the terminal strips and the plugs?
14 gauge would be more than adequate and still easy to work with.
11-07-2014 04:51 PM
bigd603 Hey guys, its been a while. What gauge wire do you recommend to connect between the terminal strips and the plugs?
10-09-2014 09:31 PM
HunterX
Quote:
Originally Posted by bigd603 View Post
Check out what came in the mail today...





The AquaShield boards!

I think they look great! I tested the pump controls, and they all work flawlessly! Really stoked.
Bigd,

Do you have the atlas ph board? If so I have a few questions for you.
08-22-2014 04:41 PM
HunterX
Quote:
Originally Posted by AnotherHobby View Post
Yes, I just grabbed the line I had in my project.



You have to use Alarm.delay(n) no matter what in your loop (where n can be any number of millis). It's what calls the TimeAlarms library.

The timer library also has "Alarm.alarmOnce" instead of "Alarm.repeat". You could just kick that off when you start, with the Once timer set to kick off 5 seconds later. Go through the readme, it's pretty easy to use.
Yeah I just checked it out. I understand it now. I'm using a differnt RTC time library. Looks like I would have to change that too. Which means changing all the code for displaying the time on the LCD as well. I'll play with it this weekend.
08-22-2014 04:27 PM
AnotherHobby
Quote:
Originally Posted by mistergreen View Post
Alarm.delay(5) means to check up on all Alarms & timers every 5 milliseconds (the internal loop). You can do Alarm.delay(0) if you don't want any delay for the Alarms class.
Yes, I just grabbed the line I had in my project.

Quote:
Originally Posted by HunterX View Post
Would I really have to use the "Alrarm.delay(5)"? If I just turn it on and then turn it off 5 seconds later wouldn't that do the same thing? Which would be more effecient way of coding?
You have to use Alarm.delay(n) no matter what in your loop (where n can be any number of millis). It's what calls the TimeAlarms library.

The timer library also has "Alarm.alarmOnce" instead of "Alarm.repeat". You could just kick that off when you start, with the Once timer set to kick off 5 seconds later. Go through the readme, it's pretty easy to use.
08-22-2014 04:04 PM
mistergreen Alarm.delay(5) means to check up on all Alarms & timers every 5 milliseconds (the internal loop). You can do Alarm.delay(0) if you don't want any delay for the Alarms class.
08-22-2014 03:59 PM
HunterX
Quote:
Originally Posted by AnotherHobby View Post
Correct. In your main loop, you have to use "Alarm.delay(5);" at the end of the loop instead of a normal delay. That's how it keeps track. It should not skip any seconds.
Would I really have to use the "Alrarm.delay(5)"? If I just turn it on and then turn it off 5 seconds later wouldn't that do the same thing? Which would be more effecient way of coding?
08-22-2014 03:55 PM
AnotherHobby
Quote:
Originally Posted by mistergreen View Post
@HunterX
I don't see why TimeAlarms would skip time set in seconds. It has an internal loop where it checks up on time from what I remember when I looked at the library code.
Correct. In your main loop, you have to use "Alarm.delay(5);" at the end of the loop instead of a normal delay. That's how it keeps track. It should not skip any seconds.
08-22-2014 03:51 PM
HunterX I think I'm going to give it a shot. I'll rewrite my code this weekend and let everyone know how it went. Thanks for the info Hobby.

Quote:
Originally Posted by mistergreen View Post
@HunterX
I don't see why TimeAlarms would skip time set in seconds. It has an internal loop where it checks up on time from what I remember when I looked at the library code.
08-22-2014 03:45 PM
mistergreen @HunterX
I don't see why TimeAlarms would skip time set in seconds. It has an internal loop where it checks up on time from what I remember when I looked at the library code.
08-22-2014 03:20 PM
HunterX
Quote:
Originally Posted by AnotherHobby View Post
I just wanted to drop in and say this is an awesome build! Excellent job Hunter! I somehow missed this thread until recently (I think because I was so engrossed in my own project). I finally read through the whole thing, and I'm super impressed.

One thing that might make things cleaner for scheduling is to use the Time.Alarms library. I used it in my project, and it's nice that you don't have to check time in the loop to catch things. It also makes it easy to change the schedule. If you read the docs, you can adjust the library to do up to 255 timers. It has quite a bit of functionality.

Here is an example. This one line below would be executed at startup and creates a schedule that'll run a routine called "lightsOn" every day at 11:00am.

Code:
Alarm.alarmRepeat(11,00,0, lightsOn);
The lightsOn routine could look like this:

Code:
void lightsOn()
{
   digitalWrite(pwrLightPin, HIGH); // this turns the relay on
}
That's it — super easy! It also opens the doors to making it pretty easy to edit the schedule through a menu, and saving that in EEPROM.
Hey Hobby,

That does look like it would make my code more simple but I have a question. Say I wanted to turn something on at and exact second and then turn it off at an exact second. Have you seen any issues where the areduing misses that second and skips that alarm. I have an automatic feeder connected to my Arduino. I drive it through a transister using the 5 volts from the Arduino. It takes 5 seconds for it to complete 1 feed cycle. I turn it on say at (11,05,01) and turn it off at (11,05,04). What do you think?

Bump:
Quote:
Originally Posted by bigd603 View Post
Check out what came in the mail today...





The AquaShield boards!

I think they look great! I tested the pump controls, and they all work flawlessly! Really stoked.
Those look great bigd!
This thread has more than 15 replies. Click here to review the whole thread.

Posting Rules
You may post new threads
You may 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


All times are GMT. The time now is 05:37 PM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright Planted Tank LLC 2012