Howto: Use a Linksys Router as Wireless Reef Controller - WRRC

BeanAnimal said:
anybody get a power monitor working yet? I looked at the national designs... but have yet to wind my own 1800:1 current transformer... hrmm wonder why :P

There has got to be an easier way! I have a garbage UPS (cyberpower) that reports current draw via the serial port. (as do most UPS). I think I will hack into this thing.... unless somebody else wants to revers engineer it.

Bean

Dallas makes a couple 1-wire chips that monitors current & voltage: (DS2760 DS2761 DS2762) all are made for High-Precision Li+ Battery Monitoring. I would think we could use these?

http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3950

I was trying to look up the PH voltage put out by the probe circuit, and I thought it's pretty low. (can't remember exactly off the top of my head).

I think interfacing the DS2762 & PH circuit for correct voltages will be the challenge.

????
 
Darn you, thats my idea!!! :)

BTW, for anyone interested in the Bay Area, I started a group off of the Atmel avrfreaks.com site, though it is still not really doing much of anything.

http://microcontroller.meetup.com/2/



BeanAnimal said:
geze.. I just purchased a atmega128 and have been pouring through a ton of dallas datasheets.....


and threw out a bunch of the same APs the other day.... never occured to me to hack them.

Keep us informed, I would like to know how the 1 wire stuff works out.

As a side note... can somebody come up with a ammeter circuit to monitor the power consumtion of devices and send it to an A/D for logging?
 
did you get a price for the CT? I found a place that will wind custom toroids 2 for $10 plus materials or something like that.

http://www.adsinfo.com/quickcoil.html

I need to find a way to do this cheap, as I want to monitor each device and it's current draw.

LIEBERT makes power strips that monitor total draw for the strip. The strips are ethernet enabled and use SNMP to report paarameters. They are kinda spendy $500+ I think.
 
Code:
 	 1   	 100   	 250   	 500   	 1,000   	 2,500   	 5,000   	 10,000+
CS2106 	$ 7.50 	$ 6.40 	$ 5.10 	$ 3.60 	$ 3.32 	$ 3.10 	$ 2.80 	Quote

Wasn't sure if that is the right one, but there's the price for that one.

Or maybe hack a Kill-A-Watt if they are only $29, can probably take the line to the LCD

There is also a Watt's Up device that has serial outputs for data logging. $139
 
Maybe we are making this to hard. A CT gives of a secondary voltage directly proportional to the current drawn through the primary. Why not just use a CT and a ADC to measure current draw. The urrent to voltage relationship is nearly linear isnt it? The IC and OEM devices were are looking at contain tons of logic and/or software to calculate true RMS and Reactive power loads as well as billing and time based calculations. They are also designed to be highly accurate for billing purposes... not to mention tamoper proof. We just want a simple "meter" for nothing more than eye candy and a quick indication that devices are working within parameters. WE don't need to sort out reactive and real power issues, as we are not trying to use this for billing.

A 1 wire ADC would suffice. Something like the DS2450

I just ordered $200 worth of transistors for an AMP...soI am outa the game for a few weeks. Still need a 1.5 kVA toroid and a billion uF worth of filter caps..... so I am broke!

Bean
 
I should be getting my WRT54G sooner than expected. It UPS says it'll be here tomorrow but I give it until friday (1/22/05) if they need a signature.

My first goal will be hacking the OS to make it accessible. That'll be a hurdle for me since I'm just installing Cygwin on my PC to play with linux for the first time.

Onece I get it I'll try to start playing with the setup to see exactly how we can build the web front-end using the httpd-mini and CGI scripting.

barebottoms has some great starter info up over at www.bytality.com/wrrc/
 
I am getting sucked in.... just started my uC project and my huge amp project and now a this? Did I mention I am building a kick *** regulated bench supply.... and that I hate linux....now I am going to have to learn to use it and remember how to program in C

is there plans to build a gui for this thing? .... I am gettin sucked in. geeze

Bean
 
I've played with the firmware some the last few days, I should one that all you have to do is upload to the router and it will give you telnet access and the owfs software.

One of the problems is that I'm running low on flash without stripping any of the original Linksys code.

To deal with this, I've made the firmware auto mount nfs for now so you can always load additional programs via NFS.

Long term, I hope to get rid of one of the httpd servers so get some more space back.

Bean,

With bigreddastud's help, I should be able to do web page configurations. I can put a MicroGUI as a package, but I'm not sure what that will really give you at this point other than a Fancy X-Term.

I'm not really doing any work in C, which is good because I'm really rusty. Most the work is via the canned packages, I'm just writing shell scripts and cross compiling other code at this point.

Slowly getting there. I have a few sample scripts on the Wiki site, the majority of the work is just that, shell scripts.

Nice link for the cap sensor. I'll have to look at it in more detail and figure out cost. The QProx sensor is only $4, but I need to look into what support parts it needs. Unless someone knows off hand. I think the QT113 is the part number.
 
Okay after an evening of research...

the qt300 chip from qprox ($4) is a capacitance to digital converter. This thing has a 1 wire uart built in! The "capacitor" can be to plastic rods held close togher and the depth of the sump (or whatever level needs measured).
Sorry if you guys already figured this out.
 
Some updates.

There is a company making ready made Interfaces as a Kit or as a complete unit for the WRT54G now.

I've been testing a PAR/LUX meter and it works pretty good. Side note, anybody know of any type of Scalar references for these things? It is basically a PhotoDiode connected to a DS2438 and I get a current output.

I have a firmware available that you can put on the Linksys with the linux shell enabled, some mods to busy box. pesudo rc system and a auto mount NFS for development. Even tested it on Windows.

I really can not believe how easy OWFS is making everything. Even doing memory writes to EEPROM, all I have to do is
echo "DEADBEEF" > page.3
No CRC calculations or weird headers to figure out.
 
Is there a 1-wire i/o board out there can monitor analog inputs (i.e. regular probes that most of us are using now). I'm in the process of designing a plc controlled reef controller, but this sorta caught my eye. I know theres a few 1-wire i/o cards with digital inputs floating around, but I couldn't find one with analog inputs.
 
Waiting on probes, so I thought I'd play with different sensors and get performance data. Keep in mind everything is called from a shell script, and I really beat up the system by making it call each request (include system time, etc) for every parameter I read.

Code:
 / $ cd /var/wrrc/
 wrrc $ time -v ./temp-1run.sh
Temp Sensors -----------------------------------------
     65.1875 10.1FBB4D000800 collected @ Feb-02-2005-10:42:29
     67.2125 10.AEB44D000800 collected @ Feb-02-2005-10:42:31
------------------------------------------------

DS2438 Devices photo/humidity ------------------------------
           0 current collected @ Feb-02-2005-10:42:32 -- 26.1A785B000000
           0 VAD collected @ Feb-02-2005-10:42:33 -- 26.1A785B000000
           0 VDD collected @ Feb-02-2005-10:42:34 -- 26.1A785B000000
         NAN  Humidity  collected @ Feb-02-2005-10:42:36 26.1A785B000000
          32 Temp collected @ Feb-02-2005-10:42:38 -- 26.1A785B000000
-------------------------------------------------

           2 current collected @ Feb-02-2005-10:42:39 -- 26.646D5B000000
        0.05 VAD collected @ Feb-02-2005-10:42:40 -- 26.646D5B000000
        4.89 VDD collected @ Feb-02-2005-10:42:41 -- 26.646D5B000000
    -23.8293  Humidity  collected @ Feb-02-2005-10:42:42 26.646D5B000000
        66.2 Temp collected @ Feb-02-2005-10:42:45 -- 26.646D5B000000
-------------------------------------------------

DS2450 Devices ph/orp/conductivity ------------------------------
   0.0690636 volt.A collected @ Feb-02-2005-10:42:46 -- 20.D6E703000000
   0.0665635 volt.B collected @ Feb-02-2005-10:42:47 -- 20.D6E703000000
   0.0704698 volt.C collected @ Feb-02-2005-10:42:48 -- 20.D6E703000000
   0.0695323 volt.D collected @ Feb-02-2005-10:42:49 -- 20.D6E703000000
   0.0387506 volt2.A collected @ Feb-02-2005-10:42:50 -- 20.D6E703000000
   0.0362506 volt2.B collected @ Feb-02-2005-10:42:51 -- 20.D6E703000000
   0.0345318 volt2.C collected @ Feb-02-2005-10:42:53 -- 20.D6E703000000
   0.0351568 volt2.D collected @ Feb-02-2005-10:42:54 -- 20.D6E703000000
-----------------------------------------------------------

Repeating Loop

        Command being timed: "./temp-1run.sh"
        User time (seconds): 0.15
        System time (seconds): 0.85
        Percent of CPU this job got: 3%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 25.90s
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 0
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 2459
        Minor (reclaiming a frame) page faults: 1751
        Voluntary context switches: 0
        Involuntary context switches: 0
        Swaps: 0
        File system inputs: 0
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0
 wrrc $

And here is the script under test

Code:
 wrrc $ cat temp-1run.sh
#!/bin/ash
DEVICEPATH="/var/1wire"

#while :
#do # while do
 echo "Temp Sensors -----------------------------------------"
 for i in 10.1FBB4D000800 10.AEB44D000800

 #WC_temp_tank #temp_tank temp_hood #temp_sump temp_hood
  do # for do
     #DEVICEID=`nvram get $i`
     DEVICEID="$i"
     TIME=`date +%b-%d-%Y-%H:%M:%S`
      cat $DEVICEPATH/uncached/$DEVICEID/temperature ; echo " $i collected @ $TI
ME"
  done # end for do
 echo "------------------------------------------------"
 echo " "

 # 26.1A785B000000 humidity
 # 26.646D5B000000 photo
 echo "DS2438 Devices photo/humidity ------------------------------"
 for i in 26.1A785B000000 26.646D5B000000
  do # for do
     TIME=`date +%b-%d-%Y-%H:%M:%S`
      cat $DEVICEPATH/uncached/$i/current ; echo " current collected @ $TIME --
$i"
     TIME=`date +%b-%d-%Y-%H:%M:%S`
     cat $DEVICEPATH/uncached/$i/VAD; echo " VAD collected @ $TIME -- $i"
     TIME=`date +%b-%d-%Y-%H:%M:%S`
     cat $DEVICEPATH/uncached/$i/VDD; echo " VDD collected @ $TIME -- $i"
     TIME=`date +%b-%d-%Y-%H:%M:%S`
     cat $DEVICEPATH/uncached/$i/humidity; echo "  Humidity  collected @ $TIME $
i"
     TIME=`date +%b-%d-%Y-%H:%M:%S`
     cat $DEVICEPATH/uncached/$i/temperature; echo " Temp collected @ $TIME -- $
i"
     echo "------------------------------------------------- "
     echo " "
 done # end for do

 # DS2450
  echo "DS2450 Devices ph/orp/conductivity ------------------------------"
 for i in 20.D6E703000000
  do # for do
      TIME=`date +%b-%d-%Y-%H:%M:%S`
      cat $DEVICEPATH/uncached/$i/volt.A; echo " volt.A collected @ $TIME -- $i"
      TIME=`date +%b-%d-%Y-%H:%M:%S`
      cat $DEVICEPATH/uncached/$i/volt.B; echo " volt.B collected @ $TIME -- $i"
      TIME=`date +%b-%d-%Y-%H:%M:%S`
      cat $DEVICEPATH/uncached/$i/volt.C; echo " volt.C collected @ $TIME -- $i"
      TIME=`date +%b-%d-%Y-%H:%M:%S`
      cat $DEVICEPATH/uncached/$i/volt.D; echo " volt.D collected @ $TIME -- $i"
      TIME=`date +%b-%d-%Y-%H:%M:%S`
      cat $DEVICEPATH/uncached/$i/volt2.A; echo " volt2.A collected @ $TIME -- $
i"
      TIME=`date +%b-%d-%Y-%H:%M:%S`
      cat $DEVICEPATH/uncached/$i/volt2.B; echo " volt2.B collected @ $TIME -- $
i"
      TIME=`date +%b-%d-%Y-%H:%M:%S`
      cat $DEVICEPATH/uncached/$i/volt2.C; echo " volt2.C collected @ $TIME -- $
i"
      TIME=`date +%b-%d-%Y-%H:%M:%S`
      cat $DEVICEPATH/uncached/$i/volt2.D; echo " volt2.D collected @ $TIME -- $
i"
     echo "----------------------------------------------------------- "
     echo " "
 done # end for do
echo "Repeating Loop "
echo " "
#done
 
User time (seconds): 0.15
System time (seconds): 0.85
Percent of CPU this job got: 3%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 25.90s

Am I interpreting this correctly that even with the "taxing" system calls and a repearing loop, monitoring the 1-wire sensors is hardly keeping the CPU busy?
 
That is correct. And as you know, the current firmware I'm playing with is still a fully functional router, with all the UPNP and routing stuff still running.
 
The obligatory Screen Shot.
This is all running off the WRT54G router. Not another piece of $300 software connected to a client PC. I'm just pointing a browswer at the router.

15092screenshot-rc.jpg
 
Back
Top