data logging anemometer

Upload: lorddarthvader

Post on 02-Jun-2018

238 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Data Logging Anemometer

    1/13

    http://www.instructables.com/id/Data-Logging-Anemometer/

    Food Living Outside Play Technology Workshop

    A Self-Contained Data Logging Anemometerby ptorellion October 6, 2013

    Table of Contents

    A Self-Contained Data Logging Anemometer .........................................................................................

    Intro: A Self-Contained Data Logging Anemometer .................................................................................

    Step 1: Build the rotor .......................................................................................................

    Step 2: Build the Upper Base ..................................................................................................

    Step 3: Optical interrupter ....................................................................................................

    Step 4: Attach the rotor! ......................................................................................................

    Step 5: Build the lower base ..................................................................................................

    Step 6: Build the optical sensor ................................................................................................

    Step 7: Build the data logger ..................................................................................................

    Step 8: Attach the electronics .................................................................................................

    Step 9: Calibration .......................................................................................................... 1

    Step 10: Go collect some wind data! ............................................................................................ 1

    Step 11: Source Code ....................................................................................................... 1

    File Downloads ........................................................................................................... 1

    Related Instructables ........................................................................................................ 1

    Advertisements ............................................................................................................... 1

    http://www.instructables.com/member/ptorelli/?utm_source=pdf&utm_campaign=titlehttp://www.instructables.com/tag/type-id/category-workshop/http://www.instructables.com/tag/type-id/category-technology/http://www.instructables.com/tag/type-id/category-play/http://www.instructables.com/tag/type-id/category-outside/http://www.instructables.com/tag/type-id/category-living/http://www.instructables.com/tag/type-id/category-food/
  • 8/10/2019 Data Logging Anemometer

    2/13

    http://www.instructables.com/id/Data-Logging-Anemometer/

    Author:ptorelli

    I'm a 20-year Intel vet with all sorts of design experience, both hardware and software. I enjoy making electronic gadgets, and I'm really digging the Makerspirit up here in the pacific northwest.

    Intro: A Self-Contained Data Logging AnemometerI love collecting and analyzing data. I also love building electronic gadgets. A year ago when I discovered the Arduino products, I immediately thought, "I'd l ike to colleenvironmental data." It was a windy day in Portland, OR, so I decided to capture wind data. I looked at some of the instructables for anemometers and found them quuseful, but needed to make some engineering changes.

    First, I wanted the device to run self-contained, outdoors, for a week. Second, I wanted it to be able to record very small gusts of wind, several of the designs here

    required rather strong winds to get going. Lastly, I wanted to record the data.

    I decided to go for a really lightweight rotor design with as little inertia and resistance as possible. To accomplish this, I used all plastic parts (including threaded vinylrods), ball bearing linkages, and optical sensors. Other designs used magnetic sensors or actual DC motors, but both of those slow the rotor down, optics use a littlemore power but offer no mechanical resistance.

    The data logger is simply an Atmega328P with an 8 mbit flash chip. I thought about going SD, but I wanted to keep the cost, power consumption, and complexity low. wrote a simple program that logged two-byte rotation counts every second. With 8 megabits I figured I could collect about a week's worth of data. In my original designfigured I would need 4 C cells, but after a week they were still fully charged so I must have been off by an order of magnitude in the power consumption. I didn't uselinear regulators, I drove all voltage rails to 6V (even though some of the parts were rated 3.3V. Yay overdesign!).

    To download the data, I had a complex system that read the flash and dumped it to the arduino serial monitor, and I cut and pasted into Excel. I didn't spend time tryinto figure out how to write a command line USB app to dump the flash to standard out, but at some point I will need to figure this out.

    The result was rather surprising, I was able to observe some very interesting trends, which I am saving for another report.

    Good luck!

    http://member/ptorelli/http://member/ptorelli/
  • 8/10/2019 Data Logging Anemometer

    3/13

    http://www.instructables.com/id/Data-Logging-Anemometer/

    Step 1:Build the rotorI tried a number of different ideas for the rotor cups: easter eggs, ping pong balls, plastic cups, and empty Christmas tree ornament balls. I built several rotors and testthem all with a hair dryer, which provided a range of wind speeds. Of the four prototypes, the ornament shells worked the best. They also had these l ittle tabs that madaffixing easier, and were made out of a rigid plastic that worked well with polycarbonate cement.

    I tried a few different shaft lengths, small, medium and large (about 1" to about 6") and found that the larger sizes torqued too much and didn't respond well to low winspeeds, so I went with the small size shafts. Since everything was clear plastic, I made a handy little printout to help alight the three blades.

    Materials:

    The ornaments came from the Oriental Trading Company, item "48/6300 DYO CLEAR ORNAMENT", $6 plus $3 shipping. The plastic shafts and the structural disk cafrom a local TAP Plastics store, about $4 more in parts.

    Image Notes1. DIY Christmas tree ornaments.

    Step 2:Build the Upper BaseTo reduce rotational inertia, I used a threaded nylon rod from McMaster Karr . I wanted to use bearings, but machine bearings are packed in rotor-slowing grease, so Ibought some cheap skateboard bearings that had none. They just happened to fit inside CPVC inner diameter 3/4" pipe adapter.. It wasn't until I assembled the structthat I realize skate bearings handle planar load, and I was applying vertical load, so I should have used a thruster bearing, but they worked just fine, and probably helpmanage friction from precession torque.

    I planned to attach an optical sensor to the bottom of the shaft, so I mounted the CPVC coupling into a larger base. Home Depot is a fun place to mix and matchCPVC/PVC fittings. Ultimately I was able to stuff the 3/4" threaded CPVC coupling into a PVC 3/4" to 1-1/2" reducer. It took a lot of playing around to make everythingbut it left enough room for electronics.

    Materials:

    98743A235 -- Black Threaded Nylon Rod (5/16"-18 thread)94900A030 -- Black Nylon Hex Nuts (5/16"-18 thread)Cheap skateboard bearings3/4" threaded CPVC adapter3/4" to 1-1/2" PVC reducer to threaded 3/4" pipe

    Note: PVC and CPVC coupling dimensions are not the same, probably to prevent accidental misuse; so swapping in a plain PVC 3/4" threaded adapter won't work;however, the THREADS are the same, which is totally weird. The CPVC coupling threads into the PVC adapter bushing. Adapter... bushing... coupling... I'm probablymixing up all of these terms, but 15 minutes in the Home Depot plumbing aisle will set you straight.

  • 8/10/2019 Data Logging Anemometer

    4/13

    http://www.instructables.com/id/Data-Logging-Anemometer/

    Image Notes1. The stops in this CPVC adapter were just big enough to prevent the bearingsfrom falling in.2. To assemble, remove the bottom locknuts, leaving the top bearing in place butremoving the lower one; insert into the CPVC adapter, add the lower bearing, andtighten the lock nuts so there is a tiny bit of play.

    Step 3:Optical interrupterAs the rotor turns, its rotation is counted by an optical interrupter. I thought about using a disk, but that meant I'd have to attach the illumination source and the detectovertically, which would be very challenging to assemble. Instead I opted for horizontal mount and found some li ttle cups that go on the bottom of chairs to protecthardwood floors. I painted and taped off six segments, which would give me twelve (nearly) uniform edges, or 12 ticks per revolution of the rotor. I thought about doingmore but wasn't very familiar with the speed of the detector, or the field-of-view of its optics. That is, if I went too narrow, the LED might creep around the edges andactivate the sensor. This is another area of research I didn't pursue, but would be good to explore.

    I glued the painted cup to a nut and fastened it to the end of the shaft.

    Materials:Chair leg protector cup thing from the Home DepotBlack paint

  • 8/10/2019 Data Logging Anemometer

    5/13

    http://www.instructables.com/id/Data-Logging-Anemometer/

    Step 4:Attach the rotor!At this point it was starting to look pretty cool. The nylon nuts are really slippery, so I had to use many locknuts (in case you didn't notice from the previous pictures). Ialso had to make a special flat wrench to fit into the cap beneath the rotor so that I could lock both nuts down.

  • 8/10/2019 Data Logging Anemometer

    6/13

    http://www.instructables.com/id/Data-Logging-Anemometer/

    Image Notes1. Need to make a small flat wrench out of plastic to lock this nut down.

    Step 5:Build the lower baseThe lower base houses the batteries and provides a support structure. I found a pretty cool waterproof box online from a company called Polycase. It 's a really slick cathat seals tight, and the screws are wider at the base so they don't easily fall out of the top.

    I used a PVC mate to the upper PVC bushing. This lower base mate is just a threaded 1-1/2" PVC coupling. The upper rotor base pressure fits into the lower base viacoupling. As you'll see later, I didn't glue these pieces together because I wanted to be able to open it up and make adjustments i f necessary, plus the assembly is easwhen attaching the circuit boards.

    Materials:Waterproof box from Polycase, item # WP-23F, $12.50Threaded 1-1/2" PVC coupling

  • 8/10/2019 Data Logging Anemometer

    7/13

    http://www.instructables.com/id/Data-Logging-Anemometer/

    Step 6:Build the optical sensorThe sensor mechanism is a 940nm LED and a Schmitt-tr igger receiver. I love love love the Schmitt trigger circuit, it takes care of all my debouncing needs and sends a CMOS/TTL compatible signal. The only downside? 5V operation. Yes, I over-drove the entire design to 6V, but I could have gone to 3.3V if it weren't for this part.

    The idea is that this circuit mounts underneath the rotor cup, which interrupts the beam as it turns, generating logical transitions for each edge. I don't have a good picof how this was mounted. I basically glued two plastic offsets into the lower base PVC coupling, and screwed it into them from above. I had to grind down the edges ofboard to make it fit neatly.

    I don't even have a schematic for this, it is really easy: just run a 1k resistor from Vin and wire it up so that the LED Is always on and the output of the detector is on itspin.

    Materials:1 940nm LED1k resistor1 OPTEK OPL550 sensor1 three-pin plug (female)1 1.5"x1.5" circuit boardVarious lengths of wireHeat-shrink tubing if you like your wires bundled

  • 8/10/2019 Data Logging Anemometer

    8/13

    http://www.instructables.com/id/Data-Logging-Anemometer/

    Step 7:Build the data loggerThis certainly was a challenge. Building the prototype on the Arduino UNO board was trivial. Doing place-and-route layout of the board was quite a challenge. I'm usedpushing a button and having Synopsys tools do this for me, but using EagleCAD I fooled around with it long enough to have a one layer board, almost ... there are fouugly wires I needed to bridge a few gaps. Not pretty, but it was fun!

    (I thought I measured this at ~50mW operating power, and based on the Watt-Hours of the batteries, I thought i would drop below 5V in a week, but either my powermeasurement or my math was wrong because 4 C-cells kept going for a long time.)

    Here's the basic idea (source code will be included later on):

    Jumper set to "debug" mode: attach a change-value interrupt to the optical sensor output, and flash the test LED in unison with the detector. This was very helpful fordebugging.

    Jumper set to "record" mode: attach the same interrupt to a counter, and in the main loop, delay 1000 msec. At the end of the 1000 msec, write the # of edge counts to256-byte flash page, and when the page is full, write it out and reset the count.

    Simple, right? Pretty much. I really like the Winbond flash devices, I used to design flash back in the 90's, so it was fun to program them again. The SPI interface isbrilliant. So simple to use. I'll let the schematics and source code speak for themselves.

    Did I mention EagleCAD is awesome? It really is. There are some great tutorials on YouTube.

  • 8/10/2019 Data Logging Anemometer

    9/13

    http://www.instructables.com/id/Data-Logging-Anemometer/

    Step 8:Attach the electronicsAgain, I don't have many good pictures here, but if you imagine two plastic standoffs glued to the inside of the PVC, both boards are screwed into it. Here's a shot of thlogger board connected to the bottom. The detector board is up inside the housing.

  • 8/10/2019 Data Logging Anemometer

    10/13

    http://www.instructables.com/id/Data-Logging-Anemometer/

    Step 9:CalibrationI made a test rig to calibrate the beast so that I could convert raw rotor counts to MPH.

    Yes, that is a 2x4. I attached the anemometer to one end, and a debug Arduio to the other. The LCD displayed the rotor counts.

    The process went like this:

    1) Find a long straight road with no traffic.

    2) Hold the 2x4 so that it pokes as far out the window as possible3) Turn on voice recording on your iPhone or Android4) Turn on a digital GPS speedometer on your handheld device of choice5) Drive steadily at several speeds and announce to your recorder the speed and average rotor counts6) Don't crash7) ?8) Later on, when not driving, replay your phone message and enter the data into excel and hope a linear or an exponential or a polynomial fits with an R-squared valugreater than 99%

    This conversion # will be used later on. The device only captures raw data, I post-processed it to MPH (or KPH) in Excel.

    (Did I mention I applied a badass coat of olive drab paint? I would have called this a "Tactical Data Logging Anemometer", but then I remembered that "Tactical" mean"black".)

  • 8/10/2019 Data Logging Anemometer

    11/13

    http://www.instructables.com/id/Data-Logging-Anemometer/

    Image Notes

    1. "Tactical Green"

    Step 10:Go collect some wind data!That's pretty much it. I think a few pictures are missing, e.g. not shown are the four C-cells crammed into the lower base. I couldn't fit a spring-loaded holder so I endeup soldering leads to the batteries themselves. I'm writing this instructable a year after I built it, and in revision #2, I used AA batteries because I grossly overestimatedthe power consumption. Using AA allowed me to add an on-off switch and really freed up some space inside, otherwise it was pretty tight.

    In all I was pretty satisfied with the design.

    The graph below shows one week's worth of averaged data. I removed the axes because I'm currently using the data for another project that might be profitable, but yget the gist.

    Have fun! Let me know if you see any room for improvement!

  • 8/10/2019 Data Logging Anemometer

    12/13

  • 8/10/2019 Data Logging Anemometer

    13/13

    Step 11:Source CodeAttached is a single Arduino source file. I GPL'd it because, hey, GPL.

    File Downloads

    datalog.cpp(4 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to 'datalog.cpp']

    Related Instructables

    Arduino Wind

    Chill Machineby

    msuzuki777ArduinoWeather Station

    Part2by

    msuzuki777

    Make it yourselfanemometer for

    under $30by

    pashanoid

    Weather stationArduino and

    Processingby

    MonteH

    Arduino basedtime-eventlogger(Photos)

    by Mr.WhatArduinoWeather Station

    Part3, Rainby

    msuzuki777

    Advertisements

    http://www.instructables.com/member/msuzuki777/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-Weather-Station-Part3-Rain/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-Weather-Station-Part3-Rain/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-Weather-Station-Part3-Rain/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-Weather-Station-Part3-Rain/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/member/Mr.What/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-based-time-event-logger/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-based-time-event-logger/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-based-time-event-logger/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-based-time-event-logger/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-based-time-event-logger/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/member/MonteH/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Weather-station-Arduino-and-Processing/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Weather-station-Arduino-and-Processing/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Weather-station-Arduino-and-Processing/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Weather-station-Arduino-and-Processing/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/member/pashanoid/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Make-it-yourself-anemometer-for-under-30/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Make-it-yourself-anemometer-for-under-30/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Make-it-yourself-anemometer-for-under-30/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Make-it-yourself-anemometer-for-under-30/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/member/msuzuki777/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-Weather-Station-Part2/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-Weather-Station-Part2/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-Weather-Station-Part2/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-Weather-Station-Part2/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/member/msuzuki777/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-Wind-Chill-Machine/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-Wind-Chill-Machine/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Arduino-Wind-Chill-Machine/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/files/orig/F3Q/KVSY/HMEXWSSV/F3QKVSYHMEXWSSV.cpp?utm_source=pdf&utm_campaign=fileshttp://www.instructables.com/files/orig/F3Q/KVSY/HMEXWSSV/F3QKVSYHMEXWSSV.cpp?utm_source=pdf&utm_campaign=fileshttp://www.instructables.com/files/orig/F3Q/KVSY/HMEXWSSV/F3QKVSYHMEXWSSV.cpp?utm_source=pdf&utm_campaign=fileshttp://www.instructables.com/files/orig/F3Q/KVSY/HMEXWSSV/F3QKVSYHMEXWSSV.cpp?utm_source=pdf&utm_campaign=files