Summer Project: Open source aquarium controller. - The Planted Tank Forum
Reply
 
LinkBack Thread Tools Display Modes
post #1 of 25 (permalink) Old 03-27-2011, 05:14 AM Thread Starter
Algae Grower
 
PTrader: (0/0%)
Join Date: Sep 2010
Location: Indiana
Posts: 7
Summer Project: Open source aquarium controller.

Hello,
My name is Paul and I am fairly new to this community. I currently am running a 75g planted tank with some DIY hardware and it is going well. However, I am looking into designing a micro-controller based control unit for aquariums. This summer I will probably have some time to devote to this project as I know it will be very time consuming.
The basic idea behind this project is to design a controller with a primitive graphic interface that will allow the user to set inputs and outputs for full control of a planted tank. I am thinking along the lines of parasitical dosing, lights, filters, heat, ph, etc... The micro will be able to be set up so that it can use incoming data from various sensors or equipment in order to control that very equipment and/or other equipment.
I have experience with circuit design, pcb layout, and micro-controller programming so this is something that I can complete and will find fun and entertaining, as well as a learning experience.
I am looking for input on what sort of peripherals this this device should control/read from. I have the basic idea of a device that controls x 120v solid state relays, receives input from level sensors etc and keeps time via the 60Hz signal from line voltage. If things go well and I may decide to integrate usb connectivity to this with a VB interface for your PC.
As should be obvious this design project is in its infancy but with thought out input from people in this community I think that it has the potential to develop into something very useful.
I plan on doing this as an "open hardware" project so that the schematics and code are all available to the public. I do not really know if there is any sort of demand for this sort of device in the aquarium community but this may be the starting point for other open source projects. Perhaps we can make a considerable dent in the very expensive aquarium products market. Who knows. Regardless, I would like input from people who are DIY'ers and those that are involved in engineering so that I have substantial input to work with.
Please withhold any comments like "it should control my lights." If you get my drift.
ivantc is offline  
Sponsored Links
Advertisement
 
post #2 of 25 (permalink) Old 03-27-2011, 06:09 AM
Planted Tank Guru
 
xmas_one's Avatar
 
PTrader: (18/100%)
Join Date: Feb 2010
Location: Oregon
Posts: 3,402
xmas_one is offline  
post #3 of 25 (permalink) Old 03-27-2011, 01:59 PM
Algae Grower
 
PTrader: (11/100%)
Join Date: Apr 2009
Location: Laurel, MD
Posts: 66
This sounds extremely interesting. I have subscribed... and would be willing to put myself on a list of volunteers to help design/debug if you need it.

And definitely dig the Arduino system Xmas_one shared... seems like a perfect platform. I know I have seen this mentioned on various Maker sites and I think Lifehacker. All very positive reviews. And it doesnt look to be that expensive either.

Looking forward to seeing more!

Jason
JasonC is offline  
 
post #4 of 25 (permalink) Old 03-27-2011, 02:14 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Feb 2010
Location: College Station, TX
Posts: 73
Im doing the same thing. Have you located a suitable and interfaceable ph probe? If so please share, that seems to be a chalange. What kind of filter are you using? Have you thought about where the water will be going after power loss and if the filter can re-prime itself when power is re applied?

I planned on using a stepper motor in a peristaltic design for dosing control.
Arctangent is offline  
post #5 of 25 (permalink) Old 03-27-2011, 03:08 PM
Planted Tank Guru
 
DarkCobra's Avatar
 
PTrader: (5/100%)
Join Date: Jun 2004
Location: Baton Rouge, LA
Posts: 3,350
Obviously any controller should be capable of switching AC devices on and off.

But here's a twist. Measure the current on the AC device, via an Allegro hall-effect current sensor IC or similar.

Allow the user to view the current, and to program in a minimum/maximum current range for the device. If the device's current strays outside of that range for more than a minute, sound an alarm.

Since the current through a motor is dependent on the mechanical load being driven, this will be able to detect if a filter's impeller is stuck. And though I haven't tested this yet, if you set the limits tightly enough, it might even be able to detect when the filter media is becoming clogged and needs cleaning.
DarkCobra is offline  
post #6 of 25 (permalink) Old 03-27-2011, 04:13 PM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
Well, the impeller is driven by a electro magnet switching from side to side. It's not a physical motor with gears and such. So the current I would assume is constant whether the impeller is stuck or not, that is the impeller is not physically attached to the motor.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mistergreen is offline  
post #7 of 25 (permalink) Old 03-27-2011, 04:32 PM Thread Starter
Algae Grower
 
PTrader: (0/0%)
Join Date: Sep 2010
Location: Indiana
Posts: 7
OK,
I will consider arduino but I really like to do things in good ol' C. I have looked at some of the controllers out there and a few of them consist of an adruino board with a breadboard and wires everywhere. I would like to go with an actual pcb board populated with the necessary components. I suppose this can get in the way of flexibility but I admire a really solid unit over a patch-together any day.
As I said I will have more time for this project in the summer. However, as many suggestions as I can get will be appreciated.
-DarkCobra-- Current sensing integration sounds like a good idea. My only concern is that you ultimately have to make this somewhat idiot proof, so setting the "limits tightly enough" could be a near impossible task for the not so inclined. Not that this is not a good idea but we will have to flush it out a bit more.
-Arctangent-- Have you looked into any 4-20mA stuff? You will find a lot of industrial equipment that operates on that interface.

I started a Google group: http://groups.google.com/group/OHAQ
It is invite only, I figure we can keep this thread going for general suggestions and input. However, for the guts of the project I would like to choose a core team of developers. The group is open to the public for reading/viewing; however, you will have to be invited to be a developer.
If you are interested in being a developer please send me a PM with a little about you, your experience in hardware/software design, and any other information or experience that you think would be helpful towards making this idea a reality.

I am very busy so I will give this project as much time as I can afford. If you do not hear back from me immediately please be patient.
ivantc is offline  
post #8 of 25 (permalink) Old 03-27-2011, 08:28 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Jan 2011
Location: NJ
Posts: 21
Love the concept. I have been working with Lego Mindstorms ... although it is built for mobile robots I am in awe of the applications one can put it use for. Take a look at Technics while you are at it ... lots of 3rd party sensors can be built to interface with the Mindstorms' CPU.
discuscraze is offline  
post #9 of 25 (permalink) Old 03-27-2011, 09:00 PM
Planted Tank Guru
 
DarkCobra's Avatar
 
PTrader: (5/100%)
Join Date: Jun 2004
Location: Baton Rouge, LA
Posts: 3,350
Quote:
Originally Posted by mistergreen View Post
Well, the impeller is driven by a electro magnet switching from side to side. It's not a physical motor with gears and such. So the current I would assume is constant whether the impeller is stuck or not, that is the impeller is not physically attached to the motor.
Think back EMF. The impeller is a permanent magnet, and when turning, also induces a current in the electromagnet. That is enough to determine whether the impeller is turning or not.

Since it's a synchronous speed motor, when turning, the impeller only turns at one speed regardless of load. But extra load (clogged filter) may be enough to change the lag angle of the impeller enough relative to the AC field to be detectable by average current, or voltage/current phase analysis. That's the part I'm not yet certain on.
DarkCobra is offline  
post #10 of 25 (permalink) Old 03-28-2011, 03:40 AM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
Quote:
Originally Posted by DarkCobra View Post
Think back EMF. The impeller is a permanent magnet, and when turning, also induces a current in the electromagnet. That is enough to determine whether the impeller is turning or not.

Since it's a synchronous speed motor, when turning, the impeller only turns at one speed regardless of load. But extra load (clogged filter) may be enough to change the lag angle of the impeller enough relative to the AC field to be detectable by average current, or voltage/current phase analysis. That's the part I'm not yet certain on.
Are you thinking reading the magnetic field generated from the motor&impeller or reading the current from the electrical line?

Well, back to the OP's topic. I'm pretty proficient with arduino so if you have any questions, ask away. You can write C libraries for the arduino if you are really gung-ho about it. Most of us try to avoid writing C Arduino's environment lanuage runs on top of C but makes it very user friendly with a simple basic language.

I'm learning objective C right now... wow... not fun but much better than C.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mistergreen is offline  
post #11 of 25 (permalink) Old 03-28-2011, 06:06 AM
Planted Tank Guru
 
DarkCobra's Avatar
 
PTrader: (5/100%)
Join Date: Jun 2004
Location: Baton Rouge, LA
Posts: 3,350
Quote:
Originally Posted by ivantc View Post
-DarkCobra-- Current sensing integration sounds like a good idea. My only concern is that you ultimately have to make this somewhat idiot proof, so setting the "limits tightly enough" could be a near impossible task for the not so inclined. Not that this is not a good idea but we will have to flush it out a bit more.
You have a point that not everyone would be able to choose appropriate limits to correctly detect faults. But the people interested in something like this are going to be fairly adept. I wouldn't have it enabled by default unless the user opts to turn it on. It would make for a very cool and unique feature; something to distinguish this from other controllers, commercial or open source.
DarkCobra is offline  
post #12 of 25 (permalink) Old 03-28-2011, 06:22 AM
Planted Tank Guru
 
DarkCobra's Avatar
 
PTrader: (5/100%)
Join Date: Jun 2004
Location: Baton Rouge, LA
Posts: 3,350
Quote:
Originally Posted by mistergreen View Post
Are you thinking reading the magnetic field generated from the motor&impeller or reading the current from the electrical line?
The current on the electrical line. Which is directly affected by the magnetic fields, because a spinning motor simultaneously operates as a generator.

I just went to put my Kill-A-Watt meter on an Aquaclear Mini, intending to jam it and gather some real world numbers. Ironically, I found it already jammed.

With the impeller jammed, current draw was 100ma.

After clearing the jam, current dropped to 70ma.

Neat, huh?

It may have been jammed for hours, and had I not gone to run this test, I might not have noticed it until tomorrow.

But if I'd had a current sensor alarm on this, I would have known about the jam immediately when it occurred.
DarkCobra is offline  
post #13 of 25 (permalink) Old 03-28-2011, 01:50 PM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
neat.... now will this current change be consistent in different filters or do you need to calibrate the code depending on the filter?

btw. How do you measure current without accidentally blowing a fuse in your meter?


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mistergreen is offline  
post #14 of 25 (permalink) Old 03-28-2011, 02:37 PM
Planted Tank Guru
 
DarkCobra's Avatar
 
PTrader: (5/100%)
Join Date: Jun 2004
Location: Baton Rouge, LA
Posts: 3,350
Quote:
Originally Posted by mistergreen View Post
neat.... now will this current change be consistent in different filters or do you need to calibrate the code depending on the filter?
I was hoping to make my own controller, but it keeps getting pushed back. So I haven't extensively tested how different filters behave. I know my Magnum 350 and Aquaclear 70 both show similar behavior, but didn't record numbers.

Personally, I wouldn't get fancy with it by putting in any kind of calibration, that may or may not work in any particular case. Allow the user to view the current consumption, so they can get a baseline value when the filter is operating normally. Allow the user to turn on current monitoring, and program in an upper and lower current limit. I would suggest +/- 20% as a good starting point, but leave that entirely up to the user.

By making it both simple and flexible, it reduces developer effort, and users may find other uses for the feature that we haven't thought of.

Another feature that isn't too hard would be to add the option to power cycle the device at five second intervals a few times before sounding the alarm. That sometimes frees a jammed impeller with no user intervention.

Detecting media clogging would require some sophisticated code and I'm not sure if it's practical or possible; I just haven't had time to look into it yet. Since this is an open source project, people could experiment with that later. Other than the current sensor for each monitored outlet, the only additional hardware feature required to explore this is a way for the MCU to monitor the AC voltage waveform (one per controller, not per outlet). Easy to implement and might be useful for other things too.

Quote:
Originally Posted by mistergreen View Post
btw. How do you measure current without accidentally blowing a fuse in your meter?
LOL! Unlike measuring voltage, you cannot just connect one lead to hot and the other to neutral. That will measure the maximum amps the outlet is capable of supplying, since in current measurement mode the meter is a short circuit. Don't feel bad, it's a common mistake and I frequently buy new meters at work because people try this.

Instead, you have to break one of the connections, either hot or neutral, and use the meter to bridge the break; with the meter on the appropriate setting and the red lead plugged into the 10A (or similar) socket on the meter. Obviously this requires some sort of rig, since you normally don't want to cut one of the wires on the cord of the actual device being tested. A short extension cord with one of the wires cut in the middle, and both ends stripped and exposed, can be used. Just make sure no one else tries to use it as a regular extension cord, and don't come in contact with the exposed wires while you're testing.

A $20 Kill-A-Watt meter makes this foolproof. You just plug it into the wall, and plug the device into it:



It comes in handy, and has some extra measurement modes not found on a typical multimeter. In aquarium use, I've also used it to determine approximately how much power a ballast is actually pushing through a mismatched fluorescent bulb, like in ODNO setups. Also very nice for tweaking power settings on computers to see how they reduce consumption.
DarkCobra is offline  
post #15 of 25 (permalink) Old 03-28-2011, 10:59 PM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
heh, nice... I wasn't completely crazy. I only tried to measure my little 5V 500mA arduino. Puff! I had to go out and buy a new fuse.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mistergreen is offline  
Reply

Tags
None

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome