{"id":184,"date":"2012-11-06T16:23:42","date_gmt":"2012-11-06T23:23:42","guid":{"rendered":"http:\/\/www.teracharge.com\/?p=184"},"modified":"2013-01-11T21:06:58","modified_gmt":"2013-01-12T04:06:58","slug":"cold-frame-monitor","status":"publish","type":"post","link":"http:\/\/www.teracharge.com\/?p=184","title":{"rendered":"Cold Frame Monitor"},"content":{"rendered":"<p>We (household members and I) have recently ordered a handmade cold frame made of recycled household building materials. These little boxes are pretty cool: by relying solely on passive solar energy, one can grow all sorts of food during the winter months (e.g. spinach and lettuce). This particular cold frame came with a shelf where water jugs can sit and absorb additional energy from the sun to help increase the inside temperature of the cold frame at night.<\/p>\n<div id=\"attachment_185\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.teracharge.com\/?attachment_id=185\"  rel=\"attachment wp-att-185\"><img aria-describedby=\"caption-attachment-185\" loading=\"lazy\" class=\"size-large wp-image-185\" alt=\"Cold Frame, with water jugs on shelf.\" src=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2013\/01\/IMG_2753-1024x768.jpg\" width=\"550\" height=\"412\" srcset=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2013\/01\/IMG_2753-1024x768.jpg 1024w, http:\/\/www.teracharge.com\/wp-content\/uploads\/2013\/01\/IMG_2753-300x225.jpg 300w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><p id=\"caption-attachment-185\" class=\"wp-caption-text\">Cold Frame, with water jugs on shelf.<\/p><\/div>\n<p>Anticipating the cold winter ahead, it became immediately apparent that we would need to ensure that the cold frame was neither too hot during the day nor too cold at night.\u00a0 While I&#8217;m certain that there exist products that monitor temperature over time, why buy something when you can build one?\u00a0 Thus began the cold frame project.<\/p>\n<p>I built a small controller using an existing 16&#215;2 character LCD, two PIC18F14K22, a 32kHz quartz oscillator, a temperature sensor, and a bit of C code.\u00a0 As an added bonus, I got my hands on a <a title=\"Humidity Sensor\" href=\"https:\/\/www.sparkfun.com\/products\/9569?\" onclick=\"javascript:_gaq.push(['_trackEvent','outbound-article','http:\/\/www.sparkfun.com']);\">humidity sensor<\/a> sold by Sparkfun and decided to track humidity as well.\u00a0 Using a few small breadboards, the whole thing was wired in a day.<\/p>\n<p>The controller breadboard (pictured below) used two PIC18s: the one on the left connects to the 16&#215;2 character LCD display\/backlight and communicates to the right PIC18 over SPI.\u00a0 The right PIC18 connects both the temperature and humidity sensors to an ADC pin and powers the 32kHz oscillator to keep track of time.\u00a0 Two push button are also wired to this latter PIC to allow the user (i.e. us) to set\/update the time.<\/p>\n<div id=\"attachment_190\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.teracharge.com\/?attachment_id=190\"  rel=\"attachment wp-att-190\"><img aria-describedby=\"caption-attachment-190\" loading=\"lazy\" class=\"size-large wp-image-190 \" alt=\"Controller breadboard.\" src=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2587-1024x768.jpg\" width=\"550\" height=\"412\" srcset=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2587-1024x768.jpg 1024w, http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2587-300x225.jpg 300w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><p id=\"caption-attachment-190\" class=\"wp-caption-text\">Controller breadboard.<\/p><\/div>\n<p>Normally, a single microcontroller with more GPIO pins could be used to do the task of both PICs (and with more ease), but this project is part of &#8220;Operation Get Rid of Stuff&#8221;, and look: now I used <strong>two<\/strong> PICs instead of one, that&#8217;s twice as many things no longer in the house!<\/p>\n<p>On the back side of the controller is the display breadboard (pictured below) that wires the LCD display and a <a href=\"https:\/\/www.sparkfun.com\/products\/10967\" onclick=\"javascript:_gaq.push(['_trackEvent','outbound-article','http:\/\/www.sparkfun.com']);\">small boost converter<\/a> from Sparkfun to provide a 3.3V rail for the LCD and controller from two AA batteries.<\/p>\n<div id=\"attachment_189\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.teracharge.com\/?attachment_id=189\"  rel=\"attachment wp-att-189\"><img aria-describedby=\"caption-attachment-189\" loading=\"lazy\" class=\"size-large wp-image-189 \" alt=\"Display breadboard.\" src=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2585-1024x768.jpg\" width=\"550\" height=\"412\" srcset=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2585-1024x768.jpg 1024w, http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2585-300x225.jpg 300w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><p id=\"caption-attachment-189\" class=\"wp-caption-text\">Display breadboard.<\/p><\/div>\n<p>A wire harness goes from the controller board to the temperature and humidity sensors, which are both wired on a separate breadboard (pictured below).\u00a0 The humidity sensor is on the left, while the temperature sensor (<a href=\"http:\/\/www.microchip.com\/wwwproducts\/Devices.aspx?dDocName=en027103\" onclick=\"javascript:_gaq.push(['_trackEvent','outbound-article','http:\/\/www.microchip.com']);\">MCP9700A<\/a>) is on the right.\u00a0 Sandwiched between the two sensors is an additional boost converter to step-up the voltage from 3.3V to 5V, needed by the humidity sensor.\u00a0 The supply rails for both the temperature sensor and the humidity sensor stay off for a whole minute, and at the end of the minute are turned on for a short period of time.\u00a0 During this time, the microcontroller reads the temperature and humidity and records the data.\u00a0 Once sampled, the sensors are once again disabled to save precious battery life.<\/p>\n<div id=\"attachment_191\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.teracharge.com\/?attachment_id=191\"  rel=\"attachment wp-att-191\"><img aria-describedby=\"caption-attachment-191\" loading=\"lazy\" class=\"size-large wp-image-191 \" alt=\"Temperature and humidity breadboard.\" src=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2588-1024x768.jpg\" width=\"550\" height=\"412\" srcset=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2588-1024x768.jpg 1024w, http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2588-300x225.jpg 300w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><p id=\"caption-attachment-191\" class=\"wp-caption-text\">Temperature and humidity breadboard.<\/p><\/div>\n<p>The interface breadboard wires two buttons and a potentiometer for the LCD contrast.\u00a0 Nothing too magical here.\u00a0 Pressing the blue button enables the LCD display and shows a marquee of the the current , maximum, and minimum temperature and humidity readings.\u00a0 Pressing the white button sets the time by incrementing it by 10 minutes on each button press.\u00a0 As a safety feature, the white button does not respond unless the blue button is first pressed.\u00a0 This prevents the us from accidentally setting the time.<\/p>\n<div id=\"attachment_192\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.teracharge.com\/?attachment_id=192\"  rel=\"attachment wp-att-192\"><img aria-describedby=\"caption-attachment-192\" loading=\"lazy\" class=\"size-large wp-image-192 \" alt=\"Interface breadboard.\" src=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2589-1024x768.jpg\" width=\"550\" height=\"412\" srcset=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2589-1024x768.jpg 1024w, http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2589-300x225.jpg 300w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><p id=\"caption-attachment-192\" class=\"wp-caption-text\">Interface breadboard.<\/p><\/div>\n<p>Now I may make this look easy, but packaging the controller and display board in a project box was actually pretty challenging.\u00a0 It ended up being a <strong>really<\/strong> tight fit, with a lucky dremel cut for the LCD to poke through.<a href=\"http:\/\/www.teracharge.com\/?attachment_id=195\"  rel=\"attachment wp-att-195\"><img loading=\"lazy\" class=\"size-large wp-image-195\" alt=\"Controller and Display boards inside a project box.\" src=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2743-1024x768.jpg\" width=\"550\" height=\"412\" srcset=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2743-1024x768.jpg 1024w, http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2743-300x225.jpg 300w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><\/p>\n<dl class=\"wp-caption aligncenter\" id=\"attachment_195\" style=\"width: 560px;\">\n<dd class=\"wp-caption-dd\">Controller and Display boards inside a project box.\u00a0 39% humidity: it&#8217;s pretty dry here&#8230;<\/dd>\n<\/dl>\n<p>Last but not least: placing the whole project in the cold frame.\u00a0 The project box nailed to the cold frame&#8217;s back walls using two nails on the bottom of the box and one on top.<\/p>\n<p>The wire harness is hammered in place using nails as well.\u00a0 The nails are hammered part way in and then bent upwards, cupping the wires to prevent them from falling off.<\/p>\n<div id=\"attachment_196\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.teracharge.com\/?attachment_id=196\"  rel=\"attachment wp-att-196\"><img aria-describedby=\"caption-attachment-196\" loading=\"lazy\" class=\"size-large wp-image-196\" alt=\"Setting controller time in the cold frame.\" src=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2745-1024x768.jpg\" width=\"550\" height=\"412\" srcset=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2745-1024x768.jpg 1024w, http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2745-300x225.jpg 300w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><p id=\"caption-attachment-196\" class=\"wp-caption-text\">Setting controller time in the cold frame.<\/p><\/div>\n<div id=\"attachment_197\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.teracharge.com\/?attachment_id=197\"  rel=\"attachment wp-att-197\"><img aria-describedby=\"caption-attachment-197\" loading=\"lazy\" class=\"size-large wp-image-197\" alt=\"Macgyver wire harness to interface and sensor breadboards.\" src=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2749-1024x768.jpg\" width=\"550\" height=\"412\" srcset=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2749-1024x768.jpg 1024w, http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2749-300x225.jpg 300w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><p id=\"caption-attachment-197\" class=\"wp-caption-text\">Macgyver wire harness to interface and sensor breadboards.<\/p><\/div>\n<p>Lastly, the sensor and interface breadboards are connected to the cold frame with a double sided adhesive surface (<strong>update<\/strong>: this adhesive turned out to be a bad idea.\u00a0 The cold frame&#8217;s high humidity (around 98% max) slowly unglues the breadboards from the wall).<\/p>\n<div id=\"attachment_198\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.teracharge.com\/?attachment_id=198\"  rel=\"attachment wp-att-198\"><img aria-describedby=\"caption-attachment-198\" loading=\"lazy\" class=\"size-large wp-image-198\" alt=\"Interface board (right) and sensor board (left).\" src=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2750-1024x768.jpg\" width=\"550\" height=\"412\" srcset=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2750-1024x768.jpg 1024w, http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2750-300x225.jpg 300w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><p id=\"caption-attachment-198\" class=\"wp-caption-text\">Interface board (right) and sensor board (left).<\/p><\/div>\n<p>And voila, mission accomplished!\u00a0 All in all, this project took about 2 days to complete.\u00a0 Not only have I successfully managed to rid my lab space of quite a few breadboards, PICs, and parts which were collecting dust, but I&#8217;ve managed to do so while providing a useful measuring tool for growing plants over winter.\u00a0 We use this monitor on a daily basis, especially in the morning, after the controller collected data from the previous night.<\/p>\n<p>The controller&#8217;s quiescent draw turned out to be remarkably low as well.\u00a0 When the controller is not displaying the marquee, the LCD is disabled, the backlight is turned off, the sensors are unpowered, and the microcontroller remains in a deep sleep mode, waking up only once a minute to enable and read the sensors.\u00a0 This makes the overall quiescent current of the whole system very small (<strong>update<\/strong>: thus far two AA batteries have lasted over 4 months and are still truckin&#8217;).<\/p>\n<p>And in case you are wondering, the min and max temperature\/humidity are reset daily at 3pm and 3am respectively.<\/p>\n<div id=\"attachment_200\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.teracharge.com\/?attachment_id=200\"  rel=\"attachment wp-att-200\"><img aria-describedby=\"caption-attachment-200\" loading=\"lazy\" class=\"size-large wp-image-200 \" alt=\"Mission accomplished!\" src=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2754-1024x768.jpg\" width=\"550\" height=\"412\" srcset=\"http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2754-1024x768.jpg 1024w, http:\/\/www.teracharge.com\/wp-content\/uploads\/2012\/11\/IMG_2754-300x225.jpg 300w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><p id=\"caption-attachment-200\" class=\"wp-caption-text\">Mission accomplished!<\/p><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We (household members and I) have recently ordered a handmade cold frame made of recycled household building materials. These little boxes are pretty cool: by relying solely on passive solar energy, one can grow all sorts of food during the<span class=\"ellipsis\">&hellip;<\/span><\/p>\n<div class=\"read-more\"><a href=\"http:\/\/www.teracharge.com\/?p=184\" >Read more &#8250;<\/a><\/div>\n<p><!-- end of .read-more --><\/p>\n","protected":false},"author":1,"featured_media":195,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[10,31,37,14,39,13,42,35,36,38,24,41,12,40],"_links":{"self":[{"href":"http:\/\/www.teracharge.com\/index.php?rest_route=\/wp\/v2\/posts\/184"}],"collection":[{"href":"http:\/\/www.teracharge.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.teracharge.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.teracharge.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.teracharge.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=184"}],"version-history":[{"count":17,"href":"http:\/\/www.teracharge.com\/index.php?rest_route=\/wp\/v2\/posts\/184\/revisions"}],"predecessor-version":[{"id":208,"href":"http:\/\/www.teracharge.com\/index.php?rest_route=\/wp\/v2\/posts\/184\/revisions\/208"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.teracharge.com\/index.php?rest_route=\/wp\/v2\/media\/195"}],"wp:attachment":[{"href":"http:\/\/www.teracharge.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.teracharge.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.teracharge.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}