# Aquarium Water Change project

#### newcirc

Joined Nov 18, 2007
4
Hi:

I'm new to this forum and I'm looking for some help on designing a water change device for my aquarium.

I have a 120 gallon saltwater aquarium. Every two weeks I change 15% of the water and replace it with fresh saltwater. I'm looking to automate this process to make it easier (so I'll do it more often). I'm hoping I can do this with a few solenoid valves and relays and keep the cost under \$150.

I've attached a drawing of the system and included a little description on how I would like it to work.

I would appreciate it if you folks could look at the drawing and let me know if this could be done and more importantly how to do it.

Thanks

#### Attachments

• 31.9 KB Views: 92

#### thingmaker3

Joined May 16, 2005
5,084
A PIC or other micro-controller could easily control the sequence of events. The chip could signal BJT-driven relays or FETs to turn the pumps and solenoids on and off. Input from the float switches would need to be "de-bounced," but otherwise is not a problem.

A good place to start would be the microcontrollers forum. Look through any old threads discussing the pros and cons of various chips as beginner level chips. Choose one, and learn about it.

#### newcirc

Joined Nov 18, 2007
4
thinkmaker:
Thanks for your reply. My background is Mechanical, so the terms you wrote about, I don't understand. Can you explain:
BJT
FET
"de-bounced"

Thanks

#### thingmaker3

Joined May 16, 2005
5,084
I apologize for my ambiguity.

BJT = Bipolar Junction Transistor

FET = Field Effect Transistor

De-bounce = remove the many spikes and false starts associated with mechanically actuated electrical switches - get one clean transition instead of dozens of ambiguous ones. An internet search on "debounce" or "de-bounce" will give some nice examples. With a float switch bobbing up and down, you'll want a longer time constant than with most de-bounce circuits.

#### GS3

Joined Sep 21, 2007
408
This seems pretty simple with just a few gates and a couple of timers. An R-S flip-flop per valve can be set/reset as needed by the timer. Really simple. It might be even simpler than that but I am not sure I understand the process. Valve S4 would need to be de-energised at some point. Something is missing.

#### newcirc

Joined Nov 18, 2007
4
GS3, you're right. At the very end of the procedure, S4 would be de-energized allowing the fresh saltwater to recirculate.

This probably is pretty simple, but I don't know electronics enough to put components together to make this work. I was hopin someone on this forum would be willing to develop a schematic for me, a list of components, and describe how to put all this together.

#### GS3

Joined Sep 21, 2007
408
S2 and S3 are always both in the same state so it is really the same output of the circuit and the circuit has three states:
Rich (BB code):
State | S1 |S2/3| S4 |
#1 |  1 |  0 |  0 |
#2 |  0 |  0 |  1 |
#3 |  0 |  1 |  0 |
There are several really simple ways to do this. One which I already mentioned is to have three R-S flip flops be set/reset at the appropriate times.

Another one is to have a binary counter and some gates. As dividing by four is easier we can just add a fourth state which has the same output as state #3 and add two pulses at the end. (Or we can design a true divide by three binary counter. Whatever.) So we have a binary counter with outputs Q0 and Q1 and some gates which will produce the following S1 through S4 outputs.
Rich (BB code):
State | Q1 | Q0 | S1 |S2/3| S4 |
#0 |  0 |  0 |  0 |  1 |  0 |
#1 |  0 |  1 |  1 |  0 |  0 |
#2 |  1 |  0 |  0 |  0 |  1 |
#3 |  1 |  1 |  0 |  1 |  0 |
State #0 is the normal state, state #1 is the first state of the cleaning process, state #2 is the second stage of the cleaning process and state #3 is back to the normal state which results in resetting back to state #0.

That's the general idea. Maybe someone else can check for any mistakes and take it from there. Like most concepts it can probably be simplified with a little thought.

#### Attachments

• 1 KB Views: 56

#### GS3

Joined Sep 21, 2007
408
It could probably be done with a CD4017 or CD4022 counter and no need for external gates.

Tie "decoded output 3" to reset and you have a divide by 3 counter.

"Decoded output 0" activates S2/S3
"Decoded output 1" activates S1
"Decoded output 2" activates S4
"Decoded output 3" resets the counter back to 0

The counter is normally at 0 until the process starts and sends the three pulses spaced at whatever intervals they are needed (not specified in OP).

I think that should work but someone may want to check my work.

Regarding the timer signals there are several questions. There are three different timer signals which signal the three transitions between states. If these three times are or can be identical then that would make it very simple. If they are not identical but can be simple multiples of the same base unit then that makes it simple. If they have to be totally different and unrlated that makes it a bit more complex. Maybe some signal would not even be based of time but on a certain water level or other signal.

They way I am thinking, state #0 there are no timer signals and the system remains in this state indefinitely. The push of a button starts the timer(s) and the system cycles through the three stages until it returns to state #0 again where the timer(s) end their function or are disabled by the logic.

I suppose relays would be the logical, simple way to interface with the solenoids of the valves.

Here's the basic idea:

It would need to be tested. maybe the reset signal might need some conditioning but I believe the basic idea is sound.