Smokin'Pi - Automated Propane Smoker Controller and Q-View!

Discussion in 'General Discussion' started by noggin, Jan 19, 2014.

  1. noggin

    noggin Fire Starter

    I purchased a Raspberry Pi and received it about a week ago.  If you're not familiar with the Raspberry Pi, it is basically a full blow Linux computer and about the size of a credit card.  I've added an ADC IC to the board and gave it the capability to monitor up to 10 temperature sensors.  I have a thermocouple for detecting flame as well, but I haven't implemented that feature yet.  

    What you see below is the add-on board with the analog to digital converter.  The cables coming off of it allow for connecting to temperature probes.

    I've also attached a multi-turn servo to a needle valve, so that I can get better control over the temperature setpoint.

    Here it is connected to the smoker.  I almost dribbled grease and water on it a few times.  I need to extend the servo wiring so I can get it away from the door.

    I smoked 3 turkey legs, a whole turkey breast, a chicken, a pork butt, and a brisket.  This is only my third smoke, and I had NO trouble with the food.  The Smokin'Pi, on the other hand, did give me a bit of frustration.  At one point, it crashed and wouldn't reboot for about an hour. You can a big temperature jump in the graph.  This is because the Pi wasn't able to log for roughly an hour while I worked on getting it back up and running.

    SEVERAL times through the smoke, you can see that I opened the door WIDE open.  I knew this caused the temperature to drop drastically, but what I didn't know is that it caused the poultry's temperature to drop significantly as well.  The pork and beef handled it much better, most likely because they have a much larger thermal mass.  I opened the door many times, mostly to double check the Smokin'Pi's temperature readings.  I didn't want to discover that I was cooking the meat to charred embers while I'm inside grinning ear to ear with my perceived cleverness.

    I didn't have enough probes to keep one in each piece of meat.  I used 5 probes for the smoke.  One for cabinet temperature, one for the turkey (started in a turkey leg, moved to breast when legs were done), one for the brisket and one for the pork butt.  Throughout the smoke I'd stop the program, change up the firmware, then start the program again.  You can kind of see that in the cabinet temperature line as the smoothness changes.  Pretty early on in the smoke, there was a large temperature swing where it just kept oscillating.  After I quit opening the damned door, and after multiple changes to the code, it became quite stable when I lowered the setpoint to 225°C.  I was worried that the butt wouldn't be done until midnight so I bumped the setpoint back up to to 250°C and it started oscillating again.  I'm fine with the temperature oscillation itself, but oscillation = servo wear and I don't want to replace the servo every smoke.

    Turkey Legs!  I smoked 3 of them, but one didn't make it to the aluminum foil.  He will be remembered fondly.

    Turkey breast.  Came out pretty good, but not as juicy as I'd like though it was far from dry.  I brined it overnight (1 gallon water, 1 cup sugar, 3/4 cup salt) and smoked it breast side up directly on the rack.  Is there a better position for turkey?  Or is turkey just not going to be very juicy compared to chicken?

    Smoked a chicken for my neighbor.  Came out pretty darn good, though it took a little longer to smoke than I expected it to take.  Doesn't matter, the Smokin'Pi let me know when it was done!

    My first brisket!  Came out pretty damned good.  Nice temperature, nice flavor, good bark!  I smoked it fat-cap-up and in an aluminum tray.  

    Almost lost a finger as I was slicing the brisket.  It was difficult to keep my left hand out of the meat while the right hand was slicing

    Would have liked a bit thicker smoke ring, but I was damn happy with the results as they were!

    Smoked a small pork butt for my neighbor, same one that got the chicken.  This was smoked in a tray as well, but very little juices were available to pour back over the meat.  The last pulled pork I did, I added some apple juice to the tray.  I forgot to do it for this one, and that is likely why I didn't have much juice at the end.  I couldn't even separate any from the fat.

    Future plans for the Smokin'Pi include:

    • replacing my current servo control routines with a PID control loop.  This should aid in getting the needle valve set where it needs to be rather than spinning back and forth constantly.
    • Smartening up the main control loop so I can use a higher smoking temperature (like 270°F or so) until all meats are out of the danger zone, then drop back down to the appropriate temperature for the meat in the smoker
    • Implementing a web interface so not everything has to be done at the command line.  Right now, all you see is a screen full of somewhat intimidating information that continually scrolls by.  The web interface will allow for a much simpler control and monitoring capabilities
    • Implement flame detection (have the hardware, just not the software) so in case the flame blows out the needle valve can be closed
    • MAYBE add auto-ignition so it can attempt to light the flame when it goes out
    • Text or Email notification when milestones are reached (e.g. text message when the meat is within 5°F of final temperature

    I did all of this in one week, and I'm quite happy with the results.
    Last edited: Jan 19, 2014
  2. handymanstan

    handymanstan Smoking Fanatic Group Lead

    Well Noggin you have impressed me and I will be watching to see how this develops.  The brisket pics are to die for. [​IMG]Good job.

  3. daveomak

    daveomak Smoking Guru OTBS Member SMF Premier Member

    Very nice start to a worthwhile project.... I wish I understood half of what you are doing... Growing up in the "analog" age leaves me behind in this stuff..... But I'm watching and learning.....

  4. worktogthr

    worktogthr Master of the Pit SMF Premier Member

    Haha I too wish I knew what this meant but think it seems cool!
  5. noggin

    noggin Fire Starter

    Thanks!  As I make significant (interesting) code improvements, I'll post updates about the project.  I have been working on the code this morning, but it is mainly in stuff that no one would care about...things such as reducing CPU usage (it was pegged at 100% for 9 hours yesterday and that may have contributed to it dying and refusing to boot for an hour) and correctly handling signals that the process is being closed so file streams can be flushed and closed properly.

    As for the brisket, I was terrified that it wasn't going to turn out well.  The wife was a little upset when she saw how much I spent on meat.  She had been begging me to smoke a turkey for a couple of weeks, and so I smoked it for her.  She was excited to eat it, then she tasted the brisket.  "Uhmmm...I think I'm gonna have turkey and  brisket!"  Then she didn't put any turkey on her plate, and went back for seconds and thrids on the brisket.  

    I was planning on nibbling on the brisket all week, but it looks like I'll be lucky if it lasts past tomorrow.  We ate half of it last night.
    All of this can be done with analog controls, but you'll miss out on the web interface and logging.  You can do something along the lines of using a gas oven thermostat (modulating thermostat would be best) to regulate the temperature, a thermocouple to detect flame, a circuit to generate ignition pulses when the thermocouple is below some temperature, and a method to restrict gas flow when your thermistors read a specific setpoint.  I wasn't able to find a way to restrict gas flow easily, so I resorted to using a needle valve and servo motor.  The servo control might be difficult in the analog world though.  I did see some current controlled proportional valves though that I considered getting, but they were fairly expensive and most of them were not rated for flammable gas.

    And I'm a digital guy, so that was a big reason to going digital with the project for me :)  I did almost give up before I came up with a decent method for connecting the servo to the needle valve though.  I didn't want to deal with pilot lights nor did I want to use a solenoid valve to completely disable propane flow.
    Sometimes I think, "WTF am I doing?" and "Is this much work worth it?"  I decided, "Yes, this is worth it," when I woke up my laptop and saw that the temperatures were spot on and the meats were almost done.
  6. handymanstan

    handymanstan Smoking Fanatic Group Lead

    "And I'm a digital guy, so that was a big reason to going digital with the project for me :)  I did almost give up before I came up with a decent method for connecting the servo to the needle valve though.  I didn't want to deal with pilot lights nor did I want to use a solenoid valve to completely disable propane flow."

    Can your servo turn off the gas or just up and down a little?  I am thinking this is like a pid and if wood flares up raises your temp would the servo shut off the gas. My pid goes to 00% shutting down my element.

    Looking on line seems cheap enough this old man might have to check one out to play with.  Keep us posted.

  7. noggin

    noggin Fire Starter

    The servo can close the valve and shut off the gas completely, but at the moment I don't allow it to close all the way.  I'm not sure yet just how low I can allow it to go before the flame shuts off, and on the first run of using the Smokin'Pi, I didn't want it to keep killing it unnecessarily.  I have to be careful as I don't have any position feedback from the servo.  It also doesn't seem to have that great of an accuracy, I can tell it to go to 10° from a current position of 20° and it might not move.  I'll usually hear the motor turning on the inside, but that doesn't always translate to external movement.

    To address the question more directly, if the wood flares up, it'll cut the propane back but not off.  However, the servo is capable of shutting the valve completely, I just don't let it go that far.
  8. handymanstan

    handymanstan Smoking Fanatic Group Lead

    I believe that servo is your weak point.  Once you get that figured out I think you will have something pretty cool here.  Just don't want the gas shut off then turned on again without a pilot.

  9. handymanstan

    handymanstan Smoking Fanatic Group Lead

    Morning Noggin, Where are the updates? [​IMG]  

    I am really interested in the raspberry pi.  So much so I bought one for my son to play with.  He’s kind of nerdy and writes code for a living so you know he loves it.  I told him I wanted one to use for multiple PIDs and Temp probes.  I plan to run three pits and 8 probes with it.  After two days he has the code and is getting a list together.  He has not called with a list yet so I wait.

    Are you using code that you wrote or something off the net like heatermeter ?

    Heatermeter is what my son Jeff  is starting with and he has made some changes to the code so it will do what I want.

    I will have to wait a couple of weeks to get the circuit board then it should go fast.

    Thanks for starting this thread.

  10. noggin

    noggin Fire Starter

    I'm using a few libraries that other have written, but the meat of the code is mine.  I thought about starting with the Heatermeter code, but it uses an Arduino.  I wanted this to be all done on the RPi.  I've never written programs to run on Linux systems, or run multiple threads so a lot of this is new to me.  As I gain familiarity with the RPi, I'll probably take a look at Heatermeter to see how he uses a web page to monitor and/or control the system.  That is my biggest technical challenge at the moment, at least in my mind.


    WiringPi - I'm using this for SPI communications with my analog to digital IC

    pigpio - I'm using this to generate accurate PWM for my servo

    ncurses - I'm using this to allow me to issue commands over an SSH terminal

    I've made some decent progress on the firmware over the last week, but nearly had a disaster on Saturday.  I was up until 2 AM Saturday morning writing code.  I put the two butts in the smoker and went to bed shortly after.  When I added the chicken and turkey legs a few hours later, my wood chips flared up and and melted 5 of my 7 temperature probes.  I rushed them into work, replaced the melted wire and brought them back to the smoker.  

    Everything was going fine until I went to add more wood chips a few hours later.  When I opened the door, the wires brushed against the chip tray and melted 4 of them.  Quite a rough day, but overall it was successful.  15 lbs of pork butt, 6 boneless chicken thighs, 2 whole chickens, and 6 turkey legs.  

    I've tossed out the damaged cables and bought 10 more new ones.  I've also ordered an AMAZN pellet smoker so this will be more of a set it and forget it setup when it is done.  

    The first weekend I used the Smokin'Pi, I had to recompile the code whenever I wanted to change the temperature setpoint.  Now, I can enter commands via SSH to set the the desired temperature or control the servo directly.  Makes the process much easier.  However, due to the stress involved with killing my temperature probes, I didn't take any pictures nor bother to review the logged data.

    Major software things remaining:

    - Add a PID controller.  I've written one, but haven't actually enabled it yet.

    - Make the program log to a SQL database in addition to the Excel .csv file

    - Figure out how to make a web page interact with the program I've written

    The temperature sensing board I've made allows for the use of 11 analog channels.  One is for sensing the temperature of the cabinet, 9 for sensing food temperatures, and 1 for sensing flame.  I used a prototyping board to build my analog stuff.  I may design my own board, and if I do, I can easily expand it to sense 22 analog channels (1 cabinet, 20 food temperatures, and 1 flame sensor).
  11. I'm Sorry Noggin, Do You Speak English? If not, maybe Dave and I can get an interpreter.     ( IronMan2 ). People like you make me sick,LOL. Or maybe that is Envy. I only wish I could do half of what your talking about. Let me know when you get it all figured out, an in a package I can BUY.  I'm building a Smoker out of an old donut proofer and what your talking about is what I'd like to have to run it with.

        It's funny and sad how our professions can totally change our lives. I chose to drive Trucks, cross country, made a descent living for my family. I, on the other hand paid the price. Did a lot of reading while driving those miles, but never had the time to do what I read about.

        Keep on speakin your New Age Languish and Dave and I will try an keep up.

  12. handymanstan

    handymanstan Smoking Fanatic Group Lead

    Thank you for the response Noggin, Bummer on the wires melting.  [​IMG]   Good job on getting this to work. 

     I am laughing at the thought of a programmer that can eat his mistakes.


    I sent my son a copy of this post so he can look at the libraries. 

    I hope you get it figured out soon and a way to keep your cables safe. 

    If I get mine to work I will start a thread about it.


Share This Page