24 May

Greenfield Site Visit

greenfield_secretgarden

As detailed in a previous post, Greenfield Elementary School in Center City Philadelphia is one of the Water Department’s “green schools.” (It’s an environmentally conscious school in its own right, regardless of PWD’s designation, but the green stormwater infrastructure at the schoolyard is what connects the Solar Sunflower project to it.) Earlier this week, we paid a visit to the school during an in-service day (a day without students, when teachers receive some training) to present the project to the faculty and scope out possible spots for installation.

greenfield2

There’s good news and bad news about Greenfield, at least for the moment: On the challenging side, the main schoolyard and rain gardens are pretty much open to the public—the space is not gated or closed at night, so that leaves the Sunflower or any type of sensor setup vulnerable to vandalism. It isn’t a dealbreaker; we just need to invest much more time into securing sensors and electronics inside heavy-duty housing bolted into concrete or enclosed in a junction box.

Then we were taken around the side of the school and saw … the secret garden. It doesn’t contain green stormwater infrastructure, but it’s secured behind a padlocked gate and serves as an outdoor classroom for the kindergarten classes. Additionally, the library window overlooks the secret garden:

greenfield_window

This makes it possible to do something visual with the sensors in the garden—maybe an LED display lights up when the soil is dry, and students looking out the window can get the bat signal to go out and do some watering.

26 Apr

Philly Tech Week 2013

20130425_inq_gelles25-bImage: Philadelphia Inquirer

That’s my co-worker, PWD engineer Chris Bergerson, at the Switch Philly event this week. He got his picture in the newspaper because he happened to be standing near the sunflower at some point. Nice job, Chris. (But for real, thanks to Chris and Tommy Thompson for helping out.) This photo shows the head of the sunflower a little bit better—the Arduino and battery pack are inside a waterproof plastic snap case, with a hole drilled in the back for the sensor wires. We didn’t put a covering over the electronics, because we wanted them to be visible for now. (It also makes it easier to access.)

Chris Nies, Kevin Clough, Jason Blanchard and I did a five-minute presentation and complete demo of the Solar Sunflower. We put the sunflower in a bucket of soil, poured some water into the bucket, and watched (apprehensively—soil moisture is not the most dynamic thing in the world) as the website updated data values in real time. A total success, and we took second place in the competition. Congratulations to the winning team (Temple MESA), a group of students who devised a tutoring application. Here’s some more coverage on Technically Philly.

Here we are at Switch Philly, with the sunflower doing a total eclipse of Tommy’s head.

PhillyTechWeek

19 Apr

Solar Sunflower Comes Alive!

OLYMPUS DIGITAL CAMERA

It’s alive!

It’s not really alive. But it has been built—just in time for next week’s demo at Philly Tech Week. The sunflower was built with the generous assistance of PWD aquatic biologist Jay Cruz and Drexel University student Tommy Thompson, who’s currently a co-op with our Watershed Sciences group. It’s heavy; it’s mostly made from repurposed metal pipes we had lying around in a PWD garage. We originally thought it might be made of PVC, but we already had the pipe, and PVC is difficult to paint (it requires roughing up the surface so the paint sticks). Let’s have a look at the construction:

sunflower_construction

Pipe sections and pipe fittings were assembled, with three cross fittings on the bottom for the three soil moisture sensors. The yellow cable at the top is a flexible gas hose from Home Depot, the kind that attaches to the back of a gas stove.

sunflower_roots

A closer look at the “roots.” The wires from the sensors thread up through the pipe/”stem.”

sunflower_drill

The head of the sunflower is a cheap mixing bowl from IKEA, drilled through the center to attach it to the flexible gas hose.

sunflower_head

A threaded gas connector holds the head in place. The tubing is a little too flexible; the head droops a bit but it can easily be stabilized with some rigid wire (like a length of coat hanger) or a pipe section around the hose that acts as a sleeve.

sunflower_paint

A quick spray paint of the head and flexible gas hose.

sunflower_petals

Found some yellow and green plastic containers at the dollar store; cut out petals and leaves from stencils; did battle with a hot glue gun. Arts and crafts is not our strong suit, but it’s presentable enough. Here’s the sunflower in my cubicle, freaking people out.

12 Apr

Web Display Mockup

phillywatersheds_screenshot

Here’s a quick mockup of a web page displaying data from the Solar Sunflower—none of this represents real data. It helps to visualize what the end product looks like, where the site lives (this presents it as a page on phillywatersheds.org, a Philadelphia Water Department website), and what features we want. Let’s break down what we’ve got so far:

  • A multi-line graph that’s updated in real time with soil moisture sensor values. Three data series, three soil moisture sensors. This sample image was generated using Javascript D3, a really powerful graphing library.
  • A “water me!” graphic. This could be something as simple as an image swap; when the soil sensors read below some threshold value for moisture, a raindrop appears. When the value is above the threshold, a green leaf is shown.
  • A map of locations of all the sensors. Although we’re only dealing with two sites at the moment (Greenfield and Nebinger Elementary schools), hopefully there will be a growing network of schools involved. By encoding latitude and longitude of each school, we can click on a point on the map and call up that school’s current data.
  • And finally, downloadable text or Excel files of the data. This doesn’t sound too exciting, but I think it’s where the in-depth educational value lies. Creating plots, correlating data, identifying trends, and analyzing statistics all rely on access to this raw data.
10 Apr

AT&T EduTech Hackathon

edutech_hackathon
Image: Technically Philly

This weekend, the Solar Sunflower project was selected as one of 5 finalists to advance to the Switch Philly event on April 23 and compete for a $5,000 prize. The field was narrowed down at the AT&T EduTech hackathon at Temple University on Saturday. Like TechCamp, the hackathon (organized by AT&T, Jarvus, Technically Philly and Temple’s Urban Apps and Maps Studio) focused on using technology to improve education. Some of the other projects included a mobile app that helps students find the safest walking route to school; a game app that uses a fantasy-football approach to tracking learning progress; and an app that connects students with tutors.

Not all our team was there, but Chris Nies and I were able to present a working demo of real-time sensor data being posted to the web in front of an audience and a panel of judges. It sounds pretty rosy in hindsight, but to be honest we spent hours just trying to send data via Temple’s WiFi network; these things happen. Thanks to Jarvus’ Chris Alfano and Technically Philly’s Brian James Kirk for their support and encouragement.

Here’s Technically Philly’s coverage of the event. We stole their photo of our box of Arduino stuff, above.

29 Mar

2013: A Hackerspace Odyssey

devnuts

We’ve been hacking at a hackerspace for our next hackathon. For me, the term “hacking” is one of the more egregious tech misnomers, because it seems to imply taking something apart. Of course, it used to mean something different (such as breaking into a computer system) but all I ever see at hackerspaces (places where hacking occurs) are creative people making new things by grabbing data from the web, modifying code and bending it to their will. Devnuts, in Northern Liberties, is where we’ve been gathering on Tuesday nights for the Code For Philly meetups. That’s not us in the photo of the Devnuts space above, but you can spot Code For Philly organizers Christian Kunkel and Chris Alfano (who also work at Jarvus Innovations). The Code For Philly meetups are a great way to get started on a project, learn a new tech skill, or just see what people are doing. The sense of community is amazing, and we’re grateful for all the time and resources that Chris, Christian and others put into organizing the event.

In addition to Devnuts, there are many other hackerspaces in Philly worth checking out. Last week, I visited Hive76 and spent a few hours soldering a circuit board. Thanks to those guys for their advice and letting me use their equipment. I hope to someday visit and use NextFab studio, which is more of a building/manufacturing space that might be useful when we start to build the sunflower and the waterproof housing for the sensors. I’m sure there are many more venues out there—many have an open house night or introductory workshops for the uninitiated.

Anyone who wants to keep up with the tech scene should bookmark Technically Philly. The site is fairly relentless in documenting all the events and news that involve local startups and tech projects.

But as mentioned before, there’s a hackathon coming up: The AT&T EduTech hackathon at Temple University on April 6. We’ve smoothed out the kinks in our code and have the Arduino posting sensor data to the website. On the wish list is a multi-line graph to plot the data in real time on the site.

22 Mar

Stroud Shout-Out

Better late than never, a large amount of inspiration for the Solar Sunflower project came from the Stroud Water Research Center, particularly this web page.

stroud_imageImage: Stroud Water Research Center

The image above from Stroud’s website illustrates just how far open-source consumer electronics have come; for a couple hundred dollars, you can build your own sensor network. This is something that was previously off-limits to most civic and non-profit groups—the commercial alternatives cost thousands of dollars. The freedom (literally) afforded by the low cost of these electronic components is important. Sometimes you only want to monitor for a short period of time. Sometimes you have no idea how a sensor will work until you try it out in the field. Sometimes you’ll need to customize your monitoring setup. Arduino and other similar microcontrollers are modular: Switch out the sensors, change the way you power them, try, fail, and try again.

Also worth shouting out is dontflush.me, another fascinating water-related project using real-time low-cost sensors. Arduino-powered sensors detect when a combined sewer overflow is occurring in New York City and lets viewers of the website know not to flush a toilet during these overflow events. (The logic is that flushing a toilet during an overflow would contribute more sewage to the overflow.)

07 Mar

Radio vs. WiFi

xbee        vs. wifi_shield

Pictured above, two ways to skin a cat. Or, in our case, two ways to transmit data from a sensor in the ground to a computer in the classroom. On the left is an XBee, a small radio that attaches to an Arduino via a shield; two XBees can send/receive data. On the right is the Arduino WiFi shield, which connects to the Arduino and sends data via an available WiFi network. After running into a little bit of frustration* with the WiFi shield at this week’s Code For Philly meetup, our group started talking about some of the fundamental decisions we made about data transmission. Below are some pros/cons for using an XBee (or a Wixel, or some other similar radio device) versus a WiFi shield. For the record, the cost is similar—a WiFi shield is $85, two XBees and its shield are around $75.

The nice thing about XBees is that they can be used anywhere. They don’t need access to a wifi network. You can also use multiple XBees to make a mesh network if, say, the rain garden is a good distance away from the school. (The book Building Wireless Sensor Networks by Robert Faludi is a bible in this regard.) On the other hand, weather—especially storms, when we most want to see the data—may affect the transmission. And XBees must be used in pairs, which means an XBee must sit inside a classroom, attached to a computer, to listen for incoming data. We realize that not every classroom has a spare laptop to dedicate to receiving a radio signal. With XBee, there are two legs to the journey from sensor to Web: data transmitted to a computer via radio, then data transmitted from the computer to the server via WiFi (or Ethernet or however that computer connects to the Internet).

Just thinking about the WiFi shield makes me sad that Philadelphia’s dream of the ’00s—a citywide WiFi network—never came to fruition. Accessing a school’s WiFi network is no small feat; the School District’s IT department has to be on board with the initiative (luckily, Philadelphia’s School District IT people have been amazingly supportive of a pilot project). A WiFi shield requires no equipment to be housed inside a classroom, and there’s something attractive about a product that’s a single object, that takes care of business all by itself. Plus, WiFi just seems like … the future. Going forward, there will only be more WiFi access. So we’re sticking with the WiFi shield and will work out the error messages; it provides the most direct link to the Web.

And just as an aside, we’re not married to Arduino over here. There are other boards out there—more of them every week, it seems—that control sensors, connect to the Web, etc. We’re keeping an eye on what’s being developed. Behold, for example, the BeagleBone. Seriously, who names these things?

* “ERROR WEBrick::HTTPStatus::LengthRequired,” if you’re curious.

06 Mar

Ex Post Hackathon Facto

Is my Latin wrong? Missing from the previous post about the TechCamp hackathon were some of the details about our progress and what the next steps are. So here’s what we did:

  • Programmed and wired the Arduino to read 3 sensor values
  • Packaged data as JSON
  • Created a database to handle the data
  • Created a website to display the data
  • Stiff-armed the Drexel proxy server
  • Began testing the Arduino-Ethernet connection

At the conclusion of TechCamp, the website looked like this (no time for spellcheck, btw):

As you can see, it’s just a skeletal version of a website. The important thing is the transmission of the data values. But we came away with a definite to-do list:

Improve Functionality:

  • Sleep mode to conserve battery
  • Average sensor values to discard noise
  • Store data to send later when wifi becomes unavailable
  • Calibrate sensors to specific soil types
  • Refine web interface to include real-time graphs
  • Create a wifi connection using the Wifi shield

Construct the housing and sunflower:

  • Waterproof plastic case for electronics
  • If using PVC, may need to sand blast for painting
  • Determine optimal height, placement, way to secure the sunflower in the garden
25 Feb

TechCamp Philadelphia

techcampheaderWhat just happened? This weekend, the sensor project idea got picked up at a hackathon, gained a whole team of technologists, and is on its way to wirelessly transmitting data to a website with a fully functional database. My first hackathon was a blur of activity, and that’s probably an apt working definition of a hackathon. But for accuracy’s sake, here’s the background on this weekend’s event:

TechCamp is a U.S. State Department program that connects technologists (I don’t like this word, btw) to people who are trying to solve social problems. Many of the previous TechCamps took place in cities in developing countries, and as far as I’m aware this is the first domestic event. It’s a sign of the times: Co-sponsored by the School District of Philadelphia and Technically Philly, this hackathon focuses on our city’s public schools and finding ways to use technology to improve education and administration. The two-day hackathon—the part where programmers and software developers work on a project, such as a mobile app for students—was only one element of TechCamp, but it was the part that enabled the Solar Sunflower project to grow some legs.

In democratic fashion, the hackathon at Drexel University’s URBN Center began with people contributing project ideas to a whiteboard; groups formed based on interest and requisite skill sets. (Special thanks to Paul Fugazzotto, from PWD public affairs, for attending the first day and helping to generate interest for the sunflower.) I was lucky to get hooked up with three really talented programmers: Christopher Nies, a Python developer; and Kevin Clough and Jason Blanchard, both of whom do development with Ruby on Rails (more on that shortly). Here’s some of our team working in the foreground this weekend:

TechCamp_hackathon

After I explained the project and gave some background information, Chris, Kevin and Jason had a plan of attack in place within minutes: We’re going to send JSON packets containing sensor data over wifi from the Arduino to a Ruby on Rails application running on Heroku. You got that, right?

Let’s try that again. The Arduino is going to hook up to a wireless network. In our case, it would be the school’s network (special thanks to School District of Philadelphia IT personnel—Melanie Harris, Phil Ichinaga, Sam Garst—for their support of the project). It’s going to send sensor values in a data structure called JSON, which stands for JavaScript Object Notation. JSON is kind of like the envelope that holds a letter: It is code that encloses the data in a simple, lightweight wrapper that is human-readable and easy to work with. Inside the JSON code you might specify the location of the sensor (site name), an ID for each sensor (soil sensor 1, soil sensor 2, etc.), the actual data value, maybe even a timestamp. The server is then configured to receive the data so it knows what to expect from the packet.

Now the most difficult part (for me, at least): Ruby on Rails. Ruby is a programming language, like Python or PHP or C++. Rails, on the other hand, requires a little more explanation. It is a web application framework that runs on Ruby. Oh right, a “web application framework.” I’m sure the finer points of Rails will reveal themselves in time, but for now I’m satisfied to know that it provides a way to build websites quickly, using less code than other approaches. (Full disclosure: Although I do consider myself a novice at programming, I have experience with HTML, CSS and other website-related things.)

Heroku is a cloud hosting platform. It’s a place to put a website. It’s free, up to a certain point of usage. This makes it a smart choice for projects under development.

Most of the progress made during the hackathon involved getting the server and website set up, programming the Arduino to talk to the server, and wiring up the sensors. Throughout, we had many people—educators, scientists, students—stop by our table to learn about the project. While I mainly preached the gospel about green infrastructure and stormwater management to our many visitors, Kevin, Chris and Jason did the heavy lifting on the tech side. Here’s a shot of our setup:

TechCamp desk

In the photo above, we have three soil moisture sensors wired to a breadboard (a plug-in board that lets you connect circuits without soldering wires) and connected to a Bluetooth shield. We ended up not using Bluetooth to transmit data; to the right of the breadboard is an Arduino and Ethernet shield that provides a better way to connect to the web. (Connecting via wifi is on the to-do list; we just wanted to test our connections to the server and Heroku site.)

Even though I arrived with a duffel bag full of electronics—Arduinos, sensors, breadboards, cables—at one point I had to steal away to Radio Shack to buy the Ethernet shield for the Arduino. It cost around $20. Now, I’ve become a semi-regular customer at various local Radio Shacks since embarking on this project, and I’ve never underestimated the base-level weirdness of the Shack’s clientele. But this time was special: A lady, perhaps thinking I worked at the store, asked me which digital converter box would scramble signals from her TV … because the people from the TV were accessing her brain and stealing her thoughts.

But I digress. Our team wasn’t able to do a live demo of the sensors transmitting data to the web, but we gave a solid closing-night presentation in front of a great audience of educators and the tech community. Best of all, the team resolved to keep working on the project, and we’ll get together at Code For Philly meetups in the future. More than anything, I was astonished at the level of interest and support for this project and hope to keep the momentum going.