Monday, November 21, 2011

Lake Level Sensor- Success!


I was able to get the lake sensor system to successfully push data to google docs: LINK



The “lakelevel” is the distance in inches from the sensor to the lake surface. I need to change this to lake height above sea level in feet and inches. I also need to add some sort of smoothing function to remove ripples and waves from the output. The water temp is in degrees F. (not working correctly at the moment) The photocell is relative sky brightness- 0 is no light, 1000+ is full sunlight. Air temp is in degrees F, and air RH is relative humidity.

I’m having some sort of hardware issue with the lake temperature probe- you’ll notice the anomalous reading in that column. Right now it’s sending data to google docs every 10 minutes. Once I figure out the water temperature probe, I’m going to add some data visualization -graphs over time + a graphical current status icon - then attempt to send those to the Mooney lake association website.

Also, the current code is a resource hog on the host PC. I need to dramatically reduce CPU use and then export the application as a stand-alone executable. Right now it's running from the Processing development environment. 

It's been a very interesting project- a great excuse to dive a bit deeper into hobby electronics and programming. 

Monday, November 7, 2011

Lake Sensor Project: Software

I'll admit that my software experience is pretty limited- mostly some classes way back in college. Not that this sensor package is anything terribly complicated by any standard, but it's been a nice learning experience. It's also been challenging, especially with a new crying baby and lack of sleep making concentrating on a new subject difficult!

So, at the moment the sensor package is transmitting data just fine. Originally I wanted the sensor package to transmit a packet of data only when requested. This worked fine when I had the PC and the Arduino directly connected via a USB cable, but this didn't seem to work with an XBee wireless module sending the data through the ether. I'm sure this is an easy problem to solve, but my limited web surfing didn't track down an obvious solution. To work around this I decided to have the sensor package continuously transmit data, at least for now.


The picture above is the raw data being fed into my laptop, after been wirelessly sent from the lake sensor to the XBee module. As you can see, it's just a list of numbers currently, delimited by commas. Here is what they are:

ultrasonic sensor, ping time to lake surface and back in milliseconds,  water temperature in degrees C (obviously not right, something needs to be fixed there), photocell resistance (lower numbers = darker), air temp in degrees C, relative humidity.

The next steps are:
  1. write some code to import this data into a usable form (probably using the free language Processing). Make Magazine seems to have a great tutorial on this.
  2. convert data into proper form- millisecond ping data into lake level in feet above sea level, temps converted into degrees F, etc.
  3. send the data into a google docs spreadsheet
  4. send to Mooney Lake association website

Saturday, November 5, 2011

Lake Sensor Project: Hardware Construction

Bare PVC Electrical Box





Drilling holes for ultrasonic distance sensor

Ultrasonic sensor, DHT22, and plug for thermistor installed:



All sensors are fixed in place and holes sealed with hot glue. The box should be essentially water tight.

Sensors wired to external daughterboard (for mounting pull up, pull down resistors for various sensors)

Daughterboard connected to XBEE shield via ribbon cables

Boards installed in box w/ self adhesive velcro. 


The hardware is essentially done. Eventually I'd like to set up a battery and solar powered system. Having an extension cord run down the hill to the dock is a little kludgy. Ideally I'd use some old RC airplane lithium polymer batteries that can't supply enough current to fly aircraft well any more, but would still work fine for this application. However, LIPO batteries need specialized charging circuitry that would require more research than I have time for right now.



Lake Sensor Project: Bill of Materials

Hardware top level description:

This project consists of two main hardware assembles:
1) Sensor package attached to dock with wireless data transmission
2) Wireless data receiver module attached to PC

I used the Arduino because I had one on hand. This particular model isn't manufactured any longer, but any of the newer models should work fine.

There are all kinds of rube-goldberg ways to measure lake level. I felt an ultrasonic distance sensor would be a good way to measure the lake level with no mechanical complexity. They are also fairly cheap, particularly off of Ebay. The HC-SR04 didn't have great examples online on how to implement the code, but I used some code examples off of Adafruit's excellent website and modified them for the 4-pin HC-SR04 vs. the models Adafruit carries.

The other sensors are pretty self-explanatory, I chose them for a nice balance of price vs. accuracy.

I had a hard time deciding whether to go with wireless data transmission, or wired. There are several ethernet options available for arduino boards, some of which even support power over ethernet (POE). POE would be particularly cool, since then I wouldn't have to run separate power and data lines down to the dock. POE vs. XBEE data transmission were about the same price. The decision point for me was lightning risk- running an ethernet cable down to the dock would expose my home network to a might higher risk of damage from nearby lightning strikes.

The enclosure is off the shelf electrical components from Lowe's.

Sensor Package Bill of Materials:

Item P/N Source Quantity
Arduino Duemilanove N/A www.adafruit.com 1
Ultrasonic distance sensor HC-SR04 www.ebay.com 1
Precision Epoxy Thermistor N/A www.adafruit.com 1
Air Temperature / Humidity Sensor DHT22 www.adafruit.com 1
Photocell N/A www.adafruit.com 1
X-Bee Shield WRL-09976 www.sparkfun.com 1
X-Bee Pro, Series 1 wireless data module (100mW power) XBP24-AWI-001-ND www.digikey.com 1
Printed Circuit Board, general purpose 276-150 Radio Shack 1
6"x6"x4" PVC outdoor wiring box N/A Lowe's 1
Redodot wet locations hinged outlet cover N/A Lowe's 1

Note: many misc. components were not included- headers to solder on to X-Bee Shield, ribbon cables, connectors, etc.


Wireless Data Receiver Bill of Materials:

Item P/N Source Quantity
X-Bee Pro, Series 1 wireless data module (100mW power) XBP24-AWI-001-ND www.digikey.com 1
X-Bee Explorer USB WRL-08687 www.sparkfun.com 1

Initially this data receiver will be used bare, but eventually it should be placed in an enclosure and placed somewhere safe and out of the way.

Lake Sensor Project - Sensor Package Installed!

It's been a while since my last post. We've been very busy with the new baby. Every once in a while I've been able to sneak off and work on my new project- a sensor package to remotely monitor various environmental states of Mooney Lake. I've finally be able to get it up and running, and it's now attached to the side of the dock and transmitting data.

Goals:
  • Remotely monitor lake level, lake water temperature, air temperature and air humidity. I also attached a photocell to measure ambient light levels just for the heck of it.
  • Log the data, push it to the "cloud", and graphically display it on the Mooney Lake website. 
Current Status:
  • The sensor package appears to be working, and it's transmitting data to my laptop in the house.


Next Steps:
  • Write some code in Processing or Python (I'm not sure which yet) to push the data to Google Docs. My initial plan is to use Google Docs to log the data and generate graphs depicting trends over time. I'm hoping this will be the easiest method to create graphs that I can then pull into the Mooney Lake website. An alternative would be to directly create the graphs using Processing, save this as a .jpg then drive the .jpg to the Mooney Lake site.

Friday, August 12, 2011

Sometimes lunchtime flying doesn't go as well as you'd like...


I had some not-so great results flying today at lunch. I switched the P-51 out to a 8x8 prop last night. I had one good flight- and man, was it awesome. The amount of extra speed generated when I transitioned from a 10x5 to a 8x8 was amazing, and it still pulled just under 60A in static full throttle testing. That airplane was totally ballistic. Very solid, maintained speed extremely well, and the highest top speed I’ve seen yet. Probably even faster than last summer when I flew it a few times with John's 1550 mAh 4s battery. Well, on flight #2 I didn’t get a good enough launch, stalled it, and pile-drived it into the ground under full throttle. I haven’t determined if it’s fixable or not, but the fuse broke in 2 places, munched the prop to stubs, and possibly cracked the wing. One take away is that launching with a smaller diameter higher pitch prop is more challenging, as it doesn’t accelerate out as quickly.

Then, I turned to the babyshark, and did almost exactly the same thing. Poor launch, stall, almost recovered it, regained enough altitude so when I lost control it nose-dived into the ground at high velocity. The damage isn’t too severe- separated the firewall from the nose, and crunched the forward bulkhead. I’m also not sure about fixing this again. I feel like I should continue to fix, fly, and repeat until I get at least one passable flight, but I am getting a little discouraged. Next time I’m going to try flying it with a smaller battery to lower the stall speed.

Sunday, July 3, 2011

Surly Big Dummy mini-Review

Last week I sold my cyclocross bike / commuter and bought a 2011 Surly Big Dummy. Crazy, I know, but I thought it would be sweet to have a bike that would allow no excuses not to run all possible errands on the bike. Considering the Big Dummy has a listed cargo weight limit of 200 pounds, even picking up four bags of water softener salt is a doable errand.

Surly Big Dummy

So far I've only ridden it home from work and one trip about town and back home from the grocery store. The photo above shows it fully loaded with the items below. During this last trip I carried:
  • 21 pound bag of cat litter
  • 2x 12-packs of coke
  • bag of misc. groceries and cleaning supplies.
Not bad for a first trip. This bike handles surprisingly well even with a fair amount of weight. On the way back we detoured through some rougher bike trails and it did well. I'd consider even trying to ride Theo on it, although popping the front wheel over obstacles would be challenging to say the least!

My only negative so far is that when in the granny gear the two mile long chain drags across one of the frame members. I'll have to get some clear protective tape or old tire sections to protect the steel.

Another bonus is it may be possible to run snow bike tires and rims on this beast- with the super long wheelbase I bet it'd be very stable on rutted-out snowy trails.