05 Jan

Bigger, Better and Brighter LED Display

IMG_6699 IMG_6696

Our previous post detailed the simple soil moisture sensor with an LCD display that has been keeping track of our plant’s watering needs at the Fairmount Water Works.  We decided the project could use a little more flair—plus, our original LCD display got a little wet.  Luckily, our new 16×32 LED Matrix has its own waterproof case. The setup uses an Arduino Uno ($25), a Grove base shield ($10), a Vegetronix VH400 soil moisture sensor ($37), and a 16×32 RBG LED matrix panel ($25). All of the electronics are safely tucked into a waterproof Pelican case.

We decided to display more information with our LED matrix.  Now, it will display the words “Water me!” when the soil moisture level falls below a voltage of 1.2, or “Don’t Water” when the moisture level is greater than 1.2 V. It then displays the voltage, followed by “Water Works,” and repeats.

We found that with RGB (red-blue-green) matrices like this one, certain colors require more power.  When using solely the power coming through the computer to the Arduino to power the matrix, we were limited to basic red, blue, and green colors.  Any other colors would be displayed as one of the tree.

We decided this was a little too boring, and experimented with supplying power from the wall directly to the matrix, in addition to the power coming from the wall to Arduino.  This got us very bright, vibrant colors. However, the LEDs were glitchy and flashing.  We think the matrix was getting just a little too much power, and it was distracting.  In the end, we stuck with the additional wall power, but used lower power colors.  This gave us the brightness we wanted, without all the flashing.

View the code after the jump.

Read More

08 Dec

Fairmount Water Works Sensor

Now on display at the Fairmount Water Works—a simple soil moisture sensor with an LCD display to keep track of a plant’s watering needs. This is just a first step in developing some really interesting ways to monitor plants and get feedback on plant health. Working with two 10th grade students at Science Leadership Academy, we’ll be investigating how to use visuals, audio, and Twitter to communicate environmental data.  (We’ll also be investigating why we didn’t put the electronics in a waterproof case, because what’s more awesome than an unprotected circuit board next to a plant that’s being watered?)

This setup uses an Arduino Uno ($25), a Grove base shield ($10), a Grove LCD display ($14) and a Vegetronix VH400 soil moisture sensor ($37, though you can find soil moisture sensors for under $10; we like the performance of the VH400). The Grove shield stacks on top of the Arduino and lets you use snap-in wires to connect sensors and displays. The Arduino code is after the jump; it’s basically modified code from the Grove website.

We did a rudimentary calibration of the soil moisture sensor and got readings for the sensor in air, in dry soil, in wet soil, and immersed in water. From those measurements, we estimated readings below 200 would probably indicate the plant needs watering. It’s not an exact science, but we’ll learn more about what the sensor output means as we go along.

Read More

01 Nov

8 Microamps

micro

Learning new technology has a way of making you feel both highly intelligent (such as when you realize you can install entire software packages by typing three words) and monumentally stupid, often in close proximity to each other. I’m not sure if our battery-power problems exactly fall into the latter category, but let’s just say that the solution was not obvious to me, even after reading countless posts on Arduino forums and looking at many lines of code.

To refresh your memory, our JeeNode (formerly Arduino) and sensors have been drawing too much current from the battery, effectively killing our rain garden monitor within days. Even when we put the JeeNode into sleep mode, which is the vast majority of the time (sensor readings are taken once every 30 minutes), there was a current draw. We weren’t truly shutting it down.

I talked it through with James Tyack, and it didn’t take him long to figure out a solution: The digital pins on the JeeNode can be set to output a voltage (power); you can also toggle a digital pin on and off (“high” or “low” in Arduino terminology), so it either delivers 0 volts or 3.3 volts. If we power the sensors from the digital pins instead of the “power” pin, we can completely shut down power to the sensors when readings aren’t being taken. It’s a simple idea that just escaped me entirely.

The result? Instead of drawing 10 milliamps when idle, the JeeNode and sensors now draw 8 microamps. Forget about days of battery life—it’s possible that three AA batteries can provide power to the sensor for years.

13 Sep

Big Changes

Where hardware for this project is concerned, everything has changed. We’re saying goodbye to the Arduino Uno, the WiFi shield, and the Solar Sunflower. Here’s why: The Arduino and WiFi shield setup consumes too much battery power, and we all pretty much agreed that having to change batteries more frequently than every 3 months would be unacceptable. Might there be a workaround for this? Sure—but electrical circuits aren’t our strong suit, and making that part of the design takes away from our desire for this to be a project that anyone can build themselves.

Speaking of strong suits and DIY building, we’re getting out of the sunflower business. The thought of mass-producing sunflower-shaped sensors isn’t particularly appealing. Who better to design the sensor housing than the students themselves? A student design competition for the sensor housing makes more sense, appeals to wider interests, allows for modularity in design and installation, and lets students create something unique to their classroom and their school. For the moment, we’re still calling our project group Solar Sunflower, but a re-branding is in process. So, cheers to the giant sunflower: It was a fine symbol for our work, it never failed to attract attention when you walked into a room with it, and it was the ultimate conversation starter on elevators and street corners.

But we have something new to talk about—meet the Raspberry Pi:

RPi_modelb

It’s a $35, credit card-sized Linux computer. Linux is an operating system, or OS—Mac and Windows are examples of operating systems, but they are proprietary; Linux, on the other hand, is open source (you can get under the hood and modify it) and it is free to install. Don’t be afraid of Linux—it can look and perform like your Mac or PC, with a desktop, software programs, Internet browser, and solitaire (or minesweeper if you prefer). You can connect a mouse, keyboard and monitor to the Raspberry Pi and have a functioning computer workstation. It accommodates Ethernet or WiFi for Internet access, a high-resolution camera, and audio speakers. The Raspberry Pi is so inexpensive because it was developed in England to teach computer science. You can read more about it here.

When we combine a Raspberry Pi with the JeeNodes mentioned in the previous post, something incredible happens. Many of our nagging problems and difficulties disappear. With the JeeNode in the garden, we’re using less power from the battery pack. By sending sensor data over radio waves, we don’t have to worry about having WiFi access outside the school. The Raspberry Pi can sit inside the school, receive the data, and upload it to the web. We’re no longer tying up a computer in the school. We’re even reducing the overall cost of the project.

More details on this new configuration to come, but Jeelabs’ Dive Into JeeNodes series of blog posts is a rough guide to the approach we’re taking. Our paths diverge a bit around step 8, but the idea is the same: JeeNodes communicating with each other by radio, and the Raspberry Pi uploading data to a server.

We’re also saying goodbye to Drexel student Tommy Thompson, whose co-op position at the Philadelphia Water Department is ending this week. Many thanks to Tommy for all his hard work and hours of troubleshooting hardware and software. Tommy isn’t a computer science major, but I’m especially proud that he’ll be leaving here with some programming skills in C++ and Python. One day he programmed a game of Pong onto an LED display using the Arduino and a soil moisture sensor as a game control. That was pretty awesome.

09 Aug

A Good Schematic Is Worth a Thousand Blog Posts

sunflower_sketch

Thanks to our new team member James Tyack for illustrating our green school sensor configuration. This was a quick sketch he made, so I’m not going to complain about the penmanship. (But c’mon James, really.) In case you’re looking for further illumination, we’re looking at the Arduino with WiFi shield sitting in the rain garden transmitting sensor data via the school’s WiFi network. (The Arduino also records sensor data to an SD memory card as a backup.) The sensor readings are sent to a Ruby on Rails server with a database, and displayed on a website.

28 Jun

Epic Power Fail

Nebinger_plot_June_19

Went back to Nebinger Elementary to check on the snake sensor described in the previous post, and … the batteries were dead. We got about three days’ worth of good data (see chart, above), taking soil moisture and temperature readings every 30 minutes. There was no rain during that period, but it’s clear from the chart when volunteer gardeners went out and watered the vegetable garden—the temperature (blue line) dips as the cold water contacts the temperature sensor, and the soil moisture (red line) increases. (The sensors were not calibrated, by the way, so pay no attention to the numbers on the soil moisture axis; the volumetric water content would not be at all accurate.)

What happened? The Arduino was programmed to go to sleep between sensor readings, using the functions in the Narcoleptic library. The LEDs and sensors shouldn’t be drawing much from the batteries. There were some hot days in that stretch, but it’s cold weather you have to worry about when considering temperature effects on battery drain. Something else is going on.

Here’s where we dusted off the multimeter and made a somewhat surprising discovery. After wiring a circuit to measure current draw, we saw that the Arduino Uno was drawing around 50 mA (milliamps), even while it was idle in sleep mode. I’m no electrical engineer, and this is probably some fuzzy math I’m about to do, but let’s say a AA battery has 2000 mAh (milliamp hours), and the four AAs are wired in series, so current is not additive. (Read this if I just lost you.) So 2000 mAh divided by 50 mA—we can expect about 40 hours of operation; a little less than 3 days. That’s just about what we got with the snake sensor.

Clearly we need a better approach to conserve battery life—a different circuit, a way to minimize the current draw by eliminating the Arduino’s “on” LED or voltage regulator, maybe even look at different microcontroller boards that don’t consume as much power.

19 Jun

Snakes on a Playground

Snake_Sensor_partsThis summer, the playground at Nebinger Elementary School in Bella Vista will lose some impermeable asphalt and gain a rain garden and some porous play surface. It’s all part of a plan to capture stormwater and protect our rivers and streams. But after construction is finished and the vegetation is planted, students may not even realize the function of the system in place.

Thanks to an engaged principal, faculty and educators from the Fairmount Water Works Interpretive Center, however, students are already learning about water-related issues and getting ready for a greener play area (the school already has a very productive vegetable garden in raised planter beds). When teacher Rachel Odoroff was looking for a year-end project for her 7th and 8th grade science classes, we saw an opportunity to introduce some of our work with sensors into the classroom.

The challenge: In two days, work with the students to design and install some sensors to monitor the vegetable garden.

The plan: Well, it’s a bit too ambitious to try to access the school’s WiFi network and get the Solar Sunflower server to display the data, so we decided to make a datalogger to record soil moisture and temperature in the garden. We gave the students a short introduction to the electronics, and they got started with designing the housing. The result? A snake made out of a tupperware container for the head, and pieces of flexible plastic plumbing connectors (the kind you might use to connect pipes under your sink).

Below is the “head” of the snake: an Arduino, an SD card shield (data is written to an SD card, like the memory card in your phone or camera), a battery pack with 4 AAs, and red LED “eyes” that light up when the soil is too dry. The temperature sensor is a black wire that protrudes from the front of the head, like a tongue.

Snake_Sensor_head_sm

Here is the head of the snake in the garden, placed among some tomato plants:

Snake_Sensor_Installed_sm

The tail of the snake—the soil moisture sensor‘s wire threads through the tubing and the sensor is buried about four inches in the ground:

Snake_Sensor_tail_sm

Unfortunately the end of school means the students won’t have an opportunity to examine much of the data, but we’ll be back during the summer to check on the snake every once in a while. We hope to build on this project next year—add wireless communication, upload data to the web in real time, add a light display—and extend it to monitor the rain garden. Thanks to Ms. Odoroff, her students, Drexel co-op Tommy Thompson, and Fairmount Water Works education and outreach coordinator Ellen Schultz for making this project happen. Thanks to PWD engineer Stephen White for coming up with the phrase “snakes on a playground.”

07 Jun

Show Me The Code

arduino_codesample

At this point, we have a working version of the Solar Sunflower: An Arduino equipped with a WiFi shield sends sensor data to a server. Some of you might be wondering where the code is. The short answer is that it’s at our GitHub repository (more on this shortly). There you can find the Arduino code (a screenshot of it is posted above), the Ruby code for the server, and documentation and revision history. We’ll definitely be discussing the project’s technical issues in this blog, but it isn’t meant to be a documentation of our code. The code is going to change many times over the course of this project, and it isn’t always interesting or productive to list every little change here. Go to GitHub.

If you’re not familiar with GitHub, here’s what we wrote in the FAQ section:

GitHub is a website that hosts files for tech development projects. It’s kind of like Google docs for programmers. GitHub allows multiple people to work on code separately, then merge the changes back into one file.  Groups of files (for a certain project, for example) are collected in one location called a repository.

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

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.