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

N+(2) Aquarium Controller

N+2 aquarium webserver scheduler plugin json html POST

  • Please log in to reply
75 replies to this topic

#61 jeittreim

jeittreim

    Member

  • Members
  • PipPip
  • 12 posts

Posted 11 February 2013 - 01:05 PM

I need a little help guys. 

 

What should I try first? 

 

I would like to start putting the controller together.

I would start with temp and a real time clock.  this gives you the basis for the rest of the system.  (from temp, I added relay control to run a fan when temp gets too high)  the next would be coding for logging.  If you are using the NP or NP2 then it will have built in MicroSD capability.  PH is a really easy addition, as well as the relay boards.  It starts getting problematic when you deal with LCD display, but not too bad.  as far as temp sensor goes, the one you found would work fine.  the stainless steel will not react badly to the salt in the water. 



#62 H07R0D

H07R0D

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts

Posted 11 February 2013 - 01:08 PM

http://adafruit.com/products/381 <-- would this temp sensor work on a Salt water tank?

The end is Stainless, which is usually a bad idea.  It's quite small though, so if your tank is large enough, it may not be a huge issue.

I've got a 90gallon, and I wouldn't use it, but that's my opinion, I'm by no means an expert.



#63 zemuss

zemuss

    Advanced Member

  • Members
  • PipPipPip
  • 69 posts

Posted 11 February 2013 - 03:04 PM

HO7R0d which temp probe did you use?

 

I think I will use this one: http://littlebirdele...rproof-ds18b20. Non-metal casing. Any thoughts?



#64 jeittreim

jeittreim

    Member

  • Members
  • PipPip
  • 12 posts

Posted 11 February 2013 - 05:20 PM

The end is Stainless, which is usually a bad idea.  It's quite small though, so if your tank is large enough, it may not be a huge issue.

I've got a 90gallon, and I wouldn't use it, but that's my opinion, I'm by no means an expert.

I have used stainless steel on multiple tanks, but nothing large than sensor/probe size.  Stainless in itself is non-reactive to saltwater. That being said, I wouldn't use a stainless stell chiller exchange. 

 

The temp probe that I use is the plastic DS18B20 on from sparkfun.  It works great.  https://www.sparkfun.../products/11050  The other option is to make your own using a bic pen barrel cut down and epoxy filled.  If you go the DIY route, make sure you get it 100% watertight and remember the more material that covers the sensor, the slower it is to react to temp changes (for an aquarium sensor, this isn't much of a problem).  It is really cheap to get a pre-made one. I would recommend the digital sensor over the analog thermistor route, but for me this was because it was easier to control/program.  plus it runs 1-wire which has been working great for me on the NP2.



#65 jeittreim

jeittreim

    Member

  • Members
  • PipPip
  • 12 posts

Posted 11 February 2013 - 05:23 PM

H07R0D,

 

have you had issues with debug binaries locking up your NP2?  also, I have been getting into problems with the try/catch blocks not reporting properly on exception handling.  Have you noticed this?



#66 zemuss

zemuss

    Advanced Member

  • Members
  • PipPipPip
  • 69 posts

Posted 11 February 2013 - 05:25 PM

Thank Jeittreim.

 

Question do I need another module to run the probe you linked?



#67 jeittreim

jeittreim

    Member

  • Members
  • PipPip
  • 12 posts

Posted 11 February 2013 - 05:54 PM

Thank Jeittreim.

 

Question do I need another module to run the probe you linked?

Not at all, H07R0d's code is for an analog temp sensor, I just commented out the code for that in the temperature plugin and added the onewire code in its place.



#68 H07R0D

H07R0D

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts

Posted 11 February 2013 - 07:10 PM

I just went with a simple thermistor for the temp sensing.  Probably not quite as accurate, but I'm only really worried about extreme values.

 

As for the binaries locking things up, I have noticed when accessing the NST timeservers, it's taking for-fracking-ever.  It may be worth changing the number of attempts for setting the system time.



#69 jeittreim

jeittreim

    Member

  • Members
  • PipPip
  • 12 posts

Posted 11 February 2013 - 07:57 PM

I just went with a simple thermistor for the temp sensing.  Probably not quite as accurate, but I'm only really worried about extreme values.

 

As for the binaries locking things up, I have noticed when accessing the NST timeservers, it's taking for-fracking-ever.  It may be worth changing the number of attempts for setting the system time.

I feel like a dunce...

 

For the life of me, I cannot figure out the RTC stuff.  How do I get my RTC time updated from NST?  am I not understanding the get time from network function?



#70 H07R0D

H07R0D

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts

Posted 11 February 2013 - 08:25 PM

I feel like a dunce...

 

For the life of me, I cannot figure out the RTC stuff.  How do I get my RTC time updated from NST?  am I not understanding the get time from network function?

I had pulled an extension method from the web somewhere, so you can use DateTime to poll the current time from the NST servers.  Of course, you have to be connected to the internet to do it.



#71 jeittreim

jeittreim

    Member

  • Members
  • PipPip
  • 12 posts

Posted 12 February 2013 - 03:29 AM

I had pulled an extension method from the web somewhere, so you can use DateTime to poll the current time from the NST servers.  Of course, you have to be connected to the internet to do it.

Ok its working AWSOME!!!  had some issues getting the log and relays working, but noted that both were missing : base()   

 

added that, and all works great.  Now I just need to find out why I can only get the temp to publish to thingspeak.  (for some reason PH is not even though I added a field2 to the channel).

 

This is great code. a few things for cleanup, and I am having issues with making changes on the website (anything that tries to modify and write back to the config.js file ends up corrupting and deleting all of its content.  but this shouldn't be too hard of a fix when I get a chance to take a look at it again.



#72 H07R0D

H07R0D

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts

Posted 12 February 2013 - 01:21 PM

Ok its working AWSOME!!!  had some issues getting the log and relays working, but noted that both were missing : base()   

 

added that, and all works great.  Now I just need to find out why I can only get the temp to publish to thingspeak.  (for some reason PH is not even though I added a field2 to the channel).

 

This is great code. a few things for cleanup, and I am having issues with making changes on the website (anything that tries to modify and write back to the config.js file ends up corrupting and deleting all of its content.  but this shouldn't be too hard of a fix when I get a chance to take a look at it again.

Thanks, I'm glad people are able to get some use out of it :)

 

As for the config.js file getting messed, check the lastPOST file on the SD card after you hit 'Save'.  I had a heck of a time getting NeonMika to collect the post data properly, so I may still have missed something.



#73 Ernie

Ernie

    Member

  • Members
  • PipPip
  • 16 posts

Posted 15 March 2013 - 12:17 AM

Trying to use H07R0D's CalculatePH with an Atlas Scientific pH Stamp. I can get the first reading, then every attempt to excute the function thereafter I get: A first chance exception of type 'System.Exception' occurred in Microsoft.SPOT.Hardware.SerialPort.dll What is wrong with the Netduino Plus 2, the code, or the Atlas Scientific stamp, which would cause the function to work the first pass then not work again? private static float CalculatePH() { float ph = 0.0F; SerialPort sp = new SerialPort(Serial.COM3, 38400, Parity.None, 8, StopBits.One); sp.ReadTimeout = 1000; try { string command = ""; string response = ""; char inChar; // Send the temperature reading if available if (fCTemp > 0) command = fCTemp.ToString("F") + "rRr"; else command = "Rr"; Debug.Print(command); byte[] message = Encoding.UTF8.GetBytes(command); sp.Open(); sp.Write(message, 0, message.Length); sp.Flush(); Debug.Print("sending message"); // Now collect response while ((inChar = (char)sp.ReadByte()) != 'r') { response += inChar; } // Stamp can return text if reading was not successful, so test before returning double phReading; if (Double.TryParse(response, out phReading)) ph = (float)phReading; } catch (Exception e) { Debug.Print(e.StackTrace); } finally { sp.Close(); sp.Dispose(); } return ph; }

#74 Ernie

Ernie

    Member

  • Members
  • PipPip
  • 16 posts

Posted 16 March 2013 - 01:00 AM

Disregard my last post. I figured it out!

#75 yetanothernetduino

yetanothernetduino

    New Member

  • Members
  • Pip
  • 7 posts

Posted 24 March 2013 - 10:42 PM

This is a great example to learn from - the original author is  very kind to post his projects.

 

My questions about this projects.

 

1. How do you actually debug the plugin projects? since the project methology is iplugable and all .be files are in SD card?

2. What's the best best way to transfer files/deploy files into SD Card? Currently, I just remove the card and place into a card reader - which is time consuming. Is this the only option?

 

Thanks in advance.



#76 H07R0D

H07R0D

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts

Posted 26 March 2013 - 05:05 PM

This is a great example to learn from - the original author is  very kind to post his projects.

 

My questions about this projects.

 

1. How do you actually debug the plugin projects? since the project methology is iplugable and all .be files are in SD card?

2. What's the best best way to transfer files/deploy files into SD Card? Currently, I just remove the card and place into a card reader - which is time consuming. Is this the only option?

 

Thanks in advance.

Hi YaN,

1) Unfortunately, I'm not aware of any way to step into a .pe file.  If you find one, please let me know, as it would be very nice to be able to do.  The whole reason I setup the 'plugin' style work was so I could have the controller running the the aquarium, code new features elsewhere and just move them onto the SD for new features.

 

2) For file transfer, I do what you do. Pop the SD, insert into devbox, compile (which copies the files to SD), back into netduino and go.

There is a possibility of moving files to the SD card using the webserver, since it's mostly NeonMika's code for that.  There's an upload feature I didn't include, but that may work for you.







Also tagged with one or more of these keywords: N+2, aquarium, webserver, scheduler, plugin, json, html, POST

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.