Showing posts with label aquarium. Show all posts
Showing posts with label aquarium. Show all posts

Monday, April 26, 2010

Titanium heat exchanger for DIY aquarium chiller

In my first post about building an aquarium chiller, I used a coiled stainless steel heat exchanger that I bought at a lab surplus sale. It was very likely built from 316 stainless steel, but it eventually corroded. Despite my attempts to repair and passivate the stainless steel, the coil continued to corrode, and I permanently removed it from the aquarium.


Since the weather is starting to heat up, I decided to build a titanium replacement for the chiller heat exchanger. I bought some 1" dia x 0.025" wall titanium tubes on eBay after fruitlessly searching for a coil or something that I could bend into a coil. The surface area is about 16 in^2. The stainless coil had a surface area of about 20 in^2, so the heat transfer should be comparable.


The heat exchanger is built so that the metal tube is pinched between the plastic end caps when they are threaded onto the internal aluminum shaft. There are rubber washers to seal the metal to the end caps.

The device fits into my hang-on filter in the same position as the stainless coil did. I'll let everyone know how it works.

Saturday, November 7, 2009

Improved level sensor for the DIY aquarium top-off project


In my
original post regarding an automatic water top-off system for aquariums, I designed a sensor head that consisted of a plastic rod with a set of pocket holes drilled at the tip. The holes were diametrically opposed and angled so that they intersected at a point about 1cm in front of the plastic rod face. I inserted a plastic fiberoptic into each of the holes, and the system would allow sensing a liquid level surface by measuring the amount of light reflected off the surface. If the liquid covered the two probes, all of the light would be scattered off into the liquid and the signal would be almost zero. When the level fell below the fiber ends, the reflected light would trigger the top-off pump.

This system worked very well until nearly flooding my house a couple weeks ago. By extreme luck, I happened to be sitting near the aquarium when an air bubble got trapped between the two fiberoptic ends. This caused the top-off pump to run even after the water level had risen higher than the sensor head. I heard the tank dripping water and quickly shut off the pump. Following this event, I decided to improve the reliability of the sensor.

I did some searching for commercially-built liquid level sensors and found that many of them operate by submerging a prism and measuring the amount of total internal reflection. When the prism is submerged in liquid, the light will pass out of the prism and into the liquid. When dry, the prism will reflect most of the light internally. By positioning the fiberoptics symmetrically, the light signal will be drastically changed by the liquid surrounding the prism.



I machined and polished a piece of acrylic into a point. Then I drilled two holes that would snugly hold the fiberoptics. I mounted the whole thing on a Delrin rod.

This sensor should be much less sensitive to air bubbles, snails, dirt, etc than the previous model. For the next week, I'll be monitoring the top-off system and manually controlling the pump. If it looks good, I will connect the pump and let everyone know how it works.

Sunday, May 24, 2009

DIY dosing pump for reef aquarium

Part of the daily maintenance on a reef aquarium is controlling the calcium and alkalinity levels in the water. Calcium is used by reef inhabitants to build their skeletons, and it is also precipitated abiotically (calcium deposits on pumps, heaters, etc). Even though this rate of calcium utilization is fairly slow, it must be replenished to ensure there is always a sufficient supply, and having a very consistent level is beneficial to the inhabitants.

The alkalinity level of the water is a measure of how resistant the pH is to fluctuations. It too must be replenished to keep the pH of the water stable. If you are curious about marine calcium/alklainity, search the web. There is a ton of information available, and it is quite complex and interesting.

There are a few ways to maintain proper calcium and alkalinity levels, but I prefer to use a two-part alkalinity and calcium supplement called B-ionic. My aquarium is 5 gallons, and so it only requires about 1 mililiter of each solution (alk and ca) added each day. The exact amount varies, and the two solutions may need to be dosed in unequal quantities. Well, this gets a little tedious after a while, so I built a device that would slowly add the desired amount of each of the alk and ca solutions over the course of a day:I bought two "syringe pumps" on eBay for under $15 each. The pumps consisted of a leadscrew assembly, split-nut, and holder for the syringe. There was no motor, but I knew that they were originally intended to be run by a clock motor. The speed of the motor was constant, hence the only way to control the dosing rate was by changing the motor or the syringe diameter.

I hacked up the syringe pumps a little, and fitted them with two stepper motors that I got at a surplus store for $17 each. The motors are unipolar (6-wire), 1.8*/step, 24V per phase at 300mA.
The motors are mounted to the leadscrews with a short length of Delrin shaft. This allows a necessary amount of flexing, since the motor shaft and the leadscrew are unlikely to perfectly aligned. This is a very low-speed low-torque application, so the strength of the delrin shaft is not an issue.



The motor driver circuitry is built from PN2222A transistors that are wired between the motor windings and circuit ground. Each transistor has a clamp diode and filter capacitor on its collector. Each transistor base is driven by a pin on the Arduino Duemillenove microcontroller board. There are four phases for each motor, so this took a total of eight pins on the Arduino. The Arduino is also connected to a 4x20 LCD screen via 6 pins (4-bit interface). I also wired two potentiometers to the Arduino's analog input pins. The pots are setup as variable voltage dividers between ground and 5V.

The Arduino runs code that reads the positions of the two knobs, translates the positions into timing intervals, and advances each of the stepper motors when its respective time interval has elapsed. I also added code to de-energize the motors 1/2 sec after they have been advanced. In this application, the time between motor steps ranges from 40 seconds to 3 minutes. I tested this power-save feature, and it appears the system has no tendency to push the motor backwards while it is unpowered. Thus, power is only necessary when the motor is moving, and it can be deactivated when it is waiting for the next step.

The circuit and motors are powered by a 20VAC wall transformer. I rectified this with 4 diodes, and used a 7805 to supply 5V to the Arduino and LCD. The motor windings get unregulated DC voltage about 20V, since the load from the LCD's backlight is substantial. The 7805 required a large heatsink for this same reason.


For display purposes, the Arduino code translates the motor timing interval to mililiters/day. Turning the knobs provides a very responsive update of the LCD value. It is easy to set the device with .01 mililiter/day precision, although I doubt the device mechanially has that level of precision.

I calibrated the device by turning the stepper motor a specific number of steps, and used a very sensitive scale to measure the mass of water that was pumped out of the syringe. Later that day, I setup the device running normally with its output directed over a vessel on the scale. I learned that my scale must have an anti-drift feature, as it did not register any mass! Instead, I measured the water with a small syringe, and it came it at 4.75 mL (should have been 5). I am not sure if .25mL evaporated, or if .25mL stuck the sides of the vessel, or if the system is inaccurate. Maybe it's all three. The .25mL discrepency is not too important, since the settings will be tweaked based on water testing results once it is up and running.

I am still testing the system, as I really want to be sure it is stable. If the device malfunctioned and dispensed all of its calcium in one blast, it might kill everything in the aquarium. The code is pretty simple, but the Arduino clock function will rollover every 49 days, and it's difficult to test what will happen at that time.

I'll make another post when I install the system on the aquarium.

Saturday, April 4, 2009

Even more detail for aquarium DIY top-off system

In this post, I'll describe the machines and methods that I used to make the optical sensor head for the aquarium top-off system.

Step 1: Cut off 2" of 1/2" diameter black Delrin rod. Delrin is a brand name for a specific type of acetal copolymer plastic. You can get it at www.mcmaster.com


Step 2: Square-off the end of the rod on the lathe.


Step 3: Drill two holes at 30* to the rod's major axis so that they intersect a few mm in front of the rod's face. You may need to use a punch or dremel to prevent the drill bit from wandering on the sloped face of rod. I like to use the vise-within-a-vise method for drilling angled holes on the drill press.

Step 4: Taper the end of the rod with a coarse file.

Step 5: Use a smooth file to tidy everything up.

I found that the optic fibers should be cut square, and then recessed into the sensor head so that nothing sticks out. This allows air bubbles to form harmlessly in each of the spaces created by recessed fiber ends. If the fibers stick out too much, an air bubble might become trapped between them, and the system will have a "false positive".

Thursday, April 2, 2009

More detail for the DIY auto top-off system for aquariums


I've had a few requests for plans of the auto top-off system for aquariums. This project is fairly straight-forward, and I would imagine the most difficult part is machining the sensor head that holds the two optical fibers. This will require a drill bit that is sized just right, and the angles need to be pretty accurate. The wiring and electrical side of this project is very easy, and only requires minimal soldering. Here's some rough instructions and part list that I emailed to an interested DIYer:

This project involves wiring a household electrical outlet. As you know, saltwater is a great conductor and the wiring must be protected from drips, etc. Always disconnect the power when working on the circuit, and use good wiring practices.

I'd start by getting a Keyence fiberoptic sensor FS-V11 (or similar) ebay like this:

http://cgi.ebay.com/Keyence-FS-V11-FSV11-Fiber-Optic-Sensor_W0QQitemZ390020341450QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item390020341450&_trksid=p3286.m20.l1116

Next, you need a wall-wart power supply (AC adapter) to provide low voltage to the Keyence. You'll need 12V DC at almost any current rating (mA rating). Be sure the AC adapter is a linear voltage supply, not a "switching" supply -- it should be relatively heavy.

You'll need some 1mm jacketed plastic (PMMA) fibertoptics. I didn't find any at a great price on eBay. You'll have to hunt around a little. Edmund Optics sells it per foot, so you might be able to just order a small amount.

Get the Aqualifter AW20 pump ($10 or $15)

Get a solid state relay eg Kyotto KB20C02A (Jameco #175214) $6.55

You can wire it all together in a standard electrical box with an electrical outlet from a home improvement store.

The basic idea is that the Keyence device gets power from the 12V DC supply, then controls the solid state relay with its output. The solid state relay controls power to the electrical outlet, which is where the AW20 pump is connected.

I don't know if I would recommend this project to someone who has never done any electrical/electronics projects before. It involves wiring a household electrical outlet, and this really has the potential to cause a lethal shock -- especially around saltwater aquariums.

Another problem is that a malfunction might flood your house! I noted problems about air bubbles. If the fiberoptic sensor head traps a large air bubble, the top-off pump will continue running even after the aquarium overflows. For the first week or two, I used the top-off system as just an indicator -- not risking any floods. You should do the same if you attempt this project. I modified the sensor head, so that I doubt air bubbles will cause any more problems, but you never know.

Feel free to give me more feedback in the comments...

Sunday, March 29, 2009

DIY aquarium chiller

See update here:
http://benkrasnow.blogspot.com/2010/04/titanium-heat-exchanger-for-diy.html

My nano reef aquarium is usually 2-3*F hotter than the ambient room temperature (after the heater setpoint has been reached). This is a problem, since the temperature in my living room is often higher than 82*F in the summer. This puts the tank water at an uncomfortably high temperature (84+), and I think that the corals suffer from the temperature swings as well as the overall high values.

So, how to lower the tank temperature? For a 5 gallon tank like mine, a peltier heat pump like the Coolworks Ice Probe would seemingly be a good choice. I tried building just such a device a few years ago, and it was a big failure. I learned that peltier heat pumps cannot be controlled by raw pulse width modulation (PWM) signals, and they don't do well in thermostatic (on/off) systems either. One reason is that the semiconductors inside the Peltier device do not like the thermal shock of the constant on/off switching. Also, Peltier heat pumps are already horribly inefficient, and using PWM or on/off control makes things even worse. During the "off" cycle of either the PWM pulse or the on/off cycle, the heat will flow backward though the device -- the same heat that the device just pumped during the "on" part of the cycle. Think of bailing out a sinking boat with a bucket that has a huge hole in the bottom. The best way to control the peltier modules is to generate high-frequency PWM, then smooth it out with an inductor/capacitor filter. There is still the problem of the peltier junction's inefficiency, and the hot-side heatsink must be massive with a massive fan to make the system viable. Anyway, I haven't heard anything great about the Ice Probe, nor any other Peltier cooling systems designed for any application that requires a good amount of cooling. I have a thermoelectric refrigerator that is just marginally good enough for its purpose.

So, today's design for a new aquarium chiller will NOT use Peltier junctions, as much as I love the idea. I bought a $99 water cooler that uses a conventional compressor and r-134a refrigerant.
I filled the cooler with tap water, and mounted a Rio pump with an outgoing hose and return line.


The two hoses connect to a stainless steel coil. I've had this thing laying around my shop for a long time. It came out of junked, expensive lab equipment. It is non-magnetic, which indicates 3-series stainless steel. I'm guessing it's 316, which is highly corrosion resistant. Of course, the aquarium purists would insist on titanium, but I don't have any, nor do I think it's really necessary. I'd love to hear from anyone who saw a stainless steel chiller coil corrode, or definitively caused tank poisoning.

I melted a couple slots in my hang-on cheapo protein skimmer (it's not a Skilter, but very similar). I would have used a dremel, but I didn't feel like taking the filter off the tank, and I also wanted to avoid getting plastic shavings in the water. The stainless coil sits down into the slots and is just held by gravity.

The cooler is plugged in all the time. It keeps its insulated water chamber around 47*F. The Rio pump in the cooler is turned on and off by the PID temperature controller that I mentioned in a previous blog post. The controller can be configured to use a longer cycle time (eg 30 seconds) since it is controlling a pump, and it would not make sense to turn a pump on and off once per second as it would be for a heater.

The cooler is rated 86 watts. If this is what the compressor draws while normally running (I didn't check it). I would estimate the cooler can pump about 170 watts of heat (about 580 btu/hr). The coefficient of performance is around 2 for small compressor systems. For comparison, a large peltier device can move around 70W under ideal conditions, at a very specific current/voltage. The coefficient of performance for Peltier devices usually tops out around 1, and is often about 0.5 for realistic situations. So, a peltier pump drawing 86 watts, would only pump about 43 to 86 watts of heat.

I just installed this chiller today, so I'll monitor it on hot days and make another post about its performance.

Monday, March 23, 2009

DIY wave-maker plans

I have provided a basic schematic and parts list for the aquarium wave maker circuit. Here is what you will need:

*Blue plastic "double" electrical box (for household wiring) $1
*Standard electrical outlet and outlet/switch faceplate $2
*12 volt transformer and full-wave bridge (cut up an old one that you are not using. $6 for Jameco #100095)
*Power cord (cut up an old one)
*558 timer chip (Jameco #27457) $1.20
*Solid state relay Kyotto KB20C02A (Jameco #175214) $6.55
*7808 or 7809 voltage regulator (Jameco #876352) $0.56
*two 100K pots (Jameco #29103) $2.18
*two 3,300 uF capacitors (Jameco #93666) $1.22
*PN2222 transistor (Jameco #178511) $0.12
*perf board, wire, maybe a 16-pin DIP socket, misc caps and resistors $2.00

Total parts cost is about $23. Here's a link to Jameco

Notes: My circuit provided times of about 1 to 6 minutes for the on and off periods. You may want to put a 10K resistor in-line with the 100K pots. If either pot is turned too far down, the circuit will stop oscillating, so the additional fixed resistance will prevent this from happening.

This circuit does not provide the "soft start" that many commercial wavemakers tout. These motors likely use shaded poles for starting, and a soft-start controller would have to control the frequency of the AC power, not just the voltage. I find it pretty unlikely that this is what any wavemaker does, and for the price they charge, it's probably cheaper to buy a new powerhead every year! I haven't used my wavemaker long enough to know if it will kill the powerhead. I'm using an Aquaclear powerhead, and it clicks loudly upon startup, but there is no chatter. I may make another post about modifying the impeller to cope with the repeated startups.

I've experimented with using dimmers, current-limiters, etc, to control the speed of powerheads. The speed can only be reduced %10 or %20 before the motor stalls. It's not really practical without control over the frequency of the AC waveform.

The Solid-state relay in this circuit has a current limit of 2A. This mean it can control up to about 200W of powerhead.

Saturday, March 21, 2009

Aquarium wave maker

Here's a really simple project that turns an aquarium pump on and off at a specific rate. This is supposed to simulate ocean currents which periodically vary instead of blowing constantly like a mechanical pump does.

The project is built within an electrical box and uses a 558 quad-timer chip as the timing device. I used a monster capacitor and resistor to get time values of 1 to 6 minutes (variable with a pot). The on and off times are independently variable. I used another part of the 558 chip to flash an obnoxiously bright LED. There is also an override switch. The output of the 558 chip drives a transistor, which triggers a solid-state relay. The relay controls power to the outlets.

I added some plans here: http://benkrasnow.blogspot.com/2009/03/diy-wave-maker-plans.html

Aquarium temperature controller (PID loop)

Store-bought aquarium heaters suck. It's just that simple. They're cheap too, so maybe the suckage-to-price ratio is correct, but I felt that the temperature in my tank could be a whole lot more stable than it was a with a standard submersible heater. The main problem with the glass-tube heaters is that the temperature sensing device (a bi-metallic strip) is located inside the heater itself! How does the heater know what the tank water's temperature is? It doesn't. These submersible heaters are setup to maintain a relatively constant temperature inside the heater tube. The assumption is that the heat load on the aquarium is approximately constant, therefore the water temperature will be fairly steady. In my house, the ambient temperature changes quite a bit, so the heat load on the aquarium changes, and the submersible heater does a poor job of temperature regulation.

The solution is to use a sensor that is mounted some distance away from the heater. The sensor will accurately measure the water's temperature -- not the heater's. Systems of this type are available to aquarists, but they are overpriced, and offer only on/off control. Instead, I bought a PID (proportional, integral, derivative) controller with a platinum resistance temperature device (fancy thermometer). The whole thing with a solid-state relay was $70 on eBay! I mounted the controller in an electrical box and wired the solid-state relay to control the outlet. I am still using the tank's original submersible heater, but I set its temperature control wheel all the way up, so that it is on whenever it receives power. It is switched on and off via the relay.

The controller is a Eurotherm 2132. This is a very complicated piece of equipment. It has numerous settings, menus and modes of operation. It's definitely overkill for controlling an aquarium's temperature, but I really enjoy tinkering. My favorite feature is the auto-tuning of the PID loop parameters. I set the controller up, and let the tank's temperature drop to about 78*F. I programmed the controller to bring the temperature up to 80* and to initiate its "learning process". It switches the heater on and off and records how quickly the tank rises and falls in temperature. This way, it knows the time constant of the system, and how to best choose the PID parameters. The learning process took an hour or two since the system has an inherently slow response. For those that are really curious, here are the parameters that the controller calculated:

proportional band: 1.45 *F
integral time: 3923 sec
derivative time: 655 sec

This means that the controller uses proportional control when the tank temperature is within .725*F of the setpoint (half of the total 1.45*F band). Below the band, the heater is constantly on. Above the band, the heater is constantly off. Proportional control means the heater is switched on/off rapidly to generate a percentage of its full output power.

The integral time is very large, which means the system reacts very slowly, and the integral action should be very gentle. Specifically, the controller will modify the proportional output up or down at a rate of one full proportional band per 3925 seconds of 1*F error. So, if the tank is constantly 1* too cold, after 3925 seconds, the controller will boost the output by %100

The derivative time indicates how much the controller responds to rapidly changing tank temperatures. 655 seconds means that if the tank temperature were changing at a rate of 1*F per second, the output would be adjusted by 655%. If the tank temperature were changing at a rate of 1*F per hour, the output would be adjusted by 18%.





I also added a chiller to my tank, and have it controlled by the same PID controller. Check it out here:
http://benkrasnow.blogspot.com/2009/03/diy-aquarium-chiller.html