Updates from March, 2011 Toggle Comment Threads | Keyboard Shortcuts

  • Chris Piuggi 11:22 pm on March 10, 2011 Permalink | Reply  

    Ethernet to Server 

    Writing temperature and light values to a storage file.

    http://www.piuggi.com/sensorData/storage.txt

    Php Script

    put this script on your server which supports php.

    <html><body>
    <?php
     $light = $_GET['sendLight'];	$temp = $_GET['sendTemp'];
     $test_string = sprintf("We work work work work work work work, the whole day through...");
     //print the date
     $day = date('m/d');
    
     //print the time
     $time = date('H:i:s');
    
     //format them into an xml style
     $data = sprintf("\n<entry> \n <day>%s</day> \n <time> %s </time> \n <light> %s </light> \n <temp> %s </temp> \n</entry>\n",$day, $time , $light, $temp);
     //tell the server which file to open
     $filename = "storage.txt";
     //command it to open in order to append
     $file = fopen($filename,"a");
    //write our data string...
     fwrite($file, $data);
     //and we out.
     fclose($file);	?>
    
    <p> <?php echo $test_string ?> </p>
    
    </body>
    </html>
    

    Arduino Side of things
    Download here >

     
    • scottpeterman 1:40 am on March 11, 2011 Permalink | Reply

      Thanks!!!! Super helpful, the mac seems to be pretty weird with direct fwrite/fread to the arduino over serial (plus a lot of user error as well I’m sure), I kinda want to just pick one of these up…

  • Thom Hines 11:16 pm on March 10, 2011 Permalink | Reply  

    Takin’ it all the way: Sleep Mode and Direct Activation 

    Today’s lesson covers two unrelated, but very practical subjects.

    First off, we’re starting with enabling sleep mode on our end device XBee’s. This essentially will power down our remote devices on a regular cycle to save power and make our network slightly more efficient. We’re going to be using the same thermometer circuit that we worked with last week. Here is a diagram of the circuit you need to (re)build:

    Thermometer Diagram

    In order to enable sleep mode on the device, we’ll have to bring your Router into CoolTerm, and set up a few AT parameters there.

    From here, we’re going to be using the same Processing code to read all the various thermometers. Easy! Done!

    The direct activation project is basically the thermometer project in reverse. Instead of reading from each of the routers, the coordinator (hooked up to a Processing sketch) will be able to turn on and off various devices remotely. Here’s the circuit you’ll want to build:

    Actuator Diagram

    The LED on the board represents the device we’ll want to turn on and off.

    The Processing sketch we’re using can be found on the O’Reilly site here (contains several assets).

     
  • scottpeterman 11:12 pm on March 10, 2011 Permalink | Reply  

    1/2 way there 

    So I am attempting to talk directly though the xbee coordinator into php, storing to a mysql database, so the info will be live viewable and the sensors will be controllable from the computer or mobile device.

    I worked off of this project using LCDs and xbees

    The toggle switch webpage works like this…

    <html> 
    	<head> 
    		<title>TEST</title> 
           	<style>
    		  p { color:red; margin:5px; cursor:pointer; }
    		  p .toggleon { color:red; margin:5px; cursor:pointer; }
    		  p .toggleoff { color:red; margin:5px; cursor:pointer; }
    		  </style>
    		  <script src="http://code.jquery.com/jquery-1.5.js"></script>
    		</head>
    		<body>
    		  <p class="toggleon">TOGGLE ON</p>
    		  <p class="toggleoff">TOGGLE OFF</p>
    		<script>
    		    $("p").click(function () { 
    		      $(this).addClass("click").load('ledOn.php');
    		 	location.reload();
    		    });
    		</script>
    
    		</body>
    		</html>
    

    (More …)

     
  • lpercifield 11:10 pm on March 10, 2011 Permalink | Reply  

    Xbee to the interwebs 

    This slideshow requires JavaScript.

    http://lpimaging.net/xbee/dataFile.txt

    This uses a Digi ConnectPort x2 module that connects directly to my xbee module.

     
  • andywallace 11:05 pm on March 10, 2011 Permalink | Reply  

    Code for today 

    HERE IT IS

    And here are the slides!

     
  • thisisvictorkim 10:31 pm on March 10, 2011 Permalink | Reply  

    “temperature” sensor graph 

    (note: “temperature” because I still need to adjust my thermometer, so for this example I was using light sensor.  a light sensor may be used for the final iterations)

    sensor values are plotted to randomly plotted circles’ color.  over time this will create a collage of (hopefully) consistent colors.  If the temperature sensor is moved around to different climates then it won’t be a consistent color.  if I add a light sensor, it’ll get variance from the lights in my room being turned and off. so in theory i should get a nice collage of complimentary colors.

     
  • breegeek 8:27 pm on March 10, 2011 Permalink | Reply  

    Surprisingly… 

    http://technabob.com/blog/2011/03/10/ipotti-bathroom-monitor/

     

    wow. just. wow. O_<

     
  • Lee 7:24 pm on March 10, 2011 Permalink | Reply  

    visualizing temperature data part1 

    This is iteration / step 1. Get some data from a wireless sensor and write some simple program to visualize it. I started simple since I’m a little rusty with processing. I need to see if there are any XBee libraries for codeBlocks or OF, processing just isn’t going to cut it.

    Anyhow, I started first by building up the look and creating a simple system for how incoming data would affect the chart. I got this setup before even touching my XBee’s, I simulated incoming data with a button press and spitting out a random temperature.

    Once I was happy with the look and feel I worked on hacking it together with all the XBee Sensor Network code which was actually a lot less painful than I imagined it was going to be. I’m not quite sure how to put the XBee’s into sleep mode yet, so the longest interval I could sample at was once a minute.

    I stuck the sensor and battery pack outside my window to track the temperature outside to test it out.

    I scaled up the chart and let it run for two hours.

    The initial warmer temps was residual heat from being inside. I checked my readings against what the internets were telling me was the current temperature and my little sensor proved to be pretty accurate.

    Good stuff so far, next iteration I’ll make a more interesting visualization and pull in data from another sensor or two. I’ll also make the program slightly interactive with some rollover info or make it clickable.

    (More …)

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel