-
This section will help anyone interested in building their own WRRC get up to speed on where we are with hardware, etc. The goal of this is to give an overview of the steps involved and more detail will be added in the future. It assumes you know some basic computer skills, and if not then you are willing to learn and so some reading. Obviously your proficiency level will dictate the speed you pick things up but we want this project to eventually be repeated by anyone with the desire to learn. As an end user, you will just download the software and configure for your needs.
Summary To Do list:
Get yourself educated
- Learn or refresh on some basic linux shell navigation and interaction.
- Read up on linux shell scripting
- Read up on 1-wire devices
- Read up on One Wire File System (OWFS) on owfs.sourceforge.net which is the software controlling all the 1-wire devices.
Get yourself some hardware
- Buy the Linksys WRT54G router "brains"
- Order 1-wire sensor conponent free samples from Maxim or buy them from mouser/digikey/etc
- Either build or buy yourself a serial to 1-wire interface
- Either buy or build a 1-wire general I/O board
- Get an x10 Powerlinc interface if you want one
- Buy your PH probes
Getting started with linux
First, what's your computer skill set? At this point in the project Programming knowledge is very helpful, and knowing how to get around in the Linux shell is even more helpful. I had never used linux before starting, but was pretty decent in good ol' MS-DOS, so knowing that is 80% as good as linux shell. Programming control is done using simple linux shell commands. This is a pretty straightforward language and yet quite powerfull to boot. I suggest checking out a book from the library or else google is kind enough to provide tons of tutorial material.
Here's the first linux tutorial I went through if you need it: http://linuxsurvival.com/index.php?module=ContentExpress&func=display&ceid=1&meid=-1
Just google for free linux tutorial or something and start reading up on it is the first step. If you can get a handle on this, then you should be able to hold your own and should continue. If this step scares the pants off you, then wait for a while until we can develop a user interface that requires less linux knowledge.
Learning more background info
I suggest you read up on 1-wire devices a bit if you can as well. It's not required since OWFS takes care of all the confusing communication, but it's useful to know this background and setup your sensor network correctly.
OWFS is what encapslates the low-level programming required to communicate with the 1Wire sensors. It's very slick and is an opensource project listed over on sourceforge.net (an awesome resource for tons of great opensource projects). It makes the sensors behave as regular old tree/file structure and is the backbone software making this project possible. I suggest you read up on it over at owfs.sourceforge.net since knowing how to use it will help you out greatly later.
Something else that may be helpful before you start is to read up on whatever you can from this website. It'll give you some good resources and also a base to start from. It's not required or anything but will probably help you out.
Buy yourself the router "brains"
Since you survived all that, the next step would be to get yoruself a router. Linksys WRT54G. It runs $60 at amazon and $50 at buy.com after $10 rebate. Pirces at local stores are similar to slighly higher + tax. There's also a WRT54gS (with speed boost) but stay away from that one since is slightly different and will only complicate things for now.
Get the router and upgrade to the custom firmware found in the DownLoads section. After that you'll have a telnet accessible shell where you can play and use anything you've been learning with your linux reading/tutorials.
Quick Start.
Download the firmware and install with these instructions:
http://bytality.com/wrrc/code/INSTALL
Install the base webinterface package
Add packages via the web interface.
As soon as you get the firmware installed you want to set a very inportant NVRAM variable that may save your router's life some day.
At the shell prompt, type the following 3 lines:
nvram set boot_wait=on
nvram commit
reboot
This tells the router to optionally wait for a remote upload of a firmware right before it boots. This means that if you happen to screw up the firmware or something really badly, you can still re-upload a working firmload without merely converting the WRT54G into a $60 doorstop. I recommend you ensure this NVRAM variable is set to ON? every time you change the firmware just in case. To check it type:
nvram get boot_wait
and it should return "on" if not, you need to reset it, then issue a NVRAM commit & reboot.
Serial background info
In serial communications, the idea is to raise and lower voltages to represent 1's and 0's. Traditionally, RS232 such as on a PC defined the 1 as 8 to 12 volts. As devices became smaller and drew less power, manufacturers started lowering the voltage to represent a 1. It didn't make sense for them to put on a 12 Volt power supply when everything else on the board runs at 5 volt or less.
The WRT54G is in the category of the newer TTL (3.3 volt) serial.
Console port
This interface is important for giving us a Console access to the router and also if we plan to use serial devices from the router's perspective.
As an example, the host of this server asked if X-10 was possible. I did a quick test and managed to compile Bottle Rocket (an X-10 software package) for the router. It seems to work. So for the router to talk to the X-10 network, we will have to run the X-10 interface off a RS232 port on the router.
The 1 Wire interface is TTL and will be running on the second serial port.
Overview:
We will make a RS232 to TTL serial converter (12 volt to 3.3 volt) so we can use a PC's terminal program to debug and recover in case we put on bad code, lose network connection and other disasters.
TTL serial ports are common enough in most devices now a days that I decided to make an externally powered Dual Serial converter from a MAX232. Most of the plans you find on the net are usually self powered by stealing power from the PC's RS232 or the device. This is handy if that is all you want the converter for, I wanted a generic converter in case I wasn't interfacing one side to a PC, plus I also needed a regulated 5 volt supply for the DS2480b? 1-Wire to TTL chip anyway. This design will give me power for other devices, is generic enough to use on any device that I need a TTL to RS232 converter on (cell phones, TiVos?, DSL modems).
Build/buy the 1W to serial interface
There's two ways you can proceed: building or buying. You can build youself a basic interface as some have done with info found here --> ConsolePort and here --> Wire_TTL_Interface . If Can't or don't want to build them, you can buy them on a limited basis from http://springbokshop.com . The parts you want are the LP? series. The interface isn't currently listed on the site so you'll have to email them and ask them about the LP-LINKSYS-1W? board. Also if you want to buy an LP-IO? board from them it will be used to get input from all the pH/ORP/salinity probes later so you can buy them both now and save on shipping. One note on the supplier, these are manufactured in small batches, so they may be out of stock, but the owner will try to work with you as much as possible.
Next you'll need to open up the WRT54g and void your warranty. I always figure you aren't really using something unless you've found a way to void the warranty anyway, but there's no way around this. Poping it open is simple and doesn't even require a screwdriver. Just knowing the trick is all you need. 'Void Main' shows you the disassembly in his details on reviving a "bricked" router or one that's completely hosed.
Now you need to solder a 10 pin header onto the router board for the serial connection. This is really the only thing you have to do to the router's hardware right now. Rob Whitby shows great pics of the process on his site: http://www.rwhitby.net/wrt54gs/serial.html Some more help on adding the serial header to the board can be found on the ConsolePort page. It's fairly easy just keep the heat low and don't go nuts on the amount of solder you use.
Next you'll mount your serial/1Wire interface in the rounter and close it back up. You should now be able to connect 1Wire sensors to the router and read their status using OWFS
Get your basic 1-wire components
All the sensors are based on the Dallas Maxim 1-Wire protoacol. Maxim will send you 6 free chips per 3 months or something. They do it to get developers to prototype with their products. [insert ethical speech about not abusing this service here].
For a list of components supported by OWFS check here: http://owfs.sourceforge.net/ow_table.html If you are going to build the 1W/Serial? interface you want the DS2480B? for sure since it's the crossover brain between serial and 1Wire communications. What to sample depends on what you want to do, but I suggest getting temp sensors DS18B20? or DS18S20? [ibutton or TO?-92 version] , the Quad A/D converter (DS2450) and whatever compatible devices you think you will use.
Adding x10 control
This is a newly added feature and uses x10 drivers from the WISH project again from sourceforge. (wish.sourceforge.com/index2.html) You'll need either a CM11A or Powerlinc II serial controller. They run $20-$30 on ebay or other places. The CM11A suposedly has some reliability issues so I'll be using the Powerlinc, but the drivers support either with the same commands.
You'll simply connect the serial interface to the secondary serial port on your interface and issue commands to controll devices.
If you don't like x10, you may want to use 1Wire to control all your devices using relays. Those modules are available from http://springbokshop.com as well if you like. OWFS controls the relays instead of x10 if you choose this route.
Adding LCD(s) for display
OWFS supports displaying text on an LCD. It requires a controller board from http://www.louisswart.co.za/1-Wire_Overview.html and runs $16 + S/H. You can also buy the LCD (2 line x 16 chars) at the same place or try buying here http://www.hnqhlcd.com.hk/e-store/estore-character_lcm.htm for a 4x20 char display (model UC204A-YP-RB-N? at the bottom of the page). This LCD hasn't been tested just yet, but it is standard and should be compatible according to the maker of the 1W-LCD? controller. I'll post more on this when we can cofirm or disprove this.
Adding pH probes
You can buy any standard pH probe you like that has a standard BNC? connection. Several people have ordered from http://www.weissresearch.com/ and found a good price. If you can coordinate a group of local reefers, you'll get the best price, but they will likely still have good prices on small orders. I beleive you could also buy from any aquarium store you prefer as long as they are standard BNC? connectors on the end.
You could theoretically have as many PH probes on the system as you like, you just add the to the 1Wire network and since each 1Wire device has a unique serial number lasered onto it at the factory, any number of the same model device can be in your setup. Monitoring a display tank, sump, refuge, Calcium Reactor, salt water mixing bin, toilet, should be possible with the WRRC if you add the 1Wire devices for them all.
Measuring pH is still in development, but will be based on measuring the milivolts the PH probe puts out. More to come on this in the near future.
[More to come]
ConsolePort, Serial Converter, Power Supply
1_Wire_TTL_Interface:
LinuxAccess:
InstallingWirelessOWFS:
|