Aquarium controller

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
Ben Van Aken
Posts: 8
Joined: Wed Nov 25, 2009 11:04 am

Aquarium controller

Post by Ben Van Aken »

Hellow,

I'd like to build my own aquarium controller, but it's WAY complicated :roll:. But makes much sense too me. I'd like to work with a CAN-bus system to make the system more compatible so i could be able to add more in the future and expanded the possibility's. The drawing I posted here is a schematic of how i'd like to build it.

A few things you might need to know before you start reading :
- If you think a lot is alike well your right :P
- I'm a non native english speaker nor writer when words are placed between "....." then I don't know if I used the correct word that would fit, but I hope you will get what i mean by understanding it with the "context".

Main controller :
On the front side of the controller there would be an touch screen(I know this isn't possible yet with E-blocks but I'll probably program this is VB or C++)
What it has to do :
- With that touch screen you will be able to set all the variables off the program (But it will only be possible for the modules that are connected).
- When you want to change your variables you will need to swing an RF-ID card in front of the receiver to unlock this mode, this because we don't want kids to just start pushing buttons do we :mrgreen: (this mode will be call programming mode further on). You will need to lock this again by showing your RF-ID in front of the receiver or when time runs out.
- The controller will receive all variables of the sensors and when not in programming mode it will print them on the screen.
- It will also need to act on some variables to switch relays(All will be relays I think, with the expansion it might change).

A lot of other things that the Main controller will need to do will be place with the correct sensors.
This to make it easier to comprehend

PH-module
This will be a small PICmicro with 3ports.
- CAN-bus card
- Sensor interface card
- Switches
What it has to do :
- The sensor will need to be read and send with the CAN-bus to the Main Controller
- The switches are will serve for recalibration. This will also be possible on the Main controller.

Temperature-module
This will be a small PICmicro with 3ports.
- CAN-bus card
- Sensor interface card
- Switches
What it has to do :
- The sensor will need to be read and send with the CAN-bus to the Main Controller
- The switches are will serve for recalibration. This will also be possible on the Main controller.

Conductivity-module
This will be a small PICmicro with 3ports.
- CAN-bus card
- Sensor interface card
- Switches
What it has to do :
- The sensor will need to be read and send with the CAN-bus to the Main Controller
- The switches are will serve for recalibration. This will also be possible on the Main controller.

Oxygen-module(This is the dissolved oxygen probe
This will be a small PICmicro with 3ports.
- CAN-bus card
- Sensor interface card
- Switches
What it has to do :
- The sensor will need to be read and send with the CAN-bus to the Main Controller
- The switches are will serve for recalibration. This will also be possible on the Main controller.
- There is an option to buy a barometer, this could be taken in to account when calculating the correct "oxygen saturation".

Water level-module
This will be a small PICmicro with 2ports.
- CAN-bus card
- 4 water-level sensors will be connected to this port.
What it has to do :
- The sensors will need to be read and send with the CAN-bus to the Main Controller
- When the lowest sensor in the aquarium says it doesn't "feel" water it will need to refill till it reaches this sensor, when this sensor fail's there will be a second higher one to stop the refilling of the aquarium to happen.
- The water comes from a reservoir that is filled with osmoses water, here the same program should be in place to keep the reservoir from overflowing. Here we don't stop a pump but a valve that is connected to the "water grid".

Salinity-module
This will be a small PICmicro with 3ports
- CAN-bus card
- Sensor interface card
- Switches
What it has to do :
- The sensor will need to be read and send with the CAN-bus to the Main Controller
- The switches are will serve for recalibration. This will also be possible on the Main controller.
- There are 2 options when the salinity drops below a certain level that can be set on the Main controller
* When there isn't a Water change-module it will give an alarm, this also has 2 possibility's
+ A sound alarm
+ A sms to the owner with the sms module if this is in place
* When there is a water change module, the Main controller will do a water change with the correct amount of salt in the water that it is going to change.

Water change-module
This will be a small PICmicro with 4ports
- CAN-bus card
- Sensor interface card
- 4 water-level sensor
- Switches
What it has to do :
- When does it need to happen???
+ When the salinity has reached a critical high or low level
+ When there need's to be a weekly/monthy water change(The time interval can be completely set on what date on the Main controller)
+ When the nitrate level reaches a sertain high value (5-20ppm)
+ When the amonium level reaches a sertain high value (..-..ppm)
+ When there is no Calcium-reactor-module or calcium is add true the dosing module and the calcium level in the tank drops under ...ppt
How does it need to happen.
1. Prepare the water that will be used to do the waterchange.
+ Fill the tank with osmoses water
+ Measure the salinity of the osmoses water(will be 0 on the first waterchange but will be more on the next because you can't drain all the water from the tank)
+ With a precise machine to add the synthetic salt in the right quantity. This until it reaches 35ppt
2. Stop the main pump from the sump(filter) to the aquarium
3. you will need to empty the measuring reservoir to the drain. (this only gets done when there is effectively going to be a waterchange, this because when we would empty the measuring tank before water that could evaporate in between water changes and this will result in a higher volume that will be taken out of the aqurium then there will be put in to the aquarium) The tank wont be fully drained, only till the lowest water-level sensor.
4. Pump the water from the sump to the measuring reservoir untill it reaches the highest sensor.
5. Pump the water from the water change reservoir till the lowest sensor in that reservoir.
6. Put on the main pump of the aquarium.
Some of these stept can be taken at the same time.
At all times there will be a small circulation pump running this because water that is standing still will become dead water, this ain't no pleasure to have this in your house :twisted:. But these will be switched off during pumping OUT of the tank. In won't be a problem.

Calcium reactor-module
This will be a small PICmicro with 4ports
- CAN-bus card
- Sensor interface card
- Sensor interface card
- Switches
What it has to do :
When the PH drops below ..,..(e.g. 6.3) no more CO2 needs to be added but when the PH is ..,..(e.g. 6.4) or more CO2 needs to be added to the calcium reactor.
By trial and error there will be formed a formula that will regulate the calcium that is added to the aquarium water and this will be used to controle a dosing pump to give the right amount of CA saturated water to the aquarium. This so the amount in the aquarium stays between 410 and 440.

Barometer-module
This will be a small PICmicro with 3ports.
- CAN-bus card
- Sensor interface card
- Switches
What it has to do :
- The sensor will need to be read and send with the CAN-bus to the Main Controller
- The switches are will serve for recalibration. This will also be possible on the Main controller.

Nitrate-module
This will be a small PICmicro with 3ports.
- CAN-bus card
- Sensor interface card
- Switches
What it has to do :
- The sensor will need to be read and send with the CAN-bus to the Main Controller
- Give and Alarm(sound or SMS) when above ...ppt
- The switches are will serve for recalibration. This will also be possible on the Main controller.

Ammonium-module
This will be a small PICmicro with 3ports.
- CAN-bus card
- Sensor interface card
- Switches
What it has to do :
- The sensor will need to be read and send with the CAN-bus to the Main Controller
- Give and Alarm(sound or SMS) when above ...ppt
- The switches are will serve for recalibration. This will also be possible on the Main controller.

Plug-module
This will be a PICmicro with 7ports(16F946)
- CAN-bus card
- Switches(4)
- 8 plug that will be switched on by a pulse
- 8 plug that will be switched on by a pulse
- 8 plug that will be switched on by a pulse
- 8 plug that will be switched on by a pulse
- 8 plug that will be switched on by a pulse
What it has to do :
- When necessary a plug will be switched on by a pulse on the right ports exit.
- The plugs can be tested 1 by 1 with the switches.
- On the plug itself there will also be a button to make it switch. This for easy maintenance of pumps, light bulb switching and so on.
- On ..-plugs it will be possible to place lightning that will be switched on from xx:xx till xx:xx. These relais that will switch on and off, have a
maximum load of 2300W

Dosing-module
This will be a small PICmicro with 3 ports
- CAN-bus card
- Switches(8)
- 8 dosing pumps that will be put on by a relais. probably the same electrical wiring of the plugs.
What it has to do :
- Needs to be switched on by the main controller. This a preset amount devided true the day. Value's will be in milliliters.
- There is a time limit set in place in this PIC controller this to see that there isn't going to happen an overdose to the tank
- With the switches you will be able to add manually to the system, also possible with the main controller

Reading-module
This will be 2 small PICmicro with 2 ports
- CAN-bus card
- Zigbee card R
- Zigbee card C
- Graphical LCD touch screen
What it has to do :
This device will be a special add-on this will have the possibility to see the value's of your aquarium on a separate screen. Because it is always unknown where it is going to be place I used the zigbee board to make it wireless. So it can be place a bigger distance from the aquarium. Only power is needed. This means i have 2 PICmicro's 1 as a sender and 1 as reciever. You will only be able to read the value's, it isn't a second controller, though it would be interesting :roll: but way to expensive and complex having 2 place where you can change those values.

Voltage-module
This will be a small PICmicro with 3 ports
- CAN-bus card
- Sensor interface card
- Switches
What it has to do :
When there is a power cut a generator will be turned on to supply power to the aquarium(believe me these things already exist and are EXPENSIVE, don't think i'm a fanatic :roll: , okΓ© I am :P .
When there is a powercut only your aquarium will run on the generator but you will need to cut off the electric grid so you don't supply them with free of charge energy :mrgreen: , they like it but please don't :P . So a relay (big version here in dutch called contactor but no translation on google translator) will cut the aquarium from the main lines and when the generator is working switch on for 5sec the aquarium electrics get connected to the generator. Why wait because when the generator start the frequency goes from 0-->50Hz, this might be bad for the electronic components not to speak from ballast of metal halide's.

SMS-module
This will be a small PICmicro with 3 ports
This I have no idea what it would be, I'm going to order the course
http://www.matrixmultimedia.com/product ... PHPSESSID=
this to learn how it works and if I can use this, the answer here will be yes probably.
What it has to do :
When any sensor gives a abnormal reading for longer then x time a sms will be send to the cell-phone.
The other way around is possible to, you send a text message and the module will send you the values of your aquarium.

PC logging-module
This will be a small PICmicro with 2 ports
- CAN-bus card
- USB interface board
What it has to do :
Send the values of your aquarium to your PC so they are stored and can be viewed in a program.

RFID-module
This will be a small PICmicro with 2 ports
- CAN-bus card
- RFID board
What it has to do :
when the card is read by this module it will give a signal to the main controller that the menu to set your value's can be accessed and changed.
If not shown you can still access the value's but not change, this to check what is your minimum and maximum that is set. This way you don't need the RFID-card to check if your value's are still correct.

This is it. Maybe more add-ons will come but I doubt it, this is a lot of work already :mrgreen:7

My problem is that i wouldn't even know how to use the CAN-bus system(macro's) but I'm going to buy the CAN training solution. But then still can you send INT across a CAN??? I hope so otherwise I'm screwed :P

If someone doesn't understand what has to happen and needs some visualisation drawings, no problem I can make them for you just ask

Thanks in advance

Greetings

Ben
Attachments
Drawing1-Model.jpg
(203.56 KiB) Downloaded 2177 times

Ben Van Aken
Posts: 8
Joined: Wed Nov 25, 2009 11:04 am

Re: Aquarium controller

Post by Ben Van Aken »

Maybe I need an embedded engineer :roll:

Greetings

Ben

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Aquarium controller

Post by Benj »

My problem is that i wouldn't even know how to use the CAN-bus system(macro's) but I'm going to buy the CAN training solution. But then still can you send INT across a CAN??? I hope so otherwise I'm screwed
Hi Ben

The CAN bus trainer will help you to get to grips with the way the CAN bus system works. Basically you send an 11 bit identifier and then up to 8 data bytes. You can manipulate the data so that your ints are chopped up into two bytes. Eg so you can then send up to 4 Ints per transaction.

Ben Van Aken
Posts: 8
Joined: Wed Nov 25, 2009 11:04 am

Re: Aquarium controller

Post by Ben Van Aken »

Thanks

I've called up on some help from Jack Kersing(one of the embedded engineers). It will be easyer this way because he speaks dutch. My technical english is still more then rusty :mrgreen: , but i'm working on it.

Thanks

Ben

KeithSloan
Posts: 114
Joined: Fri Jul 27, 2007 10:50 am
Been thanked: 1 time

Re: Aquarium controller

Post by KeithSloan »

Interest project.

Have you managed to source all the sensors you are going to need. Would be interesting to others to document where you get them from

Ben Van Aken
Posts: 8
Joined: Wed Nov 25, 2009 11:04 am

Re: Aquarium controller

Post by Ben Van Aken »

All sensors are available here on Matrix Multimedia website or any off there distributors in your own country, I'm still looking to find other dealers to cut down the price of the complete system. To be honest, the PH module is quite expensive, if i'm right it's a plastic probe and for less you can buy a glass probe. But anyone is free to ask what he wants but I will buy 2(Need to) to build the mock up.

Meeting Jack Kersing in 3-4weeks, a great embedded engineer, I send him a e-mail and really has a great way to spot problem from the very start. If a prototype is build, pictures will be posted I hope if I remember. The real deal will probably be for late this year, more or less at the beginning of next year. Europe will be for the year 2011, international 2012.

Atleast one company that looks a bit happy to the future.

Greetings

Ben

Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times

Re: Aquarium controller

Post by Steve001 »

Hi,

Just read the above seams a very interesting project and would like to know how you get on.

one comment if i may on your voltage module - ( Based upon uk regs )

UNDER NO Circumstances must your generator and mains supply be in paralell at any time
you have to seek permission to do this and have very specialised proctection relays and equipment
(very expensive) the contactors are required to be mechanically interlocked and electrically interlocked
as to prevent this happening,

Also bear in mind that electricity boards reclose "tripped circuit breakers " as an attempt to clear the fault 3 times
so suggest a mains return time of 5 mins to ensure there is a good mains supply piror to returning to mains.

Hope this is of some use

steve
Success always occurs in private and failure in full view.

Post Reply