Arduino board connected to router. 6 analog inputs, 2 relay outputs, software counter Example for data sent over serial interface every second: 6 analog inputs. Can connect to it PIR motion detector. Software counter. For counting Geiger counter clicks. Watchdog count. If Arduino has not received a command to clear watchdog for 5 min it disconnects router power for a second. Effective to keep router from hanging. Status of second relay for switching on/off 220V lamp over internet, to impress people. My experience. Need Arduino with old type of USB interface chip. The new are not recognized by Linux. Buy Duemilanove! Arduino hangs router if connected via serial port of the router. May be speed is wrong. Played around, but could not solve problem. Started to use USB-serial adapter. Communication with Arduino works. Do not neeed to set speed. -------------------------------------------------------- Some code concerning serial port, but not necessary fot USB-serial adapter. lsdev install apt-get install procinfo com port speed http://uavideas.blogspot.com/2009/03/change-serial-port-speed-on-openwrt.html opkg install coreutils does not work cd /home wget http://bobo.bash.fi/stty ./stty -F /dev/ttyS0 9600 opkg install kmod-usb-core kmod-usb-ohci kmod-usb-serial kmod-usb-serial-ftdi kmod-usb2 http://www.arduino.cc/playground/Italiano/Avrdude-openwrt -------------------------------------------------------- ######################################################## # Arduino analog input as a software counter, # for example motion detector, Geiger counter, electricity meter, etc. # Program run in loop check Arduino serial output ######################################################## c1=$(cat /www/test1) while (true) do sleep 1 a=$(head -2 /dev/ttyUSB0) echo $a set -- $a t1=$1 if [ $t1 -gt 500 ]; then echo "alarm" $t1 c1=$(($c1+300)) echo $c1 else echo "quiet" $t1 fi #rrdtool update /www/counts.rrd N:$c1; echo $c1 > /www/test1 done ################################## #Once in 5 min ################################## c1=$(cat /www/test1) rrdtool update /www/counts.rrd N:$c1; # creates fraphs for motion detector click database rrdtool graph /www/counts1.png --start -1d --end now \ --vertical-label "Motion detected" -a PNG \ --upper-limit 30 --lower-limit 0 --rigid \ DEF:temp1=/www/counts.rrd:c1:AVERAGE \ LINE1:temp1#FF0000:"c1" \ GPRINT:temp1:LAST:"Last CPM\: %3.0lf" rrdtool graph /www/counts2.png --start -1w --end now \ --vertical-label "Motion detected" -a PNG \ --upper-limit 30 --lower-limit 0 --rigid \ DEF:temp1=/www/counts.rrd:c1:AVERAGE \ LINE1:temp1#FF0000:"c1"