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

#41 H07R0D

H07R0D

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts

Posted 07 December 2012 - 06:21 PM

I'm not sure which one Strent is using in that image posted earlier, but I'm using this one from Seeed Studio.
I used this tutorial for the power strip and everything is working very nicely. I can control 4 of the 8 plugs on the power strip currently, and another relay board would let me control the other 4 if I need to.

My only real concern is the relay shield is rated for 70W per unit, and my lights are just over 100W per plug (2 plugs / 4 lights). It's working, but I'm wondering what issues (if any) it will cause down the road.

#42 zemuss

zemuss

    Advanced Member

  • Members
  • PipPipPip
  • 69 posts

Posted 07 December 2012 - 06:22 PM

I found the relay but where did you purchase it from? Has anyone heard of http://arduino-direc...ct_detail&p=156

#43 strent

strent

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 08 December 2012 - 01:42 AM

Got it from eBay - it's rated at DC30V 10A or AC250V 10A.

If you can get your hands on a switched rack power supply for a decent price, I'd highly recommend wiring it up like this http://hydra-reef.com/wiki/Relays

#44 zemuss

zemuss

    Advanced Member

  • Members
  • PipPipPip
  • 69 posts

Posted 14 December 2012 - 04:01 PM

Ok cool its the same one.

#45 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 31 December 2012 - 05:06 PM

I'm following along with this one, as I build my own version on the N+2 over here.

 

Keep up the good work!



#46 strent

strent

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 06 January 2013 - 11:49 AM

I was having issues with running out of memory on my N+ (Running 4.1) very quickly, so I've had to trim/optimize some of the code and unfortunately abandon the ability to load plugins from the SD card. I've also consolidated down to 1 assembly for maximum memory optimization. Right now I have about 8-10kb free.

 

I've put my version based on H07R0D's code up on bitbucket (I prefer it over github)

 

https://bitbucket.or...wise-controller

 

It currently has an issue where the scheduled tasks randomly stop after about 30mins, which I think is something to do with garbage collection - but it's getting there. Fixed!

 

I'm using a 74HC595 and SPI to control the 8 channels on my relay. This means it only needs 4 pins to work - 3 for clock/latch/data & 1 to control the output enable functionality of the 74HC595 (this makes sure all the relays are turned off during boot up).

This also means you can add as many relays as you want just by adding another 74HC595!

 

Temperature is still done by DS1820's and you can theoretically add as many as you want on the OneWire bus.

 

pH is using serial with the Atlas Scientific stamp. One known issue here, the temperature adjustment uses the last temperature reading, which isn't necessarily the water temp. There is now a config option to put in the ROM ID of the temperature sensor.

 

Rough schematic - I don't have it wired up exactly this way, but I tried to make it easier to understand in a drawing

 

Posted Image



#47 H07R0D

H07R0D

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts

Posted 01 February 2013 - 08:15 PM

Finally got the webserver up and running.

Handles POST properly, and responds to all ajax calls.

Now I can turn on/off the relays through the web front end!

 

Just have to figure out how to reboot the netduino on Config file Save.  I want the browser to sit and wait until the netduino has rebooted, but I have no idea what needs doing on the webserver side to accomplish that.



#48 NeonMika / Markus VV.

NeonMika / Markus VV.

    Advanced Member

  • Members
  • PipPipPip
  • 209 posts
  • LocationUpper Austria

Posted 02 February 2013 - 06:25 PM

Hey, I just stumbled upon this project and saw that it is using NeonMika.Webserver.

I have to admit, I've just read the first post and not the whole thread, but it sounds pretty cool.

 

I am far away from being a web programmer, and I work with sockets just from time to time when I need them in my spare time projects.

So could you tell me: What do you do exactly? Upload a file to the N+2, save it. Then you want to reboot the Netduino and when it's rebootet you want the page (which is stored on the N+2) to refresh? Hmmm...

 

Greets, Markus


NeonMika.Webserver
> Control your N+ and write webservice methods easyily
> Receive data from you N+ (in XML or JSON)
> Browse the SD on your N+ directly in the browser and d
own - and upload files

 

If you need help with NeonMika.Webserver, please just leave a note in the thread and/or contact me via Skype :)

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
--- Mistakes teach you important lessons. Every time you make one, you are one step closer to your goal. ----
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------


#49 strent

strent

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 02 February 2013 - 11:05 PM

Finally got the webserver up and running.

Handles POST properly, and responds to all ajax calls.

Now I can turn on/off the relays through the web front end!

 

Just have to figure out how to reboot the netduino on Config file Save.  I want the browser to sit and wait until the netduino has rebooted, but I have no idea what needs doing on the webserver side to accomplish that.

 

Home routers do this when you select the option to reboot them from the WebUI - they just use a javascript timer that waits 2 mins and then redirects/refreshes the page.

 

You could also do it with an ajax long poll



#50 perkunas

perkunas

    Advanced Member

  • Members
  • PipPipPip
  • 108 posts

Posted 03 February 2013 - 05:13 PM

Wow Impressive!!!

I'm building a Hydroponic controller similar in contruction.

I went down a difernt road, wanted it simple so you can copy it easy, and besides I have limited programing abilities.

Tried the stamp thing didnt like them, they are somwhat inacurate, and are really bear bones. I didnt like the Idea I would be tied to a computer for readings no screen either. So I went with the mini hanna controllers, they are like a little over a $100 but give you a display contolls buttons and a built in relay, a bit of a steel if you think about what you get for them.Took me like a year to get them going right, they need masive deboucing error correction ect. almost gave up untill I talked to somone using them and gave me the code that I needed that acually works. Relays I'm using optical you can get a bank of 8 for like 14$ you cant build them that cheep.Dosing pumps are the mini peristaltic not cheep, Need to think about a GUI now as it all works great. Its a lot more complicated then you would think, as you would probably know. Looking forward to see what your finished product looks like.

Thanks



#51 H07R0D

H07R0D

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts

Posted 04 February 2013 - 01:03 PM

Hey, I just stumbled upon this project and saw that it is using NeonMika.Webserver.

I have to admit, I've just read the first post and not the whole thread, but it sounds pretty cool.

 

I am far away from being a web programmer, and I work with sockets just from time to time when I need them in my spare time projects.

So could you tell me: What do you do exactly? Upload a file to the N+2, save it. Then you want to reboot the Netduino and when it's rebootet you want the page (which is stored on the N+2) to refresh? Hmmm...

 

Greets, Markus

Wanted to say thanks for the great code, it's made my system much easier to use.

 

I'm POSTing the config.js file back down to the netduino after it's been modified in browser.

When the file gets saved, I want to be able to tell the Netduino to restart, thus reloading the modified config file.



#52 H07R0D

H07R0D

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts

Posted 04 February 2013 - 01:09 PM

Home routers do this when you select the option to reboot them from the WebUI - they just use a javascript timer that waits 2 mins and then redirects/refreshes the page.

 

You could also do it with an ajax long poll

Currently, all my interactive calls go down to the netduino via ajax, and I've attached a couple listeners for ajaxStart and ajaxStop to pop the "Please wait" visuals.

Ideally I would love to be able to reboot the netduino and send a 200_OK once the server is back up.  That way, the ajaxStop catches the restart.  Not sure if I can do it that way though.



#53 strent

strent

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 04 February 2013 - 09:49 PM

You could make a method /status that returns the running status of the controller (running, rebooting). When you press the save and reboot button, it sets the status to rebooting and then starts polling /status until it returns running. Make sure to have the Ajax timeout higher than the time it takes to reboot.

#54 NeonMika / Markus VV.

NeonMika / Markus VV.

    Advanced Member

  • Members
  • PipPipPip
  • 209 posts
  • LocationUpper Austria

Posted 05 February 2013 - 10:51 AM

I would also suggest to upload the file via POST, then restart (with the Webserver, you can just write a XMLRespone which restarts the Netduino) your N+2.

On the client side, after uploading the file I would start checking the "reachability" of the netduino in a loop, ergo does a request to the netduino ip throw an exception or something like that. (sorry, don't really know javascript)

The first time no exception is thrown you know that the netduino is rebootet.

 

So the netduino starts rebooting...

Client starts a loop (running as long as the requests thrown an exception)

First time no exception is thrown, reload the page.

 

I hope it was understandable what I've written :P

 

Greets, Markus


NeonMika.Webserver
> Control your N+ and write webservice methods easyily
> Receive data from you N+ (in XML or JSON)
> Browse the SD on your N+ directly in the browser and d
own - and upload files

 

If you need help with NeonMika.Webserver, please just leave a note in the thread and/or contact me via Skype :)

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
--- Mistakes teach you important lessons. Every time you make one, you are one step closer to your goal. ----
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------


#55 strent

strent

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 06 February 2013 - 09:39 PM

Finished my relay board

Posted Image

Posted Image

Posted Image

Posted Image

It's using the chassis of a chauvet sr-8.

#56 H07R0D

H07R0D

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts

Posted 08 February 2013 - 07:50 PM

looks great strent!

I'm curious how your relay shield works, as mine eventually has Vac running through it, so how did you get a db9 port to handle 115V? (or whatever your Vac is over there, I noticed a different plug profile).



#57 strent

strent

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 08 February 2013 - 10:06 PM

We have 220-240v vac

The relays in the sr-8 are pre-wired to the hot line. See in the third photo, the wires go in to the pcb.
The board comes hard wired for US. I had to de-solder, put crimp connectors on the wires and replace the sockets.

The db9 port is used to trigger the relays.

Pin 5 is 12v and then you ground another pin to trigger the relay. I'm using NPN transistors to control the 12v grounding for each relay.

 

 

Edit: Here's my test circuit

 

Posted Image

 

 

This circuit is using a push button to test individual relays.

 

Now that I need 12v, I am using a 12v DC power brick as input. I then use a 9v regulator to power the netduino via the VIN pin

 

If I get too much noise from the relays, I'll look at putting in 2 x quad opto-isolators



#58 zemuss

zemuss

    Advanced Member

  • Members
  • PipPipPip
  • 69 posts

Posted 11 February 2013 - 03:19 AM

I need a little help guys. 

 

What should I try first? 

 

I would like to start putting the controller together.



#59 zemuss

zemuss

    Advanced Member

  • Members
  • PipPipPip
  • 69 posts

Posted 11 February 2013 - 03:54 AM

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



#60 strent

strent

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 11 February 2013 - 04:35 AM

I need a little help guys. 

 

What should I try first? 

 

I would like to start putting the controller together.

 

Temperature is a good start, then pH







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.