Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

My Aquarium Controller + LED Lighting Controller

aquarium LED Netduino Plus 2 HTTP webserver

  • Please log in to reply
35 replies to this topic

#21 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 28 May 2013 - 04:30 AM

Posted Image
 
 
Posted Image
 
 
LCD is functioning and useful, shows 'ATO' when the ATO is running, mode, (currently "Night") and Temp (77.56).
 
Used some command strips to pin everything down to a board for prototyping. Turns out turning the power supply for the LED's on and off wreaks havoc on my i2c communication. Tossing pauses all over to try to get things straitened out, but using i2c for two devices across 10 threads is getting interesting.

 

Logging temp every 30 min or so to reefin.net will get a few more items added to logging and get the logging routine straitened out. I think I'll log the status of the system (OK- Night Mode) Fairly frequently (15 min), then have a series of parameters that I only log once a day unless they get out of a 'normal' state (temp/pH/salinity) and then ones that get updated everytime they change (relay status, "System" status).



#22 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 24 June 2013 - 03:04 PM

Latest source with logging auth removed.

Attached Files



#23 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 25 June 2013 - 07:31 PM

Added a webserver to the device, currently outputs status type stuff. Not sure which direction I'd like to go- I do know I want history graphs and what not because I'm nerdy like that and I don't want this device to make those/keep the records etc. So pulling that into another webserver is going to have to happen. It's just if I want to have one web site (reefin.net for instance) be a proxy to my device, what it knows/logs on it's own is there + pulls some info in real time... not sure yet. Was a bit reluctant to add a webserver but this one is pretty light weight and ignores most of the complications of handling things it won't have to.

 

Special Thanks to GREG ZIMMERS for the easy to understand web server example.



#24 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 26 June 2013 - 02:34 AM

Here is where I am data pulling wise via webserver to XML:
 
<status>     <temp>78.462500000000006</temp>     <memory>96600</memory>     <heating>True</heating>     <ato>          <status>False</status>          <lastRun>06/25/2013 21:29:27</lastRun>     </ato>     <lights>          <phase>Dusk</phase>          <light1>               <ch1>11</ch1>               <ch2>78</ch2>               <ch3>117</ch3>               <ch4>78</ch4>               <ch5>11</ch5>         </light1>     </lights></status>


#25 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 08 July 2013 - 07:53 PM

I'm providing my most recent download of the controller project here: http://reefin.net/source-downloads/

 

I'm puling the XML real time through to my webserver for reefin.net which works pretty well. 



#26 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 17 July 2013 - 01:42 AM

I can now send commands to the controller via URL so I can now override my light phase manually, then reset it, and within 60 seconds of resetting it starts fading to the proper light phase for the time of day. Next? Adding a couple "Modes"- feed mode, water change mode. I'm also getting the ATO re-set-up with a better pump and water storage since I'll be gone for a week.



#27 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 31 July 2013 - 12:35 AM

well, I think I settled on a 5th order polynomial as my basis for the curves I'm building to calculate lights. Right now my example curve is calculating and work just fine, here is the code:
 
double[] day1 = new double[] { -0.002, 0.4539, -18.728, 253.68, -936.89, 286.05 };            double CurrentPower = day1[5];            double calcTime = DateTime.Now.Hour; // hours in 24 hour format            calcTime += (((double)(DateTime.Now.Minute) / 60)); // convert minutes to fractional hours            CurrentPower += day1[4] * calcTime;            CurrentPower += day1[3] * System.Math.Pow(calcTime, 2);            CurrentPower += day1[2] * System.Math.Pow(calcTime, 3);            CurrentPower += day1[1] * System.Math.Pow(calcTime, 4);            CurrentPower += day1[0] * System.Math.Pow(calcTime, 5);            if (CurrentPower < 0)                CurrentPower = 0;            Debug.Print(CurrentPower.ToString());
 
the equation is this: 
y = -0.002 * x^5 + 0.4539 * x^4 - 18.728 * x^3 + 253.68 * x^2 - 936.89 * x + 286.05
 
that's an example of one I might use for a blue channel: fading in starting as early as 5 AM with no significant light output until 7 AM,  peaking at just over 2000 out of 4000 right at 1:30 in the afternoon and fading out to darkness at about 6:00 PM. 
 
I have the code running, but not controlling the lights yet. Did add an LCD message telling me it's "Overriding" the lights when override is active, and that works well.


#28 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 08 August 2013 - 03:16 PM

Realized last night laying in bed I approached the fade method poorly. I knew it had work to be done to make it the best it could be but my solving for step size is silly.
 
What i should be doing?
 
Solving for delay. I can fade from zero to 100% very quickly, in only very very special circumstances will I need to go faster than 1 unit per millisecond and I can handle those separately. I think I'll re-write my fadeto method to calculate delay and assume 1 unit step size.
 
I laid awake last night writing the code in my head, so there isn't much besides finding time in the next few days to get it onto a computer left.


#29 zemuss

zemuss

    Advanced Member

  • Members
  • PipPipPip
  • 69 posts

Posted 05 October 2013 - 01:57 AM

iced98lx thanks for posting your code. I have been away from the project due to a death in the fam and other work related things but getting back to it.

 

This should help.



#30 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 21 October 2013 - 02:11 PM

Glad to help, I'll post an updated version soon with a few more tidbits.



#31 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 25 October 2013 - 04:34 PM

Next Code Push Items:

 

  • Multiple Heater Support (alternate, use both if VERY COLD)
  • Intelligent heater failure detection
  • Log Hours of use for each Heater
  • Perminate storage to micro-SD strategy (XML? JSON?)
  • RTC addition
  • Shift Registers for Relays

 

Hardware wise

 

  • Enclosure
  • External 5v power supply for LCD and relays and sensors
  • Hook up RTC & Shift registers
  • pH probe testing


#32 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 11 November 2013 - 03:04 AM

Tonight's progress:


    [*]Added uptime to the XML status
    [*]Checking to see if SD Card is present and if so, launching SD thread (not saving anything to it, so the thread start is commented out still but it's the start of an intelligent SD card use, I think..)
    [*]Added a folder for "ProjectObjects"
    [*]Added a class: Heater (see details below)
    [/list]

    Heater Class-
     I've always enjoyed the simplicity of this project's code but it was time to abstract a few things. First and foremost, I will want to be able to control multiple heaters and do some intelligent things (if it's VERY cold, turn them all on, alternate between them all, detect if one is possibly not heating, etc) and in order to do that I need to abstract the heating system a little further than just an output port.  The heater class is designed to be consumed by a "heaters" class which can take in N number of heaters,  and allows you to tell it to heat the tank, and keeps track of the 'advanced' bits. 
     
    A "Heater" consists of:


      [*]output port (_relay) to control the heater on/off
      [*]dateTime (_onTime) to dictate when it was last turned on
      [*]bool _suspect to note the heater is suspect of being non-functioning
      [*]timespan totalTime to keep track of the total time this heater has ran [[currently volatile]]
      [*]bool heating to note if the heater is currently heating
      [*]one constructor which takes an outputPort and sets the heating status based on what that port is currently doing
      [*]Heat() which turns the heater on, sets the _onTime and returns
      [*]TurnOff() which turns off the heater, calculates how long it's been on this run and adds it to the total time and returns
      [/list]

      Not using the Heater class yet, as I haven't the time to write the Heaters class.



#33 JLodge

JLodge

    New Member

  • Members
  • Pip
  • 2 posts

Posted 22 July 2014 - 03:51 PM

Love the project - any diy is just amazing.

 

Quick question: I have been looking at the e-tape for a while and been trying to decide whether I should get it as opposed to the water level sensor found here: http://vegetronix.co...ucts/AquaPlumb/

 

Although the e-tape is cheaper, is it still accurate? Also, will it corrode in the salt water over time, because I don't want to have to continuously replace and hook it up to a system. 

 

Overall, my main question is: is it worth my while to get an etape, or should I keep looking for a different alternative?

 

Thanks for the help



#34 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 28 July 2014 - 07:21 PM

Love the project - any diy is just amazing.

 

Quick question: I have been looking at the e-tape for a while and been trying to decide whether I should get it as opposed to the water level sensor found here: http://vegetronix.co...ucts/AquaPlumb/

 

Although the e-tape is cheaper, is it still accurate? Also, will it corrode in the salt water over time, because I don't want to have to continuously replace and hook it up to a system. 

 

Overall, my main question is: is it worth my while to get an etape, or should I keep looking for a different alternative?

 

Thanks for the help

I'd avoid the eTape, go with a pressure based sensor, just google 'arduino pressure liquid sensor'



#35 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 31 December 2014 - 05:20 PM

Okay Project V2 is under way. I've started the hardware side, and I'm starting pretty fresh code wise, while pulling stuff from the current incarnation to get moving. Biggest steps are more stable hardware setup (IE no solderless breadboards). 

 

Started a codeplex:

 

https://reefindotnet.codeplex.com/

 

and updated the blog:

 

http://reefin.net/



#36 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 29 March 2015 - 05:09 PM

The controller V2 is now running my 180 gallon tank:

 

IMG_20150327_193926133_HDR_zpss2qfinir.j

 

Codeplex has been updated to reflect the following working in live:

 

Light Control

Auto Top Off for Evaporation Control

Webserver

Temp Sensor (though not currently in active use)

LCD Control using i2c Backpack (though not currently in active use)

 

I'm changing up how I want to wire for an 8 outlet power control, so that's not in the live build. LCD Support is there but not used, just like Temp.

 

I've observed much more stable behavior, though nearly everything on this version is soldered/better connected so that may be part of it, or the new firmware is better as this is running the latest while the previous is running slightly older version. 

 

The old setup was on my now QT tank, I have converted it basically to ATO Duties only and will eventually swap it out for a cheaper board and have two boards for development.







Also tagged with one or more of these keywords: aquarium, LED, Netduino Plus 2, HTTP, webserver

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.