PDA

View Full Version : PLC Fish Tank Controller Project


Squiddy
12-11-2006, 02:02 AM
Well, I have finally found the time to get working on my fish tank controller project again. Having an electronics background, I have always wanted my own fish tank controller and couldn't be bothered to go out and spend the money on a prebuilt system. The idea when I first started on this adventure, was to build the system from scratch. I would design and build the circuit boards, write the embedded software for the controller and come up with some kind of interface that will work on a PC. Other people have done this kind of thing already and although I still plan to in the future, I went with something that required a bit less hardware design to start.

For this project, I decided to use a PLC (Programmable Logic Controller) as the base for the system. The PLC I chose is made by Modicon and has 12 digital outputs (means I can turn 12 devices on and off) and 16 digital inputs (allows me to monitor the status of 16 devices). This PLC also has a number of analog inputs which allow me to monitor things like temperature, PH and ORP which I will be taking advantage of in the future. I have bought a PH probe already and just need to build a quick amplifier circuit to make it compatible with the PLC.

Here is a quick idea of how I connected everything up:

Each digital ouput is connected to a relay. When the output is turned on, the relay attached to that output gets energized. When the type of relay I chose to use gets energized, it means its contacts close, just like a switch being turned on. I wired the line voltage (115VAC) to one side of each relay and then wired one receptacle to the other side. The end result is 12 receptacles that can be turned on and off by the PLC.

The black box with the white dial in the bottom right of the fourth picture is an Intermatic timer. I have wired this into one of the digital inputs so that I will be able to use it later for whatever I want. For example, I could write some logic that uses the timer to shut off my main pump for a certain period of time while my fish eat. The possiblilities are endless. I have a number of float switches that will be connected in to some of the other inputs. In the logic, I will be using these to monitor water levels in the display in the sump. If the water level gets too high in the display, shut off the main pump.. etc. You get the idea.

Obviously I'm not done yet. I managed to get all of what you see here, done in the last couple of days. I was lucky to get the gray box you see for free but it sure made the wiring tight! I managed to make it all fit though. The box didn't come with a lid so I will be cutting a piece of plexiglass to fit over the top. This way, while keeping the salt spray out of the electronics, I will be able to open my stand and check the status of everything.

If I don't feel like looking at the controller itself to see how things are running, all I have to do is turn on my laptop and load up the interface I built in LabView. The picture you see here is what I made a few months back. While I have tested and it works quite well, I will need to change things around a bit. I will post the updates as I make them.

Anyways, I'm not sure if any of this made sense but I just wanted to post what I had so far so that I could add posts here and there as I went along instead of typing out the whole thing in one sitting.

http://members.shaw.ca/alanwarren/controller/2.jpg

http://members.shaw.ca/alanwarren/controller/3.jpg

http://members.shaw.ca/alanwarren/controller/1.jpg

http://members.shaw.ca/alanwarren/controller/5.jpg

http://members.shaw.ca/alanwarren/controller/7.jpg

http://members.shaw.ca/alanwarren/controller/6.jpg

BMW Rider
12-11-2006, 02:11 AM
:shocked!: :crazyeye:

Wow! Just a bit beyond my basic wiring skills.

niloc16
12-11-2006, 02:19 AM
squiddy this is awesome. unreal wiring in the box. very neat and tidy. most definitely keep us updated. good job

Dale
12-11-2006, 04:30 AM
I don't know... don't see any black electrician tape in there...


Hah! just kidding. Looks awesome. I admire someone who can understand electronics like that. A skill I wish I had picked up (along with welding).
I utilize technology but I don't really understand it.

Delphinus
12-11-2006, 05:35 AM
Looks great. To be honest I'm sort of surprised we don't see more of this ou there. If I could get my hands on a decent PLC one day I might try this as well (I work with PLC's as well).

Anyhow good on ya' for actually getting it done. :)

cinci
12-11-2006, 02:25 PM
i have a plc 5/60 as well as a slc processor and rack. i planned to do this as well and have it connected to a panelview 550 for control and display. the one thing that was holding me back was the connection of the probes. if you get a circuit working please let me know. i would love to get mine going.
thanks.

Squiddy
12-11-2006, 02:50 PM
Thanks guys. I love doing this kind of thing. It's going to be even more fun designing a controller from scratch I think.

If you look on ebay, there are a number of PLCs available at fairly reasonable prices... considering what they're worth. The one I used was an old one from work. Served its purpose controlling a water treatment plant for years, and now gets turned into a fish tank controller.

You don't even need anything that amazing to do this. It's not like you're running a paper mill or something that requires millisecond response time.

cinci: I would love to add a touch panel to the outside of my stand. One of the guys at work is working with a tiny 4-5" Magelis panel from Telemecanique. It would be PERFECT! The $2500 price tag is not so cool though... There are actually a few of those PanelView 550's on ebay right now... one that is at $9.99. Do you happen to have a surplus of these? :mrgreen:

I'm going to try and get some plexi cut for the front of the box and then I can get it mounted up in the stand.

I'm going to use a couple of these to monitor level in my display and sump. The forks on these things vibrate, so when they are immersed in a liquid, the device senses a dampening in vibratation and turns a contact on. I can use this contact as a condition for the main pump in the logic. If the level in the display gets too high, shut off the main pump and sound alarm/flash light/do something.

http://members.shaw.ca/jeremywarren/FTL20.jpg

cinci
12-12-2006, 04:07 AM
sorry no extras. i know awhile back i was doing some work with rsview connected to a plc. it can do more than a panelview. if you used a usb touch screen (ebay) i think you could have some cool looking control panel. a problem with some of the old plc stuff is the comunication to the processor. we are starting to switch over to control logix its nice it uses ip for everything. are you planning on using a analog input card for you probes?

Midknight
12-12-2006, 04:08 PM
And when are you coming over to Vancouver to run a DIY seminar on how to do all this? :robot:
I'd be there in a heart beat (or 2, getting slow in my old age):lol:

Squiddy
12-12-2006, 10:15 PM
cinci: Aww too bad about the displays. I'm sure I can find something. This PLC actually has a number of analog in's already so I'll just use those. Haven't got that part worked out yet though. I actually have a pressure transducer that I might use somewhere. The sensor I have is 0-5psi which is about 0-12ft. I think the analog in's are 12 bit which means 341 counts per foot. If I use one in my sump, 1 foot would be all that the level would change anyways so I would still have 341 points of resolution. I think it would be kinda fun to have a graph showing sump level. Then I could graph it next to humidity and temperature and get a good idea of where the water's going or the moisture is coming from :redface:. I'll get the rest sorted out first though :biggrin:. I could also stick a pressure transducer in my mixing bin to show how much water I have left. Too many ideas. I need my own house...

Midknight: Ha, yea right. Don't know about a seminar. If you're over this way you could come take a look. I'm sure if you wanted to do something like this I could point you in the right direction. I like doing this over buying a predesigned controller because I can make this one do whatever I want it to.

Here I am spending all this time on what controls the tank and what I really need to be doing is stocking the tank with more corals. My rocks are looking a little bare.

cinci
12-13-2006, 04:02 AM
i started working on lighting program to simulate the lenght of day light at the great barrier reef. never did finish it. there is alot you can do
i picked up a bunch of float switches and planned to use them in series in case one failed. two for high and two for low.
both would shut the pumps down or sound an alarm. my master plan was to have an automated water change. just push a button.
i haven't really found a cost effective way of doing ph or orp. i wanted to graph as well. i see some of the newer controlers now offer some of these features. i just like the fact that you can program the inputs and outputs yourself you can add alot of safety. i always get as kick out of people who post stories about how there auto topoff float switch stuck and nuked their tank, with a plc you could program the lenght of time the pump runs before the float switch should make if it didn't shut if off set an alarm.

banditpowdercoat
01-15-2009, 04:15 AM
Just picked up a SLC 5/02 processor and chassis. couple of I/O cards and a Analog module. just tryint to gather software. Damn Rockwell for changing the licencing protocols.

Delphinus
01-15-2009, 05:58 AM
Sweet find. I'd love to one day go scrounging for a slick-5. Fun little units!

I could sell you a SCADA system for it. :lol:

brizzo
01-15-2009, 03:56 PM
I've been working on a low-cost controller system using the arduino platform. In the next couple months when I have time to polish the software I'll share it :)

So far I've implemented pH, Temperature, and X10 outlet controls. Lots of work to do still, and I would also like to find a more solid solution for controlling outlets. :mrgreen:

Vancouver Reefer
03-09-2009, 09:24 PM
Hi all,

Here is a link to my Arduino based tank controller im in the process in building for my BC29:

http://richardorme1979.googlepages.com/home

Jeremy,

What program did you use to design your GUI screen for use with your PLC?

VR

Fenix
03-09-2009, 10:09 PM
Sweet find. I'd love to one day go scrounging for a slick-5. Fun little units!

I could sell you a SCADA system for it. :lol:

haha SCADA exactly what i was thinking. Delphinus do you work in SCADA?

THe only thing missing is flow rate, which can be easily added with your analog points.

I always wanted to do someting like this but my tank is just way to small to even begin to automate.

BC564
03-09-2009, 10:49 PM
I am slowly getting the parts together to do something similiar...only im using a SLC 5/05...Panelview Plus 600...... computer.... its all wireless ethernet.....complete with online camera....I can even access the system from my PDA.....but this is also controlling certain parts of my house.....A/C and heating......out door lighting....and whatever else I think I need..... oh..I will be using Intellution ifix for the Scada HMI. and Panelbuilder 32 for the panelview. Using these just because that is what I have kicking around.

brizzo
03-09-2009, 11:18 PM
Hi all,

Here is a link to my Arduino based tank controller im in the process in building for my BC29:

http://richardorme1979.googlepages.com/home

Jeremy,

What program did you use to design your GUI screen for use with your PLC?

VR

First of all, Welcome to CanReef !!

That's awesome work Jeremy! You've gotten much more progress than I have. Too many projects and so little time.

I finally got in some solid state relays, along with outlets and override switches. I've been devising a plan to build a DIY dosing pump system for balling method :)

There's a few other guys on RC who have been working on the same stuff here (http://www.reefcentral.com/forums/showthread.php?s=&threadid=1582015). And also setup a wiki site here (http://reefprojects.com/wiki/Main_Page).

Gizmo
03-09-2009, 11:50 PM
Check out http://www.phidgets.com/
I'm using these babies for both control and input from sensors.
Easily programmable in Flash (thats what i'm using) or c++ or any language really. They use USB connections to talk to the puter, and you can get your interface to work over the network as well.

banditpowdercoat
03-10-2009, 02:00 AM
Hi all,

Here is a link to my Arduino based tank controller im in the process in building for my BC29:

http://richardorme1979.googlepages.com/home

Jeremy,

What program did you use to design your GUI screen for use with your PLC?

VR

Where did you get your LED's from? and how well do they work?

Vancouver Reefer
03-11-2009, 11:43 PM
Where did you get your LED's from? and how well do they work?

Hey Bandit,

I have not purchased the LEDs yet but they are in the pipeline.

For all the information you could ever want Evilc66 has been doing some serious research on these over on Nano-reef.com.

Have a read and all will become clear!!

http://www.nano-reef.com/forums/index.php?showtopic=186982

Most of the guys are buying the Buck Puck LED drivers from LEDsupply.com
and then several places world wide for the LED's

Enjoy the read.

VR

spreerider
03-13-2009, 07:26 AM
I have a Mitsubishi Melsec A1S with 32 in and 32 out, 2 analogs and rs232.
i just got laid off and was about to start setting it up maybe next week.