{"id":245,"date":"2014-08-11T17:35:25","date_gmt":"2014-08-11T17:35:25","guid":{"rendered":"http:\/\/blog.cup-of-joe.me\/?p=245"},"modified":"2018-12-12T19:41:12","modified_gmt":"2018-12-12T19:41:12","slug":"wind-direction-sensor","status":"publish","type":"post","link":"http:\/\/blog.cup-of-joe.me\/?p=245","title":{"rendered":"Wind Direction Sensor"},"content":{"rendered":"<p>This is one of the easiest sensors I&#8217;ve built.  Basically it is a 10k 360 degree potentiometer with a wind vane attached to the top.  I set North equal to 0 resistance and then record the values through testing at the other directions and then split the difference between them.  (Will explain this more when I do the coding part)<\/p>\n<p><a href=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image-300x300.jpg\" alt=\"image\" width=\"300\" height=\"300\" class=\"alignnone size-medium wp-image-247\" srcset=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image-300x300.jpg 300w, http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image-150x150.jpg 150w, http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image.jpg 640w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image1.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image1-225x300.jpg\" alt=\"image\" width=\"225\" height=\"300\" class=\"alignnone size-medium wp-image-248\" srcset=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image1-225x300.jpg 225w, http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image1-768x1024.jpg 768w, http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image1.jpg 1536w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p>Here are the two main parts to the sensor.  A Bourns 6639S-1-103 10k rotary potentiometer and a Davis instruments wind vane with brass tip for Vantage Pro2 anemometer.  You&#8217;ll also need some cat3 or cat 5 cable, a 1 1\/4&#8243; to 1&#8243; PVC &#8220;T&#8221; and two 1 1\/4&#8243; PVC plug.<\/p>\n<p><a href=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image2.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image2-225x300.jpg\" alt=\"image\" width=\"225\" height=\"300\" class=\"alignnone size-medium wp-image-250\" srcset=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image2-225x300.jpg 225w, http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image2-768x1024.jpg 768w, http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image2.jpg 1536w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p>First you want to drill a hole in the middle of the PVC plug for the pot to go through.  (Make sure you can get all the threads through the hole).  <\/p>\n<p><a href=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image3.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image3-225x300.jpg\" alt=\"image\" width=\"225\" height=\"300\" class=\"alignnone size-medium wp-image-251\" srcset=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image3-225x300.jpg 225w, http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image3-768x1024.jpg 768w, http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image3.jpg 1536w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p>Before you tighten the pot into the hole, you&#8217;ll need to solder some wires to the bottom of the pot.  For the Raspberry Pi, you only need one on peg 1 and one on peg 2 (Power on peg 1 &#038; read on peg 2).  For Arduino, You&#8217;ll need to attach a ground to peg 3 of the pot.  Make sure and use some shrink wrap to protect the joints.<\/p>\n<p><a href=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image4.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image4-225x300.jpg\" alt=\"image\" width=\"225\" height=\"300\" class=\"alignnone size-medium wp-image-253\" srcset=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image4-225x300.jpg 225w, http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image4-768x1024.jpg 768w, http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image4.jpg 1536w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p>Once your soldering is done, tighten down the pot into the hole and slip your wire through the &#8220;T&#8221;.  Make sure you mark &#8220;N&#8221; on your plug where 0 resistance is read after the pot is tightened down.  Keep your pot adjusted to this position.  Slide the plug into the T.  (Place another 1 1\/4&#8243; plug in the other side).  <\/p>\n<p><a href=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image5.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image5-225x300.jpg\" alt=\"image\" width=\"225\" height=\"300\" class=\"alignnone size-medium wp-image-254\" srcset=\"http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image5-225x300.jpg 225w, http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image5-768x1024.jpg 768w, http:\/\/blog.cup-of-joe.me\/wp-content\/uploads\/2014\/08\/image5.jpg 1536w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p>Finally, you&#8217;ll need to attach the vane.  The vane has a small Allen screw in it.  You&#8217;ll need to loosen it up before you slide the vain onto the post of the pot.  Adjust the vane so it&#8217;s just barely off the plug, point it towards &#8220;N&#8221; that you marked on the plug and tighten it down.<\/p>\n<p>As far as wiring this sensor, the wire soldered to peg 1 should go to +v, the wire soldered to peg 2 should go to either an read spot on your ADC (if you&#8217;re using a Pi, something like the MCP3008) or to an analog read pin on your Arduino, and the wire on peg 3 should go to ground (if it&#8217;s connected)<\/p>\n<p>I&#8217;ll share the reading code part later when I can get on my main computer at home.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is one of the easiest sensors I&#8217;ve built. Basically it is a 10k 360 degree potentiometer with a wind vane attached to the top. I set North equal to 0 resistance and then record the values through testing at the other directions and then split the difference between them. (Will explain this more when [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,7],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.cup-of-joe.me\/index.php?rest_route=\/wp\/v2\/posts\/245"}],"collection":[{"href":"http:\/\/blog.cup-of-joe.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.cup-of-joe.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.cup-of-joe.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.cup-of-joe.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=245"}],"version-history":[{"count":3,"href":"http:\/\/blog.cup-of-joe.me\/index.php?rest_route=\/wp\/v2\/posts\/245\/revisions"}],"predecessor-version":[{"id":255,"href":"http:\/\/blog.cup-of-joe.me\/index.php?rest_route=\/wp\/v2\/posts\/245\/revisions\/255"}],"wp:attachment":[{"href":"http:\/\/blog.cup-of-joe.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.cup-of-joe.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=245"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.cup-of-joe.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}