Jump to content
Top Shelf Aquatics

DIY Wavemaker with x10 and Linux


jburke30

Recommended Posts

Greetings All,

 

I've been mulling over the idea of having a wavemaker for my tank, but at current retail prices ($200+) it's simply out of my budget. However, since I'm a programmer and general Linux geek I thought I would try to come up with the least expensive way to have a wavemaker on my tank.

 

My solution: x10 and Linux. If you're not aware of it x10 is a protocol that allows you to send communication signals through your home's electrical wiring. It's mainly used to automate control of lights and appliances in your house.

 

When I started thinking about this project I was considering electronic switches controled by a mircrocontroler (such as a basic stamp module, or PIC controler), but when I really started to think about this I realized that the cost might get out of hand because of the additional electronic components need to really build this thing (my salvaged component drawer is still pretty thin =). Anyway, I had played around with x10 and computer controlled home automation about 2 years ago, and this popped back into my mind as a possibility. So, I looked into current pricing and I was amazed to see the price drop from two years ago.

 

Right now the starter x10 kit (The Firecracker kit) is only $40, and with the addition of two appliance modules the total cost will only be $65.00 (assuming you already have a home PC). The x10 company has software for Windows already, so that could be used if you're running windows, but since I use Linux at home I'll probably just automate the switch with Cron (the standard unix scheduler software). Though I think a program that looks like a wavemaker with LED display would be really cool (I'll probably work on this).

 

The only downside that I can think of is that your computer will have to be powered on all the time if you want it to run 24 hours a day (or at least during the times that the software will be running).

 

The upside is that I can write a program that will simulate waves is a much more realistic pattern (some of the cheap wavemakers that I have seen aren't very realistic, but I have no idea how the expensive ones behave).

 

Right now the only question I have is how will the powerheads react to being power on and off so much? Anyone out there with any ideas?

 

Thoughts, comments?

 

Jason

jburke@luci.org

Link to comment

Aquarium Systems, the guys who make maxijets, etc. have a powerstrip that has 3 outlets that have adjustable settings for powerheads and 3 just regular outlets for heater, lights, filters, etc. Seen it for around $50 bucks.

Link to comment
Originally posted by J-Bass

Aquarium Systems, the guys who make maxijets, etc. have a powerstrip that has 3 outlets that have adjustable settings for powerheads and 3 just regular outlets for heater, lights, filters, etc. Seen it for around $50 bucks.

 

I just ran across this yesterday, and it just a simple timed queuing switch with adjustable delay settings. Not bad for the price, but also not very realistic for wave simulation. It's also not expandable, and it didn't appear to have a night cycle setting or suspend mode for feeding (though I'm sure that the off switch would probably double just as effectively =).

 

The system I'm working on will be expandable at a cost of $13.00 per additional power head, it can service multiple tanks and it will be customizable (based on the software I write).

 

Also, x10 has a number of regular specials where you can buy the starter firecracker kit for less than $10.

 

I was hoping to get some feedback on wave makers and their behavior with my post, but it doesn't seem like there's much interest here. I'll probably just post something when it's finished.

 

Jason

Link to comment

Hating the idea of requiring a computer to be on all the time (well, my server already is, but I don't want that controlling my fishtank), I went the microcontroller approach. I picked up a stackable 8051-based microcontroller setup with battery-backed RTC, 4A/D, 16DIO, power supply, and case for $50 at a local swapmeet. It uses the Intel BASIC51 operating software.... Granted, BASIC is a little limiting for writing good software, but I've made do.

 

I have my lights, fan, powerheads, and heater all plugged into 120VAC solid state relays, which are controlled by TTL signals from the controller. Costs about $10 to build each AC relay. The temp sensor is connected to one of the A/D inputs.

 

I love this setup, I can do moon-phasing with my LEDs, dusk/dawn with the main lights, switch off lights and on fans when the temp is too high, and have a "feeding mode" switch that turns off the powerheads for 5 minutes.

 

I played with wavemaking with the powerheads for a while, but currently have it disabled. I worry too much about the wear-n-tear on the PH. Especially since the most relistic wave simulation requires quite frequent switching.

 

A fun little project, it is. A bit overkill for my 10g, probably, but I am really only using it on the 10 to test it before I hook it up to the bigger tank I keep saying I'm going to build soon.

Link to comment
Originally posted by MKramer

Hating the idea of requiring a computer to be on all the time (well, my server already is, but I don't want that controlling my fishtank), I went the microcontroller approach.  I picked up a stackable 8051-based microcontroller setup with battery-backed RTC, 4A/D, 16DIO, power supply, and case for $50 at a local swapmeet.  It uses the Intel BASIC51 operating software....  Granted, BASIC is a little limiting for writing good software, but I've made do.

 

I have my lights, fan, powerheads, and heater all plugged into 120VAC solid state relays, which are controlled by TTL signals from the controller.  Costs about $10 to build each AC relay.  The temp sensor is connected to one of the A/D inputs.

 

Do you have any documentation on this?

 

The 120VAC solid state relays are the part that I was thinking would cost so much. I did a couple of checks on price of electronic switches, and they seemed a bit costly. But your $10 per unit seems very reasonable (are you using new or recycled parts?)

 

Oh Basic isn't that bad (I like the basic stamps), and since there's no need for a real time system here I'm sure Basic is ideal (I would hate to do it in PIC assembly).

 

I love this setup, I can do moon-phasing with my LEDs, dusk/dawn with the main lights, switch off lights and on fans when the temp is too high, and have a "feeding mode" switch that turns off the powerheads for 5 minutes.

 

I played with wavemaking with the powerheads for a while, but currently have it disabled.  I worry too much about the wear-n-tear on the PH.  Especially since the most relistic wave simulation requires quite frequent switching.

 

A fun little project, it is.  A bit overkill for my 10g, probably, but I am really only using it on the 10 to test it before I hook it up to the bigger tank I keep saying I'm going to build soon.

 

Nothing is overkill when your hacking =), and I like the fan switch idea (I'll have to look into this).

 

I'm with you on the wear-n-tear issue with the powerheads, but a custom system isn't really any different from the (expensive) commercial systems in wave simulation respects, so I'm assuming that this is a common issue regardless of design. Since the main purpose of my project is to get some realistic water movement patterns I'll probably run into this sooner or later.

 

I'm going to use it on my 20L tank, and what I really want is 2 big powerheads to simulate waves during the day along with 2 smaller powerheads to simulate waves during the night. Since I already have the computer and the x10 unit (I bought mine 3 years ago for $6 - which included a serial transmitter, receiver, remote control and 1 lamp modules) my only costs are $12.99 for the appliance module for each power head (or $52).

 

The big bonus of your system is that you can pretty easily check the state of your devices and add some really funky custom devices that return state (such as water top off or chemical dosing unit). Unfortunately, the 2 way modules are 2 to 3 times more expensive than the regular modules, so I'll probably just leave such things alone (or have to do some fancy trickery with the universal module =).

 

Thanks for the info.

 

Jason

Link to comment

You don't even need to get that complicated. I've been using Bottle Rocket on Open BSD for years. Just do a simple shell script to ocsillate the motion. BASH with a while, and a few sleeps is all you need.

 

For lights, its all handled by cron.

 

The exception being the true phase of the moon. That I used POM on BSD to pipe the output to a script.

 

 

I might play with Heyu and Extended one day. I have it compiled on my OBSD, but never got around to using it. BR works great. I do like the idea of the 2 way communications for Extend though.

 

And there are already tons of Web interfaces for all the above mention programs.

 

Say no to Linux :D Use a true Unix... OBSD!!!

Link to comment

Even though I lack the programing programming knowledge to even think about attempting a setup like this I think it's very interesting. I'd be interested in reading updates as your system progresses as well as the ins and outs of other automation systems.

 

Salim

Link to comment
Originally posted by keli

Any source code available?

 

I like the thought of these things, it could automate lights for all my tanks, perhaps waves in one or two tanks etc...

 

Source code for the Firecracker wireless control device is available (x10 has made all the control codes public, so the support for non-ms platforms is pretty good). The project name is Bottle Rocket and it can be found by searching on www.freshmeat.net.

 

As far as source code for wave making, as barebottoms points out, there are a number of simple built in utilities for free/open unix systems (of which Linux is a part, nyah barebottoms =). Cron and shell scripting are very usable for this task, but for some reason I'm stuck on the idea of building a GUI app that will allow different wavemaking patterns, day/night cycles, feeding suspend, and top off. Whatever I write will be free software (in the GPL sense), so code will be available, but keep in mind (DISCLAIMER) that at this point what I'm talking about is pure vaporware and it may be some time before it's released. I need to get a couple more parts for my tank before I can get started though =).

 

A good place to start doing some basic research is www.x10.com, and checking out the devices they have available. Again, as barebottoms points out, you don't need anything all that fancy to get your tank working with x10, and if your main concern is lights then all you need is a Firecracker, 1 transciever, 3 prong applicance moduels (I'm not sure if the lamp modules will handle the load of aqaurium lighting), and a computer with scheduling software (Cron is the Linux/BSD/Unix scheduler).

Link to comment

While I agree most of the tasks can be easily accomplished using standard scheduling tools, they have a couple drawbacks:

 

Lack of interaction - In my system, temperature, for example, can completely change the behavior of the lights and waves (when I used waves). Such interaction can be done using scripts and helper programs, but then you're getting more into programming and less into scheduling.

 

Lack of flexibility - While cron and such are wonderful tools for fixed-schedule items, they're about useless for variable-schedule events, like moon phase. Again, their are work-arounds, but they require writing more helper programs. Like every dat at noon, cron runs a script that calculates the moon phase for that night (which can either have an affect in intensity or duration of the moon lights, depending on what the hardware supports). Once it determines the on and of times for the lights, it sets an "at" job to manipulate them.

 

Big ugly box - The number one motivator for me was the fact that such software would have to be run on a computer operating 24/7. I certainly would have preferred to write my code in C, but not for the trade-off of having a big, ugly, power-hungry box running just to flip switches a few times a day. It's like using a sledgehammer to put a thumbtack in the wall.

 

jburke:

The 120VAC solid state relays are the part that I was thinking would cost so much.

 

Yeah, for the most part they do, but if you look for lower-amperage ones, which are a little ahrder to find, you can save a lot of money. I think Jameco sells them for about $12. We have a huge electronics swapmeet here every month, so I pick up a lot of new stuff at 30-70% off there. My biggest load on any one relay is a 32W lamp ballast. There's no power label on it, but I figure if it's doing 32W output, worst case it's got about a 50W max consumption (that's with pretty lousy efficiency), and that's still less than 0.5A. Most SS relays you find are design for motor control, which suck up the major amperage when turning on.

 

I'm with you on the wear-n-tear issue with the powerheads, but a custom system isn't really any different from the (expensive) commercial systems in wave simulation respects, so I'm assuming that this is a common issue regardless of design.

 

The thing is, most commercial wavemakers run on the order of 60-120 seconds between pulses. I've seen some people run as many as 15-30 minutes between pulses. I was going for a little more realistic approach. I'd randomize it some, but at peak times, it was 15-25 seconds between waves, with wave duration between 5-10 seconds. At night I barely pulsed at all, and at high tide the duration was longer. If I can find my notes, I can show you the "algorithm" I used for wave generation. In reality, again, this was probably overkill, and 60 second pulses all day long would have been fine. But I had a new toy and I liked playing with it.

 

As for monitoring my system, it has a serial port than I kept a basic query-response monitor on, so at any time I could pull up the current status of the system. I also has a cheap LCD display next to the tank with the current temp.

 

BASIC, while being an easy language to write code in, is really miserable for large programs. In the end, because of the lack of things like true functions and local-scope variables, it was too messy to write a traditional application, in my opinion. So instead, I went for a state machine type approach. I think currently, I have over 40 unique states, including the wave control states that I don't use anymore. In the end, it actually made extending the application with new hardware and such, much simpler. But somedays I seriously consider ripping out the BASIC51 ROM and writing my own 8051 assembly run-time monitor for a blank ROM. Then I could write C code, plus I jsut fine assembly so much more empowering than BASIC.

 

Anyway, I'm babbling. If you're interested in any specifics, let me know. In the meantime, I'll try to dig up my relay part #s and wave algorithm.

 

Matthew

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recommended Discussions

×
×
  • Create New...