![]() |
|
|||||||
| DIY For your DIY plans, ideas, and related info. |
![]() |
|
|
Thread Tools | Display Modes |
|
#61
|
||||
|
||||
|
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 |
|
#62
|
||||
|
||||
|
Quote:
Quote:
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 |
|
#63
|
||||
|
||||
|
Quote:
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 |
|
#64
|
||||
|
||||
|
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 |
|
#65
|
||||
|
||||
|
Quote:
__________________
|
|
#66
|
||||
|
||||
|
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.
__________________
|
|
#67
|
||||
|
||||
|
Quote:
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.
|
|
#68
|
||||
|
||||
|
Quote:
__________________
|
|
#69
|
||||
|
||||
|
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.
__________________
|
|
#70
|
||||
|
||||
|
Quote:
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. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|