UltimateReef.com

Go Back   UltimateReef.com > Main Discussion Forums > DIY

DIY For your DIY plans, ideas, and related info.

Reply
 
Thread Tools Display Modes
  #61  
Old 06-04-12, 06:22
Jbroadway's Avatar
Jbroadway Jbroadway is offline
Moray Eel
 
Join Date: May 2011
Location: essex
Posts: 2,434
The thing that confuses me about that code. Is you put t.hour * 60 why is that?
__________________
my first marine tank 4ft
1 six line wrass 2 perc clowns
1 bicolour dottyback 1 yellow tang
1 scooter blenny 3 chromis
Reply With Quote
  #62  
Old 06-04-12, 08:44
bikedoctorr's Avatar
bikedoctorr bikedoctorr is offline
Octopus
 
Join Date: Jan 2009
Location: london
Posts: 3,250
Quote:
Originally Posted by 10b0b View Post
1037, just a Chinese built thing, needs some headers welding on though
it must be a 1307 chip used if it uses that library

Quote:
Originally Posted by johnski View Post
the library i use for my 1307 rtc is from here, http://www.henningkarlsen.com/electr...rary.php?id=34
i thought you were running the same as me but now i realalized that he dose both librarys the 1307 and 1302(which i use)

Quote:
Originally Posted by Jbroadway View Post
The thing that confuses me about that code. Is you put t.hour * 60 why is that?
if you read my thread it kinda goes threw it in more detail but if you want to timer for straight hours its easy but if you want to then add in mins it gets tricky. say you want it to turn on at 8.30am and it will. but then at 845 you have a power cut. when the power come back on at 8.50 as soon as the arduino went threw the instructions it would turn your lights back on (all well and good). but if the power didnt come on untill lets say 9.05. the hour is now more than 8 but the mins is not higher than 30 so the lights will not switch on till 30 mins past the hour after any power cut if at the right time. now think about if your timer is set at 59 mins past. possiable extra hour your lights could be off on top of power cut time. so john suggested to use mins as the timer instead. this way then amount of mins in the day is only ever one thing that has to be right so they switch on straight away after a power cut. so to timer for 8.30 you put 8*60(turns the hours into mins) and then add the mins past the hour say +30 this is the time in mins. this has to be measured in both parts of the if satement in mins.
__________________
http://www.ultimatereef.net/forums/s...d.php?t=537250 my tank and led controller
http://www.ultimatereef.net/forums/s...d.php?t=298039 my tank
29x26x20 200 ltr 21x15x18 sump nd aquatics, deltec apf600, red sea pro salt, 300 watt heater, 9w jebo uv, 55kg fiji live rock, tunze 2015, 6055x2, redsea a&B, med grade coral sand, compact 2000, 2x24w t5 blue, 2x24w t5 10k&15k geisman bulbs, 31 cree leds 1 ltr cabon and rowa
Reply With Quote
  #63  
Old 06-04-12, 09:14
Jbroadway's Avatar
Jbroadway Jbroadway is offline
Moray Eel
 
Join Date: May 2011
Location: essex
Posts: 2,434
Quote:
Originally Posted by bikedoctorr View Post
it must be a 1307 chip used if it uses that library



if you read my thread it kinda goes threw it in more detail but if you want to timer for straight hours its easy but if you want to then add in mins it gets tricky. say you want it to turn on at 8.30am and it will. but then at 845 you have a power cut. when the power come back on at 8.50 as soon as the arduino went threw the instructions it would turn your lights back on (all well and good). but if the power didnt come on untill lets say 9.05. the hour is now more than 8 but the mins is not higher than 30 so the lights will not switch on till 30 mins past the hour after any power cut if at the right time. now think about if your timer is set at 59 mins past. possiable extra hour your lights could be off on top of power cut time. so john suggested to use mins as the timer instead. this way then amount of mins in the day is only ever one thing that has to be right so they switch on straight away after a power cut. so to timer for 8.30 you put 8*60(turns the hours into mins) and then add the mins past the hour say +30 this is the time in mins. this has to be measured in both parts of the if satement in mins.

that makes total sense now i understand didnt the first time i read it. the library im using uses now.hour() and now.minute()

so my code was

if ((now.hour() <= 8) && (now.minute() <= 30);
digitalWrite (ledPin, HIGH);

if ((now.hour() <= 8) && (now.minute() <= 45);
digitalWrite (ledPin, LOW);

delay (1000);


i only had leds to play with lol.

but i had a problem with turning it off because it would come to 8 45 and turn the led off but then after the delay it would flash on then flash off and do that every second.

if ((now.hour() == 8) && (now.minute() == 30);
digitalWrite (ledPin, HIGH);

if ((now.hour() == 8) && (now.minute() == 45);
digitalWrite (ledPin, LOW);

delay (1000);

so i changed it to that but this doesnt cover for power cuts. but cant think how to add this, i may add the library you guys are using as looking at the examples on the website theres so much more controlabilty
__________________
my first marine tank 4ft
1 six line wrass 2 perc clowns
1 bicolour dottyback 1 yellow tang
1 scooter blenny 3 chromis
Reply With Quote
  #64  
Old 06-04-12, 09:36
bikedoctorr's Avatar
bikedoctorr bikedoctorr is offline
Octopus
 
Join Date: Jan 2009
Location: london
Posts: 3,250
its even more to it than that. like you said it will flash on and off. instead of taking up 10b thread shall i explain in my thread. ill post up to full code for you of the timer., i think its even on there already. you finding out all the things i did and it took me about a week to get it sorted and i dont think i would of fully if john hadnt suggested a few things
__________________
http://www.ultimatereef.net/forums/s...d.php?t=537250 my tank and led controller
http://www.ultimatereef.net/forums/s...d.php?t=298039 my tank
29x26x20 200 ltr 21x15x18 sump nd aquatics, deltec apf600, red sea pro salt, 300 watt heater, 9w jebo uv, 55kg fiji live rock, tunze 2015, 6055x2, redsea a&B, med grade coral sand, compact 2000, 2x24w t5 blue, 2x24w t5 10k&15k geisman bulbs, 31 cree leds 1 ltr cabon and rowa
Reply With Quote
  #65  
Old 06-04-12, 10:04
10b0b's Avatar
10b0b 10b0b is offline
Moray Eel
 
Join Date: Feb 2012
Location: Mansfield, Notts
Posts: 2,792
Quote:
Originally Posted by bikedoctorr View Post
wow never heard of that one. i hope you can find a library for it or can you write one your self. or you could just use the proper comands if your really good. like ch.44 and all that but i dont have a clue on that stuff. i got my timers working spot on now so shoutt me if you have probs getting code to work as there not as easy as youd think they are. the code was psoted up on my thread. well most of it anyway. the code for the dosing pumps is up now too. onto version two and its not even been on the tank yet hehehehe
1307 I mean. Typo, I was tired
Reply With Quote
  #66  
Old 02-05-12, 17:28
10b0b's Avatar
10b0b 10b0b is offline
Moray Eel
 
Join Date: Feb 2012
Location: Mansfield, Notts
Posts: 2,792
Well, my controller project has died a death, not had much time for it over the last few weeks, new job an'all.

However the more i try to work on it the more i know i need to spend some time learning the programming and it's a bit heavy going when diving in at the deep end So my Tank Controller is going on the backburner for now...

However, im still learning it and have decided to build a simpler controller to do a simpler task in order to have a practical project to learn from.

As i have a very unhealthy obsession with my RODI unit. My controller will be controlling that!

In short it will measure TDS values, using some HM Digital sensors, and a series of solenoid valves, and have the abiliy to monitor the membrane and DI, and drain off the excess TDS before diverting the good stuff to a water butt. The water butt will have a float switch installed and shut they system down when its done etc...

In the end i hope to have a "one touch" system that will prime, flush and fill a water butt with 0TDS water

Completely over the top? Absolutely!

But it will have a range of analogue, digital inputs and outputs and will still use the LCD. As i said, its a project to learn the system with and wont require any special librarys to make it work.

So far ive dug my Arduino out the cupboard, aquired a few extra parts and the TDS sensors are on the way. Once ive cracked them i will aquire some solenoids and various fittings.

Reply With Quote
  #67  
Old 02-05-12, 17:55
twin sisters's Avatar
twin sisters twin sisters is offline
Angelfish
 
Join Date: May 2008
Location: Bedfordshire
Posts: 645
Quote:
Originally Posted by 10b0b View Post
Well, my controller project has died a death, not had much time for it over the last few weeks, new job an'all.

However the more i try to work on it the more i know i need to spend some time learning the programming and it's a bit heavy going when diving in at the deep end So my Tank Controller is going on the backburner for now...

However, im still learning it and have decided to build a simpler controller to do a simpler task in order to have a practical project to learn from.

As i have a very unhealthy obsession with my RODI unit. My controller will be controlling that!

In short it will measure TDS values, using some HM Digital sensors, and a series of solenoid valves, and have the abiliy to monitor the membrane and DI, and drain off the excess TDS before diverting the good stuff to a water butt. The water butt will have a float switch installed and shut they system down when its done etc...

In the end i hope to have a "one touch" system that will prime, flush and fill a water butt with 0TDS water

Completely over the top? Absolutely!

But it will have a range of analogue, digital inputs and outputs and will still use the LCD. As i said, its a project to learn the system with and wont require any special librarys to make it work.

So far ive dug my Arduino out the cupboard, aquired a few extra parts and the TDS sensors are on the way. Once ive cracked them i will aquire some solenoids and various fittings.

I did something similar, so I have a small suggestion for you.

I also incorporated a time delay, so that if for some reason the float switch didn't register the full water butt, the system didn't overflow (to much) as it would stop anyway after a fixed period of time, and had to be manually reset by the operator.

I also did this because my Aquarium is auto topped up direct from the RO into the sump, and I didn't want to run the risk of the consequences of the float switch failing/sticking there either.
__________________
To only look for the negatives stifles innovation.
Reply With Quote
  #68  
Old 02-05-12, 17:58
10b0b's Avatar
10b0b 10b0b is offline
Moray Eel
 
Join Date: Feb 2012
Location: Mansfield, Notts
Posts: 2,792
Quote:
Originally Posted by twin sisters View Post
I did something similar, so I have a small suggestion for you.

I also incorporated a time delay, so that if for some reason the float switch didn't register the full water butt, the system didn't overflow (to much) as it would stop anyway after a fixed period of time, and had to be manually reset by the operator.

I also did this because my Aquarium is auto topped up direct from the RO into the sump, and I didn't want to run the risk of the consequences of the float switch failing/sticking there either.
Already part of the plan my man
Reply With Quote
  #69  
Old 05-05-12, 15:15
10b0b's Avatar
10b0b 10b0b is offline
Moray Eel
 
Join Date: Feb 2012
Location: Mansfield, Notts
Posts: 2,792
Programming is going well so far. Managed to fathom a structured system within the code itself, also created a user editable "Settings" type menu for adjusting how the system will operate.

Got my HM sensors, just need to have a play and figure out how they work (no data sheet sadly) they also appear to have a built in temp sensor... hence the 4 wires.

Reply With Quote
  #70  
Old 05-05-12, 16:53
twin sisters's Avatar
twin sisters twin sisters is offline
Angelfish
 
Join Date: May 2008
Location: Bedfordshire
Posts: 645
Quote:
Originally Posted by 10b0b View Post
Programming is going well so far. Managed to fathom a structured system within the code itself, also created a user editable "Settings" type menu for adjusting how the system will operate.

Got my HM sensors, just need to have a play and figure out how they work (no data sheet sadly) they also appear to have a built in temp sensor... hence the 4 wires.

Nice looking device.

If the other sensor is a temperature sensor, this is because true TDS measurements are relative to temperature, but probably doesn't make much difference for our requirements.

I think what you have is two conductivity sensors, each with a temperature sensor in. Does each sensor have 4 wires?

Forgive me if you already know this, but I was a little concerned when you said you need to have a play to figure out how it works. All it is (apart from the temperature sensor) is two inert metal electrodes.

To measure conductivity/TDS, you need to use an alternating supply across the electrodes. If you use a DC supply, it just rips the molecules apart, the molecules that you are trying to measure, and you get a completely eroneous result.

If you want a circuit to interface to a microcontroller A/D input, this one isn't bad.

http://www.octiva.net/projects/ppm/images/Schematic.jpg

Sorry if you already know this, but I wasn't sure.
__________________
To only look for the negatives stifles innovation.

Last edited by twin sisters; 05-05-12 at 17:11.
Reply With Quote
Reply

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 04:42.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

UltimateReef.com - the UK's premier online reef keeping community. Bulletin Board & Forum.

Copyright 2001-2011 UltimateReef.com