Project ShowcaseHave a project that you're dying to pimp? It doesn't matter if it involves robotics, RFID, HCI, or what, as long as you think it's cool, pimp it here! Need more space for pics/videos email us:)
USB-Q, the automated BBQ Grill temperature control
__________________________________________________ _____________ UPDATE: For more information on the status of this project visit us at: www.geekwithfire.com __________________________________________________ _____________
My simple little project seems to pale in comparison to most of the folks work here, but here goes:
Project:
Automatically regulate the temperature on my BBQ smoker by constantly reading the internal pit temperature and making necessary adjustments to the damper; thereby increasing or reducing the inflow of air to fuel the charcoal/wood mix.
Software Process:
Thermistor generates resistance with temperature change. Temperature change is converted into voltage drop. Voltage drop is converted to temperature (via a calibrated lookup table in a database). Temperature is bounced off of a PID loop every seconds which makes needed adjustments to the servo position.
Benefits:
I am now able to sleep at night while my smoker is going on those long cooks (sometimes cooks up to 2o hours). As long as I keep fuel in it, it maintains temperature perfectly. If for some reason the temperature exceeds the adjustable threshold, an audible alarm will sound, notifying the operator of a required intervention. In addition, and not shown on the version of the video, I am able to set the desired temperature of the particular meat I am smoking. When the desired temperature is reached, the smoker shuts down, to avoid burning my dinner!
In addition to controlling the smoker, I also capture data points every 20 seconds so as to chart the accuracy of a long smoke (see the attached image; one of my original tests, that does have some large variations in temperature).
Re: USB-Q, the automated BBQ Grill temperature control
Nice. If it allows you to cook a brisket without putting your life on hold for a day, I'm all for it. Just out of curiosity, what kind of smoker do you have?
Re: USB-Q, the automated BBQ Grill temperature control
Alex:
I haven't settled on a price yet. All depends on if I ever quit tinkering with it! Right now I'm adding a "logical rules" process so the user can establish a logical cooking process based on feedback from various inputs. At the same time, I'm coding around the concept of controlling multiple smokers within the same instance of the program. With that said, I would love to be able to program around an unknown amount of phidget devices, but I just can't seem to figure it out. Yet, I plug away.
Dave:
The smoker is a Chargriller Pro, with the Side Fire Box; typically full of Royal Oak lump charcoal and 1 year old seasoned apple chunks from my personal orchard.
Re: USB-Q, the automated BBQ Grill temperature control
Quote:
Originally Posted by elcray
Alex:
All depends on if I ever quit tinkering with it! [...] I would love to be able to program around an unknown amount of phidget devices, but I just can't seem to figure it out.
I hear ya about tinkering! I'm always trying to perfect the applications that I build
About the "unknown amount of phidget devices"; I see that you are using VB.NET. Is this perhaps VB.NET 2005, or even VB.NET 2005 Express Edition? The reason why I ask is that I was working on what I called "Dynamic Phidgets" in C# 2005 a while back which used what are called Generics which are unique to Visual Studio 2005 and 2005 Express Edition.
The purpose of "Dynamic Phidgets" was to ignore how many Phidgets were connected to a single machine, and just keep storing them in a Generic Collection as they are attached and removing them when they were detached. Then, I can do what I want with them while they are active in the application I built.
Generics are incredibly powerful, and if you are not familar with them, I highly recommend on reading up on them here, here and here. There are a ton of other examples, but this will help you get started in understanding them if you don't already. Sorry, but these are all C#, but if you understand VB.NET, you understand C#. All of the concepts are the same, the only difference is syntax.
Basically what I did to create Dynamic Phidgets is create a Generic Dictionary Phidget object with the key of the Dictionary being a long variable which will be the serial number of each Phidget:
Code:
private Dictionary<long, Phidgets.Phidget> phidgetDictionary = new Dictionary<long, Phidgets.Phidget>();
Then, I created a new Phidget Manager object, and intialized it:
Code:
private void InitializePhidgetManager()
{
PM = new Phidgets.Manager();
PM.Attach += new Phidgets.Events.AttachEventHandler(PM_Attach);
PM.Detach += new Phidgets.Events.DetachEventHandler(PM_Detach);
PM.Error += new Phidgets.Events.ErrorEventHandler(PM_Error);
PM.open();
}
The Phidget Manager object was necessary because you never know what type of Phidget a user connects to the computer and you need to account for this
Finally, I hooked the Attach and Detach events of the Phidget manager and ran checks to see if they existed in the Generic Dictionary Class. If they did/didn't I added/removed them respectively:
Code:
void PM_Detach(object sender, Phidgets.Events.DetachEventArgs e)
{
if (phidgetDictionary.ContainsKey(e.Device.SerialNumber))
{
phidgetDictionary.Remove(e.Device.SerialNumber);
EventLogger.LogEvent("Object Deleted from Dictionary:" + e.Device.GetType().ToString() +
" Serial Number:" + e.Device.SerialNumber);
}
}
void PM_Attach(object sender, Phidgets.Events.AttachEventArgs e)
{
if (!phidgetDictionary.ContainsKey(e.Device.SerialNumber))
{
phidgetDictionary.Add(e.Device.SerialNumber, e.Device);
EventLogger.LogEvent("Object created and added to Dictionary for:" + e.Device.GetType().ToString() +
" Serial Number:" + e.Device.SerialNumber);
e.Device.open();
e.Device.waitForAttachment(500);
}
}
NOTE: I worked with Phidgets to get the e.Device returned as the actual object itself that it found. This way, you can run a check on the Type of Phidget object that was found and do what you need to with it
This will allow you to ignore the fact of how many Phidgets get connected to the computer. Then, you can simply roll through the Dictionary to find the Phidget objects you have added and do what you need to with them!
I hope all this made sense. Let me know if you have any questions
Re: USB-Q, the automated BBQ Grill temperature control
No problem, good luck!
I had a little bit of a hard time wrapping my head around Generics at first, so don't hesitate to give me a shout if needed. Please keep these sort of questions though via email.
Re: USB-Q, the automated BBQ Grill temperature control
Quote:
Originally Posted by Alex
No problem, good luck!
I had a little bit of a hard time wrapping my head around Generics at first, so don't hesitate to give me a shout if needed. Please keep these sort of questions though via email.
It's been a while since I've posted, but wanted to write an update on the status of my project; namely the process of adding an unlimited number of phidgets to a project at runtime. I read up on the topics listed above, and I'll be honest, much of it was above my head. I'm glad it was, because it forced me to start from scratch. I now have an application that will allow me to add an unilmited number of Thermocouples, InterfaceKits, and Servos by using Classes and Controls. I wrote Visual Studio UserControls for each of the items listed above. At runtime, I simply add the controls to the application, and assign the serial number. I still have much of the user interface to retool, but the infrastucture works very well. Because of the infrastructure change, I can operate an unlimited number of BBQ pits, using an unlimited number of servos, thermocouples, and thermistors. Here's a screenshot of the rough application update.
Re: USB-Q, the automated BBQ Grill temperature control
We are working on the new downloads area where there will be a section for demo apps / widgets. Would you be willing to post your Phidget controls in there for others to use? They would be a great tool for many others I'm thinking.
Re: USB-Q, the automated BBQ Grill temperature control
Quote:
Originally Posted by Matt
We are working on the new downloads area where there will be a section for demo apps / widgets. Would you be willing to post your Phidget controls in there for others to use? They would be a great tool for many others I'm thinking.
Sure. Just let me know when you're ready. I will have to say, it's pretty basic stuff though. But maybe it might spark someone's imagination.