Boga's Reef Controller

Boga

Active Member
Joined
Jan 12, 2012
Location
Dorchester, Ontario
For at least two years I was planning this Aquarium Controller. For the time I spent, probably is not worth it, but since DIY is another hobby of mine, it looks that I can not do anything about it ... :D

So ...  8)

Hardware:
- Arduino Mega 2560
- Graphic Display 128x64 (white on blue)
- Remote
- Real Time Clock
- Ethernet shield
- Data logger (on SD card)
- pH shield from Atlas Scientific
- pH probe from BRS
- temperature probes DS18B20
- other various things (connectors, relays, switches, etc).

Software: Boga

Functions:
- Monitor/control temperature
- monitor pH
- control lights (white, blue, UV, refugium)
- control power heads (wave programs)
- feeding programs
- monitor water level in various tanks
- leak detection
- datalog: various parameters
- generate all kind of alarms
- web interface for displaying status

Possible future additions:
- Electro-conductivity
- ORP
- Dissolved oxygen
- web interface for adjusting parameters and set-up
- automatic bubble algae removal. Ok, just wanted to see if you made it to this line.
 

curiousphil

Super Active Member
Joined
Apr 15, 2013
Location
London, Ontario
Nicely planned out! :)

I agree that they probably don't save much going the DIY route for a controller, but it's fun and  oh so satisfying when you get it working!  Looking forward to seeing more of your build.
 

AdamS

Active Member
Joined
Oct 7, 2012
Location
London, Ontario
curiousphil link said:
Nicely planned out! :)

I agree that they probably don't save much going the DIY route for a controller, but it's fun and  oh so satisfying when you get it working!  Looking forward to seeing more of your build.

+1

The APEX controller looks to do a really nice job. I prefer the DIY method though too, just because it is more fun.

What RTC are you using/planning? My fish keep better time then the one I have, they are trying to sleep and the damn lights are still on.
 

KBennett

Member
Joined
Sep 17, 2012
Location
Brantford
For components, check out Dx.com and fasttech.com.  cheap and free shipping.
Use the arduino watchdog... The temp probes have a habit of freezing the program.
 

Boga

Active Member
Joined
Jan 12, 2012
Location
Dorchester, Ontario
Thank you all !

For RTC I am using DS1307. Already implemented and works fine. Websites added to favorites. I did not know that there is a watch dog for Arduino. Planed to create one by myself, but now I can get it easier. Will implement for sure.

Overall project status:
- everything on a breadboard. Yes - it is very hairy :)
- LCD working, remote working, clock working, two temp probes working
- main program created and working for the above hardware.
- pH shield tested, but not implemented in the main program
- Ethernet board tested, but not implemented. SD card is part of the Ethernet board.

I am waiting for a bunch of parts from China, purchased through e-bay. Now I am going to focus in  organizing few modules that work and get the bread board less crowded.

A picture of "The ugly" is attached.
 

Boga

Active Member
Joined
Jan 12, 2012
Location
Dorchester, Ontario
KBennett link said:
......................
Use the arduino watchdog...
I got stuck. Did you implement something like this? Do you have a link or schematic? Is there a shield already built? Or needs to be created from a timer like 555?
 

KBennett

Member
Joined
Sep 17, 2012
Location
Brantford
http://tushev.org/articles/arduino/item/46-arduino-and-watchdog-timer

Honestly, I just recently added this to my code and it compiled. . . . I assume it works.

It's only 3 lines:

#include <avr/wdt.h>

in the setup:
wdt_enable(WDTO_2S)  // you can select different times...  I used 8 seconds in mine

And then at least once in your main code use
wdt_reset();

If you use delay timers or a lot of communication, you'll have to reset a few times in your code.

I'll test it out today.  I have a lightning function that takes longer than 8 seconds using for loops and delays.  Should trip it.
 

KBennett

Member
Joined
Sep 17, 2012
Location
Brantford
I spoke too soon:(

There is a problem with the mega 2560 bootloader and the watchdog timer.

The reset doesn't get cleared.  In order to fix it you have to reburn the boot loader.  This is a little beyond me right now and I don't want to screw it up (until I buy a spare mega 2560 to run my tank).

Check this out if you want to try it.  There is a link to the bootloader that you need.
http://www.desert-home.com/2012/05/arduino-mega2560-wrapping-up-bootloader.html
 

Boga

Active Member
Joined
Jan 12, 2012
Location
Dorchester, Ontario
Thank you very much KBennett for clarification.

Honestly my mind was set up on external hardware, then I saw the software, then issues with the bootloader, then some examples of external timers, discussions on various forums, etc. Overall I got confused and ..... ;D

I have to see now what is involved with reburn.
 

KBennett

Member
Joined
Sep 17, 2012
Location
Brantford
I tried it this morning.  I got an error.  Apparently I need to instal the usblib driver...  I gave up.

The bootloader doesn't seem difficult to use if it wasn't for that error.
 

KBennett

Member
Joined
Sep 17, 2012
Location
Brantford
Getting this to work on the Mega 2560 is ridiculous.  The bootloader doesn't want to talk to the arduino.
I've been screwing around with drivers all day.  I did find one reference to using a 100nF capacitor from 5V to the reset... I'll try that tomorrow.


The watchdog code works like a freaking charm on the Uno though. 
 

Boga

Active Member
Joined
Jan 12, 2012
Location
Dorchester, Ontario
KBennett link said:
Getting this to work on the Mega 2560 is ridiculous.  The bootloader doesn't want to talk to the arduino.
I've been screwing around with drivers all day.  I did find one reference to using a 100nF capacitor from 5V to the reset... I'll try that tomorrow.


The watchdog code works like a freaking charm on the Uno though. 

It looks that is little bit over my "qualifications" :) But I will try. What kind of Programmer are you using?
 

AdamS

Active Member
Joined
Oct 7, 2012
Location
London, Ontario
Something to consider... When you wire your receptacles to your relays, make sure some are fail on, and some are fail off. It's a minor detail with possibly big implications.
 

Boga

Active Member
Joined
Jan 12, 2012
Location
Dorchester, Ontario
AdamS link said:
Something to consider... When you wire your receptacles to your relays, make sure some are fail on, and some are fail off. It's a minor detail with possibly big implications.
Good point. Noted. I will review when close to finish to accommodate programing to relay NO/NC positions. Thanks.
 

KBennett

Member
Joined
Sep 17, 2012
Location
Brantford
What are you using to house all your stuff?  Ive got an electrical box from work, but it is too small.  I'm thinking of putting everything in a old computer tower.
 

Boga

Active Member
Joined
Jan 12, 2012
Location
Dorchester, Ontario
For controller I bought an external drive enclosure from a local surplus store. I got it for $5 and I hope I can fit everything in it. I have to leave the main power supply as an wall adapter (12V). I am going to mount it as shown in picture and make end faces from some plastic sheets or acrylic.

For power bars  (including relays) I am planning to make them from some plastic sheets. Did not find anything yet, but looking for some kind of ABS or PVC sheets that can be cut, routed, drilled, etc.

At one point I was looking for the smalls computer cases, I think they are called micro ATX or so.
 
Top