DIY Automated Controls - Advice Solicited

I received everything. So far I got the linksys NSLU2 powered up and I attempted to flash openslug on it and it promptly decided it hated me. So more to work on that trying to properly flash another OS on it. The only drivers I need are for my linksys usb wifi card and for the FTDI usb serial chipset. I hooked up my 24 volt transformers to the contactors and they connect with a satisfying clunk. So I went to work on the electronics. First I hooked up the arduino and downloaded the software for macos. Perfect. I uploaded a sample program to it that makes the on board pin 13 led blink. Perfect! So I decided to manually energize one of the relays. I hooked up 5V and GND to the coil on one of them and they connected with a satisfying clunk.

So next the hard part. Soldering up all 3 NPN transistors, resistors and relays on that tiny tiny board. I got it and made a program that in short succession energizes all 3 relays and then releases them. And sure enough - clunk-clunk-clunk ---- clunk-clunk-clunk.

So! So far so good! More to follow. The work on the arduino protoshield is NOT pretty. I almost wish I used a separate board that way I could have had rails for everything. But it works and it's *extremely* compact. Video to follow sooner or later.
 
That looks extremely expensive. Oh and news flash tonight, I got SlugOS installed on the NSLU2 finally! It comes equipped with FTDI drivers (necessary to communicate with the IO board) but doesn't have drivers for my USB wifi adapter so I'l have to take care of that. Can't remember if I wrote this but I've successfully controlled the contactor the whole way from my pc :) I can officially say this is hopefully going to work if I don't short something between now and install time :p

Tomorrow if my ear infeciton feels better, I'll clean up my office so I can snap some pics of the whole setup in prototype mode. I still haven't purchased or even decided on an enclosure. I also still have to come up with an op amp circuit so I can read the pressure sensors. I'm thinking I should probably sell this whole setup considering what the pool products companies charge for this stuff.
 
I've successfully controlled the contactor the whole way from my pc Smile I can officially say this is hopefully going to work if I don't short something between now and install time

Very cool. I want to see some pics.

From what I've seen any slick UI will cost me money. As for the RTI remote, I'd just go and buy Jandy's solution for a few hundred more so that is out.
 
You have to ask yourself what you want the remote for. If you want to control a dvd/stereo/tv and you want to do it wet, you *need* that. but if you really just want to be able to switch the light or the pump or a couple of things, I'd do it spa style and use air switches. You could build a nice console somewhere near the edge of hte pool. It'd probably be a lot cheaper.
 
I've been thinking of building some sort of automation system for my pool, so this thread is really interesting. What I'm not clear on, though, is what software will be running to control everything. I see the Linksys NSLU2 can be reprogrammed to run various flavors of Linux, but I am curious about what software will do the work and what interface will there be to configure and control it.

My system currently uses two mechanical Intermatic timers for the main pump and Polaris booster, but I have a Goldline control for the solar (activates the Jandy valvle) and I have the Aquarite SWG controller. My goal is to have a system that runs the main pump a certain minimum time per day depending on need. If the cleaner has done its thing and the pool temp is up to the target and solar is no longer needed, I want the main pump to shut down if it's already run the minimum number of hours for the day. If, however, the pool still needs some more heat and the solar is able to deliver it, I want it to keep running. Pretty simple algorithm, really. Maybe I'd even postpone the running of the main pump until late at night when I don't want to hear it running during the day and no heat is needed.
 
I was going to write the software. I can write in C, PHP, C#, etc. so I'd write a small C daemon that would run on the NSLU2 itself to talk to the arduino via the FTDI serial. That program would read sensor values and control relays. Honestly as roundabout as it is, I'd probably have ths program read and write from a mysql table which I would interface with anything else I want to write. Schedulers, control daemons, touch screen, etc. Mysql is a nice common demoniator between all the languages and allows good reliable network communication.

The NSLU2 broke itself again so I'm back to square one. Right as I had the Linksys WUSB54G wireless driver compiled too. Booooo

PS: My main drive here is to be able to start the pool pump up at work at around lunch time and monitor the pressure to be sure it has proper prime. Everything else is just gravy for me.
 
I've been thinking about basing my system on either the Arduino or a Basicstamp setup as both are easy for me to design around and program. I've been hampered by the thought of some kind of UI, such as a keypad and display, but I hadn't considered networking the thing. If I networked it to one of my Macs, I could create a simple "front panel" app on the Mac that configures the pool controller. The Mac wouldn't need to be on all the time as the controller would still run autonomously, though that Mac is always on as a media server and security camera server. Down the road, I could figure out a way to add a display and some controls to make the controller completely freestanding.
 
Hello all,

Last time I posted I was having trouble with my NSLU2 device. As it turns out I was sent a defective one. Since then I got my new device, install the open linux system on it called openslug, compiled and installed drivers for my USB wifi device, Linksys WUSB54G ver 4. I also wrote my control program for arduino and my linux side control program. I wrote a bunch of shell scripts so the device can be commanded via remote command. Commands are like pump_on, pump_off, light_on, and light_off.

So to continue my steps are:
1. Buy an enclosure (and some nice gauge wiring).
2. Wire up the 24 volt supply to the relays and then to the contactors
3. Gut my current sub panel of the current timer and install contactors ... somehow. I decided too that the 24V transformer should go in the main box that way I can keep the control box smaller.
4. Get everything running and see if it works.

I had a number of problems to solve
1. The wireless driver gave me all kinds of problems. It didn't help that my network is WPA2 and I insisted on keeping this level of security.
2. The output pins I was using were quite affected by the arduino communication. Such that when you'd upload a new program the relays would click on and off like CRAZY. It was highly entertaining but would be *incredibly* bad for the pool pump. Moved the pins to higher numbered pins and all is well.
2. The arduino likes to reset when serial is connected and disconnected. This means that the relays, if engaged, will disengage and then reengage. This means that every time I would issue a new command it would turn off all of the relays for half a second and then turn the relays back on to whatever I commanded. This wasn't okay. I fixed this by recoding my C application. I'll publish all of this stuff as I think I'm going to make a website describing this process.

Should only be a day or two. I'm having a party this weekend and I'd love to have it finished to show people.
 

Enjoying this content?

Support TFP with a donation.

Give Support
DaveNJ said:
piku,
I have following this thread with great interest. I have used these boxes quite a few times.

http://www.budind.com/plasticboxes3.shtml

http://web4.automationdirect.com/adc/Ov ... n-metallic

Dave

Hi,

I really wanted to use the nice enclosure from Lowes with a hinged door but a couple of problems. 1 It's vented to the outside which would probably allow humidity to get too high within the enclosure... And bugs as well. No bugs allowed, but more importantly while the NSLU2 fits in there it doesn't fit with any of it's cables attached. So much to my dismay I am going to go with a screw top junction box with no knockouts made for me already. I'll have to drill for conduit using half inch spade bit I guess. I really want to source this item locally. Also I saw at lowes a 24VAC transformer for $9. Kind of silly for me to pay almost that much online. The lowes one is for doorbells and the one I have is a bit more rugged and has input voltage selectable (110, 220, 240 VAC). The doorbell one has output voltage selectable (like 10, 16 and 24 volts).

My current arduino layout is to use 3 relays and have the 2 pressure sensors on board. I am going to alter that design, remove the pressure sensors and install a 4th relay/transistor. Reason is that I want a chlorine pump and I also am thinking about getting a polaris with booster pump. Let this lesson be known people, no such thing as overkill :p But since this is not happening yet I will just remove the pressure sensors for now.

I realized that i have a collection of spade terminals I bought some time ago. As it turns out they are perfect for the job! I bought a 65ft spool of bell wire and I am going to solder directly to the relay terminals of the arduino protoshield. From there I will crimp on the forked connectors which will attach to a screw terminal block. From the screw terminal block I'll have more bell wire that will go through conduit to my main sub panel. Inside there'll be another screw terminal block (can you tell I want to make sure I can remove any single component wihtout destroying the setup yet?). From there there'll be more bell wire which will be crimed to spade connectors which happily attach to my contactors.

Inside the sub panel I plan to use preexisting screw holes. I also plan to install SPDT switches in a panel on the void where my timer currently is which will directly connect to the 24VAC system to perform 2 functions.

1. Override on for any device. No matter what the arduino is commanding flicking the switch this way will turn the item on.
2. Middle setting which means obey arduino.
3. Other setting which means override off for any device. We wouldn't want arduino to tell the pool pump to turn on while cleaning hte basket. Similarly we wouldn't want to walk inside while backwashing and turning the pump on and off several times. My pump pad is dark at night and much of my pool work is done at night so I want to find cool lighted switches that work on 24VAC. Something in the doorbell category :p

So that's where I'm at right now. i made very little progress yesterday. I still need to photograph each component individually and everything but I am waiting until I finalize my design. For now this is still trial and error. The guy trying to help me at the lowes electrical department looked at me very strangely when I told him I wanted to gut an outdoor disconnect box and put this strange little device inside.

The NSLU2 openslug has packages available for USB backlit LCD screens as well as USB webcams. So ideas are forming about that :p
 
I don't know just how much power your project requires, but the standard 24 volt transformers for doorbells are rated at pretty low current output. Somewhere around 10 VA total is what comes to mind. I had to upgrade mine last year to get 3 doorbells to reliably operate from a single transformer (gotta have a doorbell out by the pool and in the garage!). I found one rated for 40 VA at Grainger. If you need more, you might want to look at a transformer for a lawn sprinkler system. They can usually kick out some pretty decent current.
 
With regards to the arduino question - I absolutely want to be able to from anywhere know what is going on with the pool. Right now it's a control system and I could easily write a program to have arduino control that by itself. But at some point I want a touch panel on the wall that will let me turn the light on and off, etc and that requires connectivity. Connectivity requires either the arduino ethernet thing which is $40+ and a boatload of problems or the NSLU2 which was only $50 and offers SOOO much flexibility. It's really a fantastic little device.

With regards to the transformer comment, the one I got is 40VA or maybe more. It's a big heavy transformer. The one that lowes was selling is 20VA. Either way, the contactors draw very little.

Last night I finished the Phase I (control only, no sensors) prototype and I'm now ready to gut the sub panel and install the contactors. I got a 8x8x4 Nema 6P (I believe) box from Lowes. I drilled a hole for the Conduit and got a liquidtight conduit kit which came with conduit and ends. I ran all the wiring through the conduit. This required chopping off a built in EMI filter on the power cable for the NSLU2. It hasn't crashed yet :p

I'm surprised because I thought this enclosure would be way oversized but things only fit barely comfortably. I was impressed with how much wire stripping, crimping and soldering was required to get this all finished up. Last night I was playing click on and off the contactors. The whole setup is sitting up on my mantle while I sat on the couch and played with the contactors remotely. Assuming the NSLU2 can handle the environment this will work :)
 
Since you are putting NSLU2 in a watertight box, can you take the guts out the NSLU2 box, and just install the guts in the watertight box?

I'm sure it would still get hotter than 102 F, but it would give the electronics better ventilation, which should help some.

You could also drill holes in the bottom of the watertight box, it probably would not help much, but it is better than nothing. Top and bottom would be much better, but it would not be very watertight after that :wink: .
But, you could add holes to the top and bottom if you added a "roof" over the box. That would keep water from dripping in, and give you flow through ventilation.

A fan would help, but I don't know if fan would like the environment much, probably would not last very long.

Another thing to consider, do any parts in the NSLU2 have heatsinking? You could try putting larger heatsinks, or even heatpipes on it.

Randy
 
Hrmmph. I have a box full of small individual chip heatsinks. I'll try it as it is and if it starts crashing at all I'll start working to solve heat issues. From what I can tell I am a major guinea pig here. Nobody seems to be using the NSLU2 outside of climate control.

That would be really sweet to use heatpipes and use the pool water to cool it!
 
Hey guys,

Made a small video tonight demoing the system. Barely had time to encode it and upload it so don't mind the several takes needed to get it working. To elaborate there seems to be a problem with the serial protocol I am using to tell the arduino to turn the pump on and off, and in the other case I bumped the cord and shut the whole thing off. Go me. Without further ado, you can hear me ramble on:

http://www.youtube.com/watch?v=tiY5eNELurk
 
My plan is to use an ELK M1G alarm/home automation panel to control pump run times and chlorine injection times.
http://www.elkproducts.com/products/m1/elk-m1.htm
You can get a basic ELK system for $350. Add a relay board to control connectors for the pumps. Anything that is 120V (like my injector pump) can be controlled by UPB. Not that I will, but I could.

You can change settings online or by phone...... And you get a top of the line alarm system with it.


crabboy.... have you considered using a Nokia N series in a waterproof bag as a remote?
http://www.proporta.com/F02/PPF02P05.ph ... t_mode=des
 
That's coming along nicely, piku. I look forward to seeing your full write-up.

With regard to the possible cooling issue, perhaps you could use a Peltier cooler on the top of the enclosure. Cut out an opening to hold the device snuggly and seal its edges. Put a heatsink on both the hot and cold sides of the device so the cold is inside over all the internal electronics. Another possibility to is to mount it all in an aluminum enclosure, which can act as a heatsink in itself.

After you get your pool all set up with this system, make sure you post your IP address so we can all play with your light and pumps! :lol:
 

Enjoying this content?

Support TFP with a donation.

Give Support
Thread Status
Hello , This thread has been inactive for over 60 days. New postings here are unlikely to be seen or responded to by other members. For better visibility, consider Starting A New Thread.