Maker Pro
Maker Pro

I need to hire someone for a logic design

hevans1944

Hop - AC8NS
Jun 21, 2012
4,890
Joined
Jun 21, 2012
Messages
4,890
@Madsalts: Well, it seems you are quite serious about the care and feeding of saltwater aquariums. It is a keen observation that migration of the aeration bubbles across the top of the water to the opposite side is a reliable indication of too much DOC content. Who would of thunk it? You might even be able to patent and commercialize this concept (unless someone else has done so already!) if you can implement it.

From my point of view your problem has two main parts: (1) how to detect the arrival of a bubble (or bubbles) on the opposite side of the tank and (2) how to control an AC outlet that will, under time-programmed control, turn the protein skimmer on and off. Clearly you do NOT want the skimmer to operate continuously, or even on a programmed timer cycle, but only when the DOC concentration is higher than necessary for optimum aquarium health, as evidenced by the arrival of bubbles on the opposite side of the tank produced by the aeartor. I have to assume you are building a reef aquarium that supports fish and live coral formation, hence the requirement for some DOCs to "feed" the live coral rather than NO DOCs which a continuously operating skimmer would try to invoke.

Part (2) of the problem is almost trivial. Given a proper and reliable bubble sensor, a battery-operated Microchip PIC microcontroller could operate for months from three or four D-sized dry cells. The PIC would have a DC output that controlled a solid-state AC switch to operate an AC outlet the protein skimmer is plugged into. These solid-state switches have an optical isolator that provides galvanic isolation (usually to at least 1000 VAC) between the two DC control input terminals and the two AC load terminals. The control input is usually just a light-emitting diode optically coupled to a light-sensitive transistor, or sometimes to an optically-triggered AC thyristor. The more sophisticated versions have zero-crossing turn-on circuits that delay conduction of the load until the AC line voltage passes through zero, which can help reduce line-conducted radio-frequency interference (RFI) in some instances if that should turn out to be a problem. Probably not needed for your application. The major consumer of the control input power is the LED, typically a few volts at a few milliamperes of current, so we are talking milliwatts here. Still, the lower the better to extend battery life since the control input will be on as long as the skimmer is running.

Part (1) of the problem requires some more investigation by you. I doubt that a bubble detector based on electrical conductivity will be practical or reliable, especially in a saltwater environment. My suggestion is to try an optical approach based on submerged, upward pointing, infrared-emitting LEDs and matching, downward pointing, infrared photo-diodes mounted above the water. The exposed wiring should of course be well-sealed with clear RTV cement. A passing bubble should produce a large change in the photo-diode conduction. You may need more than one pair of emitter/detectors to ensure capturing a "bubble" event. A simple reverse-biased photo-diode feeding a trans-impedance connected op-amp should be sensitive enough. The op-amp output would be directly connected to an A/D input or an analog comparator input on the PIC to detect bubbles and respond according to its internal program. PICs come with one or more software programmable timers, as well as a "sleep" mode to conserve power until a bubble event wakes it up. Okay, so maybe the programming isn't trivial, but it isn't rocket science either and there are several of us here who can help you with that. The hardware is relatively simple and inexpensive.

Hop
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
My suggestion is to try an optical approach based on submerged, upward pointing, infrared-emitting LEDs

Interestingly, a colleague of mine once used a technique similar to this to detect bubbles in clear liquid (albeit in a tube). He used the fact that a bubble changed the refractive properties.

The latter part of that is not significant, but other details of his implementation would be. Primarily a concern would be that ambient light does not interfere. Using IR helps with this, but having a modulated signal which allows you to separate the signal from the background can increase reliability significantly.

I wonder how easy it would be to differentiate between the bubbles and the normal ripples on the surface of the water. Perhaps there would be a frequency component, with bubbles producing a lower frequency interruption or variation than ripples on the surface.

Its an interesting problem.

Actually, since water is a good reflector, you could place both the light source and the detector above the surface, at or near the critical angle. Presumably bubbles on the surface would change the nature of the reflection. This would remove the requirement to go to the effort of sealing a light source against immersion in salt water.
 
Last edited:

Madsalts

Sep 25, 2014
73
Joined
Sep 25, 2014
Messages
73
Great replies so far. Thanks. I'll look into this some more and post when I find out something regarding bubble conductivity.

Right off the bat, I did find that sea water has a conductivity of 56 mS/cm. I don't know how this would translate to conductivity of a thin-walled bubble, though.
 
Last edited:

hevans1944

Hop - AC8NS
Jun 21, 2012
4,890
Joined
Jun 21, 2012
Messages
4,890
Interestingly, a colleague of mine once used a technique similar to this to detect bubbles in clear Lewis (albeit in a tube). He used the fact that a bubble changed the refractive properties.

The latter part of that is not significant, but other details of his implementation would be. Primarily a concern would be that ambient light does not interfere. Using IR helps with this, but having a modulated signal which allows you to separate the signal from the background can increase reliability significantly.

I wonder how easy it would be to differentiate between the bubbles and the normal ripples on the surface of the water. Perhaps there would be a frequency component, with bubbles producing a lower frequency interruption or variation than ripples on the surface.

Its an interesting problem.

Actually, since water is a good reflector, you could place both the light source and the detector above the surface, at or near the critical angle. Presumably bubbles on the surface would change the nature of the reflection. This would remove the requirement to go to the effort of sealing a light source against immersion in salt water.
Really good comments, Steve! The suggestion about using critical incidence to avoid submersion of parts in saltwater is certainly worth investigating. And modulating the light source, followed by synchronous demodulation, will certainly suppress background interference from ambient radiation sources. You might even be able to get by with simple non-synchronous rectification of the detected amplitude modulated signal. And the PIC can implement all sorts of heuristically determined "filtering" algorithms based on simple observation of the detector output with and without bubbles present. There are inexpensive ICs, intended for IR remote controls, that can be used for modulation and de-modulation.

Ripples should not be much of a problem with a submerged emitter, but may introduce significant amplitude modulation with above-water critical reflection. The OP would need to connect an oscilloscope (preferably a digital recording type) and look at the waveform from the detector to determine if surface ripples will be large enough to cause a problem. It is my impression that the bubbles, when they occur, more or less drift with the circulating water current provided by the continuously running aerator, so there should be a rather large change in the optical signal when a slowly moving bubble interrupts the reflection path, ripples or no ripples. Should be fairly easy to jury-rig something to find out before committing to a design.

Right off the bat, I did find that sea water has a conductivity of 56 mS/cm. I don't know how this would translate to conductivity of a thin-walled bubble, though.
Assuming you maintain the pH of the saltwater tank more or less constant and slightly acidic, say with a calcium reactor, the conductivity of the saltwater should always be much greater than the conductivity of a bubble. Bubble conductivity will probably vary a lot depending on the amount and kind of DOC entrained in the bubble and the type and geometry of the electrodes. Platinum wire is probably best if you are considering the use of wire electrodes. Just a short length of very fine platinum wire, secured to metal clamps, should be sufficient if the clamps do not contact the saltwater or the bubbles. You might be able to purchase a few inches of platinum wire from a local jewelry repair shop.

You might also be able to just allow the bubbles to pass under an upper plate electrode a few millimeters above the water and measure the conductivity between the plate and a similarly sized plate immersed in the tank. Distance of the upper plate above the surface of the water should be high enough to capture a bubble between the plate and the water surface, but depth of the other plate is not important. The area of the submerged plate is probably not important either, but electrolysis will occur whether AC or DC is applied. Electrolysis will cause minute bubbles to form on the submerged plate and these could interfere with the conductance measurement.

You might also consider using an RF oscillator to apply a small RF field between an upper plate and the surface of the water. I did this years ago for a tritration demonstration at my high school science fair and won the grand prize (it was a small rural high school in Smyrna, TN). It had the advantage of not causing any electrolysis or disturbing the titration liquids. We even carted it off in the back of my chemistry teacher's station wagon to the State Science Fair in Nashville later that year, but some bright kid demonstrated how to separate heavy water from ordinary water using, IIRC, vacuum fractional distillation and walked away with top honors. The competition was fierce and I didn't even garner an honorable mention. So much for inspiring a career in chemistry, but I did dabble in physics and, later, electronics.

I would strongly recommend trying the optical approach to bubble recognition first.

Hop
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,890
Joined
Jun 21, 2012
Messages
4,890
Nice try @GPG but I don't think it will work. The focal length of the lens in front of the 15x15 pixel sensor array is very short. The surface to be imaged must line within a plane only 2 to 3 mm away from a reference plane that is only a few millimeters from the base of the device. Assuming you could mount the Avago ADNS-5020 to such close tolerances, and still have room to pass bubbles underneath, there is no guarantee that it will sense bubble motion or even the presence of a bubble.

I do like the idea of viewing the surface of the water with an imaging device, digitizing successive frames, and then using software to determine the presence of a bubble by algorithmic observation of changes in the frames. But you need to be careful to ignore small differences attributable to something other than bubbles. This will be way more complicated than either a simple transmission or reflection sensor which, after all, only needs to sense the presence of a bubble, not the direction of movement.

Hop
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
It's really pretty simple nephew Chris (since Bob is your uncle, and Martin's great uncle.)


Bob
Bob, I thought it was automatic, which is why I couldn't make any sense of it. Then I watched the video. DUH!

Chris
 

GPG

Sep 18, 2015
452
Joined
Sep 18, 2015
Messages
452
Last edited:

hevans1944

Hop - AC8NS
Jun 21, 2012
4,890
Joined
Jun 21, 2012
Messages
4,890
It would be fun to play with. A pin-hole lens is worth exploring. Very large depth of field possible from one of those if you can provide enough illumination. I was amazed when these devices became available for optical mice, and inexpensive too. A similar scheme has been used for years to provide ground-speed information for push-broom flight cameras, but those were very expensive. Accurate ground speed is necessary with a push-broom sensor platform to prevent geometrical image distortion along the flight path. Back when photographic film was de rigueur for image recording, the film speed past the imaging slit was controlled by the ground-speed measuring do-dad. Reading the "theory of operation" in the service manual brought back memories of an Air Force tech manual description of the phantastron time-base generator for radar sets. Ugh. Today you would just control the instantaneous digital sampling rate of a push-broom imager.
 

Madsalts

Sep 25, 2014
73
Joined
Sep 25, 2014
Messages
73
Well, finally at long last, I'm able to start thinking about the aquarium again. I've had quite a bit on my plate with work and such. As for this whole idea, at this point I'm not going to pursue it further. I certainly appreciate the input, and hope that the idea might work for someone else.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,890
Joined
Jun 21, 2012
Messages
4,890
So, if a reliable battery operated bubble detector and pump controller with programmable on-time and programmable re-trigger time delay were commercially available, what would you be willing to pay for it? Someone here might take a stab at making a prototype if they had a source of bubbles that would migrate across the surface of a small tank of water. I am thinking a very small aquarium tank with an aerator and a few drops of dish washing soap applied periodically to make bubbles might serve as "proof of concept". Without livestock of course. Difficult part is the " reliable battery operated bubble detector," but this could be a fun project for someone here.
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
So, if a reliable battery operated bubble detector and pump controller with programmable on-time and programmable re-trigger time delay were commercially available, what would you be willing to pay for it? Someone here might take a stab at making a prototype if they had a source of bubbles that would migrate across the surface of a small tank of water. I am thinking a very small aquarium tank with an aerator and a few drops of dish washing soap applied periodically to make bubbles might serve as "proof of concept". Without livestock of course. Difficult part is the " reliable battery operated bubble detector," but this could be a fun project for someone here.
I missed this post when it first came around and I find it fascinating :) Somehow I knew that you would say PIC after I got through the first few posts!
My cup currently runneth over and spills all over my skill, LOL - otherwise I would love to lend a hand.

I don't think you should give up on it @Madsalts but maybe revisit periodically and see what new angles you can view the problem with.

Have you tried with different water qualities?
Does TDS (total dissolved solids) have an affect on bubble formation?
Have you considered how to keep the water level at a consistent height necessary for a static height bubble detector to function?
Has anyone thought of a tethered float, that allows one sensor to rise and drop with water level, but allows the optical sensor to be at a fixed height above the water?
As for battery powered, yes, but there is no reason why this could not be powered from mains with an isolation transformer that is fused and/or internally limited for current.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,890
Joined
Jun 21, 2012
Messages
4,890
@chopnhack: To reiterate, bubble formation in the salt water aquarium is a consequence of water aeration when the organic content (mainly fish poop) of the water is too high. It is removed by a device called a protein skimmer. The OP observed that when the number and size of the bubbles gets too high, the bubbles migrate on the water surface to the side of the tank opposite the aerator. Some organic content is necessary as "feed stock" for aquatic lifeforms such as live coral, so the skimmer must only operate when the bubbles are in quantities large enough to migrate across the tank. This is an experimental observation by the OP, so the fact that it occurs and is reason enough to activate the skimmer is a "given" for this problem.

You are correct. Line power operation is possible, maybe even preferable, with complete safety for user and the fish. The OP would like to use some D-size cells for the sensor/controller even though the skimmer requires AC mains power.
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
@chopnhackThe OP would like to use some D-size cells for the sensor/controller even though the skimmer requires AC mains power.
Agreed - I recall this quote below from the first post:
I'm building a project that will require at least one, and maybe two, automated processes involving logic circuits and a DC power source (with a wall wart) with a battery backup.
The battery backup is a necessity for aquatic life due to power outages!
 
Top