PDA

View Full Version : Software development for an all in one controller


Dustin_p
01/05/2008, 02:50 PM
I have bee thinking about developing a reef controller using a PC.

The cost of the hardware would be fairly inexspensive and would hopefully be able to offer the program to everyone as freeware!

I just need some ideas.

First what should the program control?

Lights, heater, ORP, Co2???

I think I would probably have charting features and other various things.

I think some of the control systems might need to be redundant to avoid disaster....


Maybe this has already been done, I'm not sure. If so lets improve on it.

BeanAnimal
01/05/2008, 03:48 PM
Dustin,

I have done exactly what you are looking for...

The platform was orignally VB, but I migrated the application to VB.NET. The core of the program was complete and I was adding "features" when I decided to scrap the project.

My software worked with

X-10 outputs
PCI/ISA I/O cards (NUDAQ, 96 bit)
1-WIRE
USB (Phidgets, activewire)
and a few other things.

I never built some of the specialized PC boards for current monitoring (per device) and other things like that.

PH, ORP, SG, Lumens, sunrise/sunset, moonrise/moonset, web interface, alarms for just about any situation, SMS messaging and voicemail, DTMF control and telephone based reporting (call in and get system status over the phone). And a dozen other things.

Here is the bottom line... The more complex the program became the more clear it became that stability would be an issue, as well as maintenance and upkeep of the code and hardware.

I have since abandoned the project in favor of an AVR based light controller with a stand alone temperature controller and other stand alone devices for monitoring and reporting.

If you go the PC route, I would suggest monitoring only and leave the control up to dedicated devices or a regression tested controller :)

Dustin_p
01/05/2008, 05:49 PM
Well that in a nut shell is what I was going to do in VB.NET.

I think I might just go with some stand alone systems then.

Do you still have the VB code??

Might be something to look at :)

BeanAnimal
01/05/2008, 06:54 PM
I still have the code... I am am not sure it is something I am willing to share in its entirity though. The Sunrise/Sunset and Moon phase calculations where adapted by me and took a LOT of work and research. The DTMF, SMS, TCP/IP, TAPI, and other interfaces are based on referenced 3rd party controls that I can not distribute. I also put a LOT of work into the real time threaded event scheduler (adapted from some code found on the web).

I may pick the project back up one day, but for now microntrollers have my interest. I am using an Atmega128 with BASCOM-AVR as the language/IDE platform. I have about $300 in the current project and intend to have it up and running within 60 days. It is 50% finished now but I am working on the touchscreen code, a little bit at a time.

dixonjk
01/05/2008, 07:55 PM
I am currently building a control system for my tank. I am using LabVIEW. If anyone is interested let me know and we can work together. I can show you were to get the software cheap. I bought all industrial electronics from Ebay. And I dont care who gets a copy after its finished... its not an FBI project!

jcm2m9
01/05/2008, 08:34 PM
<a href=showthread.php?s=&postid=11530086#post11530086 target=_blank>Originally posted</a> by dixonjk
I am currently building a control system for my tank. I am using LabVIEW. If anyone is interested let me know and we can work together. I can show you were to get the software cheap. I bought all industrial electronics from Ebay. And I dont care who gets a copy after its finished... its not an FBI project!

I would be very interested in the LabVIEW code. I have some experience using LabVIEW in a few classes that I took.

rsw686
01/05/2008, 10:42 PM
BeanAnimal I agree with you that the VB.NET project was too complex and could pose stability issues. Personally I wouldn't want my reef tank running off a Windows box with the .NET language which is interrupted at runtime. That's just too many levels for comfort.

I would take a small linux or freebsd distro with controller software written in C. You could use a WRAP board, commonly used for small appliances like routers (pfSense project), which are reliable, use little power, and have no moving parts.

http://www.pcengines.ch/alix.htm

BeanAnimal
01/06/2008, 12:08 AM
No dixon, it is not an FBI project... On the other hand, some of the code is fairly advanced and took a lot of work to write. I am not sure that I have aspirations to profit from the code, but I certainly do not want to give it to somebody else so that they can.

I give plenty away for free as it is...

Several folks here use LabView on a daily basis. Some use PLCs and others custom built micros. As I mentioned, my current controller is based on an AVR. The interface is a touchscreen. For the time being it only does sunrise/sunset (on off, 0-10V dimming). As I expand the software, it will do much more, including temperature, PH, Feeding, dosing.... etc.

RSW... I am not big on C anymore. It is powerful but I still can't stand it :) I am also not a linux fan. BASCOM is pretty damn powerful and if I need to do more, I will use ASM. I

dixonjk
01/06/2008, 08:11 AM
I am not sure how someone could profit from the code really. I assume it would be hardware specific and coudl only be used as an example to help others. I want to add a touch sreen too! Do you have any pictures of your setup?

BeanAnimal
01/06/2008, 08:57 AM
Much of the code is NOT hardware secific. The solar and lunar calculations could be easily ported to numerous platforms. Moreover, I have compiled mine into a DLL that could be used across many platforms. The VB.NET GUI was designed to be used with a standard 800x600 LCD touchscreen as found in POS systems. In a PC based system, a standard LCD toucscreen will respond to mouse clicks. The idea is to make the buttons large enough to be useable with a finger.

Here is an early screenshot
http://www.reeflogix.com/images/rc/reeflogix/sunmoon.gif
You can see timer events for
Astronomical Twilight Begin
Nautical Twilight Begin
Civil Twilight Begin
Official Sunrise
Solar Noon
Official Sunset
Civil Twilight End
Nautical Twilight End
Astronomical Twilight End

As well as configurable set of intervals between each event. Each event can be assigned to any number of functions, including on/off for specific relays or dimming steps/stepper motor positions.

The new toucscreen is much smaller. 240x128
www.ledsee.com

No photos of the project yet.

dixonjk
01/06/2008, 01:00 PM
Very nice! I did not realize who you were at first. I seen the pics of your tank on a post you made about stand pipes. I had alwasys wondered is the network type rack of wires in that pic was for the tank, I assume its not?

Have you heard of Adam modules? Thats what I am working with now. I am thinking about getting the LabView SCADA pacage, I think it may be the best way to make a full graphic control?

by the way I have tried to send you a message before but your box is always full.

BeanAnimal
01/06/2008, 01:56 PM
The rack has nothing to do with the tank. It is a termination point for the Cat6 cabling in the house. This panel feeds the phone system (currently an Avaya Partner ACS that will be upgraded to a Cisco IP phone system) and the ethernet network in my home. It also holds the phone system, ethernet switch, DirecTV multiswitch and distribution panel as well as a power distribution module for UPS power to the network equipment.

Yes the ADAM modules are nice. LabView can get expensive but it is nice software. There are a few dozen SCADA packages available. Some are MUCH more graphics friendly, but very spendy. I am bidding a job with one such system right now. I will get the name of it when I get home... it may be worth looking into for ideas.

Box full? Yeah, the hate mail piles up as fast as I can delete it!

dixonjk
01/06/2008, 03:19 PM
If you want a cheap source of LabVIEW, email me at dixonjk@earthlink.net. Thats quite a fancy network system for a house! I want one!

BeanAnimal
01/06/2008, 04:03 PM
Not really that fancy... when I rewired the house, I pulled a few CAT6 and RG6 runs to each room. I am an IT consultant by trade and build network infastructure for a living anyway :)

The Home Theater wiring is much more "fancy" and was done with mini RG59 cable (Belden 1855A) and some fairly nice speaker wire and other signal cabling. It terminates in the theater rack adjacent to the other wall of the room.

dixonjk
01/06/2008, 04:12 PM
I must have $700 in Monster cable on my TV, I assume it made it sound better!

I am looking for soem 3-phase motors and can not find any small ones. I am wanting to convert a Hammerhead for my main pump and a Dart for my skimmer pump. Can you tell me where to get them?

BeanAnimal
01/06/2008, 04:22 PM
I will not comment on the cable other than saying that as long as you are happy with it, then all is well :) If it is lamp cord or Kimber cable... the only thing that matters is the happiness of the guy who paid for it.

As for the 3-phase motors... I don't have any great sources other than searching eBay and using google :)

dixonjk
01/06/2008, 04:28 PM
Well the cables are nice and pretty atleast! And I had a BestBuy gift card... I would not pay that much for cables otherwise.

Darroll
01/07/2008, 06:11 PM
When I was in the Air Force I wrote a program to calculate the sunrise and sunset and although I don't have the code anymore I can tell you that it is a comon algorythem on the net. Some only work for certain hemispheres. Here is a link that you can grab the source code from several different languages. If you need help converting it to C# I can help.

http://www.sci.fi/~benefon/stuff.html

I'd be interested in a plugin based web application that was open source. I am a C#/.Net programmer by trade.

dixonjk
01/07/2008, 10:18 PM
For my X10 home automation program there is a plugin that links to a news type website that will give you the sunrise-info.

I guess everyone has seen this http://www.automatedaquariums.com/ ? They have opensource VB software, you just have to buy it.

BeanAnimal
01/07/2008, 10:39 PM
Darroll, thanks for your service.

Yes, there are several common methods to calculate the position of solar objects. Most of the common ones get pretty fuzzy at certain times and locations.
http://www.bodmas.org/kepler/sunrise.html
http://www2.arnes.si/~gljsentvid10/moonrise.html
http://www.stargazing.net/kepler/moon.html
http://www.skyandtelescope.com/resources/software/3304911.html
http://www.bythom.com/calculate.htm
http://personal.inet.fi/cool/jjlammi/stuff.html

I have about 200 more links... many of them good.

You can also cheat and scrape the data fron the USNO website. They even have publish information on exactly how to do it.

customcolor
01/07/2008, 11:51 PM
y cant you use a Serial Port Relay Board and a simple program that most people provide to do the timmers with out the sun and moon thing going on. i have seen some programs that can do at 1 sec intervals.

Icefire
01/08/2008, 05:36 AM
Unless you have an independant controller, a PC controled tank will never work as as soon windows is gonna crash our you gotta have a reboot, your tank will close.

BeanAnimal
01/08/2008, 07:11 AM
A dedicated windows machine is not that bad. I have systems up for months at a time without a crash or reboot.

If you want to use a PC, you should be looking at a MiniITX motherboard with a Core2 CPU and intel chipset.

On the other hand, a dedicated microcontroller is magnitudes more reliable.

Darroll
01/08/2008, 07:16 AM
I've been programming on both linux and windows for years now (since 95) A properly configured install of Windows XP or 2000 is as stable as linux, though a dedicated controll board would be better.

For a cheap way of doing automation look into x10. They have a module that will run macros while the computer is off. Just create a program to update that box with updated times etc.

There was/is a forum where people were creating/talking about a dedicated controller. RC3A forum. These things don't ever seem to take off. I'm guessing that those that can do it don't want to give away their hard work. Glad programmers aren't like that. :)

Also if you don't like X10 look into Phidgets but they don't have a stand alone board. also look into the link below.
http://www.automatedaquariums.com/

Hope this helps someone.

BeanAnimal
01/08/2008, 07:28 AM
The phidgets are nice devices and a much better idea than x10.

X10 has no feedback or fault tolernace. It is a broadcast protocol. If a device does not respond, the controller has no way of knowing.

It is not that people do not want to share. These "projects" get complicated becasue everybody and their brother does nothing but add feature requests. The projects get mired in talk instead of action. If somebody makes a decision on a feature, those who do not support the idea drop off the project. In the end only a few people stay interested and the project fades into oblivion.

ShawnJones
01/08/2008, 09:27 AM
Dustin, I too looked into this and started the project about 6 months ago. What I ended up with was very similar to BeanAnimal's design. AVR uC, solar/lunar calculations, GUI, etc. What I found to be the easiest way to incorporate a remote PC into the equation was by implementing TCP/IP into the design and creating a web server on the controller, then controlling the system via PHP.

BeanAnimal is right about his last statement, there are more people that want to add new features because it's cool and not enough people that design with embeded systems and electronics. Projects generally loose community support quickly after this point.

Good luck in your design, I feel that it's much better to pick one single feature and concentrate your efforts to that aspect, once it is stable go to the next, try to limit yourself, not to include the kitchen sink and get lost in code and hardware.

BeanAnimal, wish I would have realized you project efforts, it would be a great project to work with someone on.

Shawn

BeanAnimal
01/08/2008, 01:41 PM
Shawn... I am working on adding the Wiznet unit to my AVR. I am fairly new to microcontrollers and am working in BASIC (BASCOM). I would certainly like to compare notes with you some time. The current phase of the project is getting the I2C DACs working for 0-10V signaling (dimmers, VFDs, etc)

dixonjk
01/08/2008, 02:23 PM
What VFD's, pumps, and motors do you use? I am currently shopping.

BeanAnimal
01/08/2008, 03:05 PM
The Yaskawa drives are pretty nice, but very expensive. You can get cheaper stuff at automation direct. As for motors, baldor is a good choice.

dixonjk
01/10/2008, 07:57 PM
I found out that I have to convert my Sequence pump from 56J to 56C frame inorder to find a 3phase motor to fit it. Seems that smalle motors are hard to find. Trying to buy on Ebay makes it more limited. The pump comes with a 1750 rpm motor, do you think it would be okay with a 1100? Also what effect would I see if ran a 1/3 hp motor on my 1/4 VFD?