# HeaterMeter Controller, with Wifi, and Electric Smoker (MES40) Mod in Detail



## tallbm

Want to know how to setup the HeaterMeter PID Controller with Wifi to work with the MES?  Here you go :)
[h1]Table of Contents[/h1]


Overview
HeaterMeter Mod Design
MES Rewired - just mention don't go into detail
HeaterMeter Based Controller Box Wiring and Diagrams

HeaterMeter Setup
Common Setup
STATIC IP SETUP
ADDITIONAL ELECTRIC SMOKER SETUP
ELECTRIC SMOKER PID Tuning Settings    

MES Cooking/Smoking Setup for Best Results
Mods that exist in my system that may give me different/better results than another setup
Materials list    
Pics of My HeaterMeter Controller Mod :)
[h2]1. Overview[/h2]
When it comes to controlling an electric smoker such as the Masterbuilt Electric Smoker (MES) many have opted to rewire it and use a 3rd party controller they buy or build such as a PID controller (Proportional, Integral, Derivative).

The HeaterMeter is a Raspberry Pi device (small computer device) that was initially built to control Charcoal Smokers using PID controller logic to work with a blower fan to stoke the coals of a smoker.  The HeaterMeter device provides great features for controlling and monitoring a cook/smoke such as:

Wifi control setting and monitoring capability
Graphical Monitoring of a cook/smoke with times, probe temps, and the history of the entire cook/smoke
Web page based interfaces to change control settings such as smoker set temp, probe offsets, graphing options, etc.
Additional interfaces so Apps like PitDroid can be written to monitor and control the smoke from a mobile device App or a software application you can write on your own if you have that skillset and background
Phone app support to control and monitor your smoker from your phone
Multiple probes that can be managed and monitored, 3-4 probes depending on device built
PID control, which allows for tuning according to your smoker behavior and environment to get the steadiest and best performance 
What I have done is use the HeaterMeter controller to control my Electric Smoker, my MES40.  

There is not much information available out there online for using the HeaterMeter to work with an electric smoker so I figured I would post some details for anyone who wants to go this route.

The formal HeaterMeter documentation can be found here: https://github.com/CapnBry/HeaterMeter/wiki

*IMPORTANT:* Remember the HeaterMeter was not designed for electric smokers so the PID tuning information will not work exactly as documented.
[h2]2. HeaterMeter Mod Design[/h2]
The following are the HeaterMeter (HM) Mod Designs and such that are needed to put the HM to use with an Electric Smoker (MES).
[h3]MES Rewire[/h3]
First off the electric smoker must be rewired to work with the HM controller or any 3rd party controller.  This section will not go into detail on rewiring an MES but I may do a separate post and link to it from here.  There is quite a bit of good info on this forum for rewiring an MES so feel free to Google away on it.

In short, the MES must be rewired so that the Power chord is wired to bypass the MES controller and circuit board to run electricity to the MES heating element.  

Also, It is wise to include the existing MES Rollout Limit Saftey Switch into the rewire job so should the MES reach a high enough temperature to trigger the rollout limit switch, the switch will cut off power to the heating element in order to keep the MES from burning down and causing any dangerous fire situations.
[h3]  [/h3][h3]HeaterMeter Based Controller Box Wiring and Diagrams[/h3]
(*FEEDBACK ENCOURAGED:*   I am not an electrician so if there is any content in here that is misstated, poorly described, or potentially dangerous please feel free to let me know and I will fix or remove the content so it is not out there to confuse or cause a dangerous situation.)

*DISCLAIMER:*  This information is a guideline and you should consult an electrical professional concerning the information below and for your electrical wiring/setup project.

Once the MES is rewired for a 3rd party controller the next order of business is to create a Controller Box to hold the wiring and electrical components needed to control the MES smoker.

How is the HeaterMeter (HM) or any 3rd party controller used to control a smoker?

Well in short the HM will measure the temperature in the smoker with a probe and based on the Set Temperature, the HM will send a control signal to switch power on/off to a device that will work to increase the smoker temperature or to stop.  

The original HM intent was to send an outpout signal to turn on/off a blower fan to stoke coals at 0-100% of the fan's blowing capability.  No need to go full blast with the fan all the time.

Using the HM with an MES or any Electrical Smoker is almost the same except there are some differences that matter.

What happens when a HM is used with an MES is that the HM will still send the signal but it should instead go to a switch called an SSR (Solid State Relay) not a blower fan.  

The SSR is wired to have the 110V electrical power current coming in and wired to send the 110V electrical current out.

When the SSR receives the signal from the HM, the SSR will switch on to allow the power to flow through itself and onward to the MES chord which is rewired to go to the MES heating element.

The MES heating element will heat until the Set Temp is detected by a probe at which point the HM will stop sending signal to the SSR thereby switching the SSR to the Off position so no more power goes to the MES heating element.

Here is a Diagram to help picture it:













HMtoSSRtoMES.png



__ tallbm
__ Jun 16, 2017






Now with that you understand how the HeaterMeter will control a rewired MES we can proceed to more realistic diagrams and concepts.

Things to Consider:

It would not be safe to just have wires running all over feeding 110V of power to devices like an SSR that are exposed so a controller box would need to be built to house and protect everything.
The controller box would need a power plug to plug into a wall outlet to get 110V power to control the MES.
The controller box would need an outlet so the MES could plug into the controller box to receive 110V of power from the SSR to power off/on the heating element
It would be necessary to run a fuse in to the system so that if any power surges or electrical issues cause a pull of more power than desired the current could be cut off for safety reasons by the fuse blowing
It would also be nice to have an On/Off switch to the whole controller bus to control the power from the wall into the controller box rather than on/off being dictated by plugging/unplugging to the wall
The HM doesn't take 110V it takes 12V so the voltage would need to be stepped down to power the HM.  This is done through a 12V adapter plug but it is nice to hide that plug in the controller box, not to mention wiring up an easy way to plug a 12V power plug to the incoming 110V power 
The controller box is the place to handle all of the real life considerations mentioned above that the simple conceptual diagram above did not take into consideration.

*Hot/Load Wiring Design and Diagram*

The hot/load wiring will need to:

Come from the 110V power outlet into the Controller Box
110V should first go to a 15A fuse 
From the 15A fuse to an On/Off Switch that can handle 20A or more of continusous current.  
I suggest you buy something metal and not Chinese.  I burned up two 20A Rocker switches that were cheap chinese junk.  I then went overboard and bought a 100A Marine Boat Breaker Toggle Switch and have had no issues with that hardcore switch :)
From the On/Off Switch wire out to a split point.  You will split to the:
SSR
From the SSR to an Outlet installed in/on the controller box.  This what the MES will plug into to receive power.

Outlet or Female end of a power/extension cord for the HM 12V adapter power plug to plug into
This will connect to the 12V adapter power supply
The 12V adapter power supply to the HeaterMeter, to power the HM


Here's a Diagram to visualize, start from the Power Plug and follow the arrows to see the directional flow of 110V electricity:













hotWiring.png



__ tallbm
__ Jun 16, 2017






*Neutral Wiring Design and Diagram*

The Neutral wiring to complete the electrical circuit will need to:

Come from the 110V power outlet into the Controller Box
Then to a Split Point.  You will split to :
To the same Outlet installed in/on the controller box that the SSR Hot/Load is wired to.  This what the MES will plug into to receive power and will need both the Hot/Load and Neutral wired to it.
The Same Outlet or Female end of a power/extension cord for the HM 12V adapter power plug to plug into
The HM 12V adapter power plug needs both Hot/Load and Neutral wired to it


Here's a Diagram to visualize, start from the Power Plug and follow the arrows to see the directional flow of the Neutral wiring:













NeutralWiring.png



__ tallbm
__ Jun 16, 2017






*Ground Wiring Design and Diagram*

Finally the ground wiring will need to be setup so that if there is an issue the electrical current can go to ground for safety sake. *  IMPORTANT:* Read up on grounding devices for full understanding of how and why you should do it :

From the 110V power outlet into the Controller Box
To ground screw fastened to metal Controller Box

From the same Outlet installed in/on the controller box that the SSR Hot/Load is wired to
To ground screw fastened to metal Controller Box

From the Same Outlet or Female end of a power/extension cord for the HM 12V adapter power plug to plug into
To ground screw fastened to metal Controller Box
Here's a Diagram to visualize, start from the Power Plug and follow the arrows to see the directional flow of the Ground wiring:













GroundWiring.png



__ tallbm
__ Jun 16, 2017






*Safety*

Anytime you mess with electricity be sure to take the proper precautions such as:

Using the proper tools to test with like a MultiMeter
Use protective gear to prevent electrical shock or worse
Make sure the device is properly grounded
Do not touch wires or components with hands while the device is plugged in
Be sure to insulate any bare connectors, wires, or exposed metal that will have current running through it
Consult an electric professional for assistance
[h2]3. HeaterMeter Setup[/h2]
It is best to test and setup the HeaterMeter (HM) device before going through the effort of building and wiring up a controller box.  

It is best to know that various components of a build/project work before assembling everything and discovering an issue but not knowing where it exists.

The HM has multiple areas to be setup but in short you will need to ensure it powers on properly, setup wifi capabilities, make life easier by setting up a Static IP for the HM, and finally perform PID tunings and configurations needed to work best with an Electric Smoker.
[h3]Common Setup[/h3]
Perform the following steps for performing the initial necessary setup:

Formal HM documentation can be found at the following link but you will need to sort through it to find the documentation that is relevant to this/your build.  My information below is kind of the cliff notes versions of the documentation here: https://github.com/CapnBry/HeaterMeter/wiki/HeaterMeter-4.x-Software


Plug probes into HM
*IMPORTANT:* Maverick probes do NOT need to plug in all the way, they will plug in about 3/4 of the way.
If you plug in all the way they will not register, you will need to pull them out to the next "stop".  I think the formal HM documentation says you may chance breaking the port on the HM, but I have pushed all the way into the ports a number of times and had not broke anything but I try to avoid it.  


Plug Ethernet chord into HM and into your router
Plug USB WIFI adapter into HM
Plug 12V Power Adapter chord into HM and then put the 12V plug into the wall power socket.  The HM device will boot up automatically, give it about 30 -45 seconds to fully boot up.  You should see some output displayed on the HM device LCD screen.
Once the HM boots up get on a computer that is connected to your network and go to http://heatermeter.com/devices/ and you should see your device registered
Click the Address IP link (underlined in the image below) and it will open the Dashboard where you can log in and set up other configurations












hmUrl.png



__ tallbm
__ Jun 16, 2017







*IMPORTANT* (taken from formal documentation): Note: If your wifi SSID or password contains quotes (single ' or double ") then you're going to experience a nightmare trying to get this to work. E.g. your SSID is "Bryan's Wifi" = bad. 

Follow Wifi Setup Steps here at the section with the header "Wireless Client Setup via Web Config step-by-step" https://github.com/CapnBry/HeaterMe...less-client-setup-via-web-config-step-by-step 

After following the Wifi Setup Setps, Unplug the ethernet cable from the HM and reboot now that Wifi client has been configured, you cannot have both plugged in once configured.  
If your device does not register at http://heatermeter.com/devices/  or cannot access via the Wifi address after reboot that is because you have the issue where both the ethernet and wifi network cannot be setup on the same subnet (router stuff) follow the next step if you have this issue (I had the issue as well so don't be afraid)
*IMPORTANT:* I had to follow the troubleshooting information here at the header "My Wifi interface never gets an IP address": https://github.com/CapnBry/HeaterMe...ng#my-wifi-interface-never-gets-an-ip-address
                (TODO: need to post some pics for this important instruction)

Once Wifi is properly setup you should see the following and be able to click the Address IP link for the wifi line and get to the HM dasbhoard












hmUrl2.png



__ tallbm
__ Jun 16, 2017





Dashboard Example Here:












ptunes.png



__ tallbm
__ Jun 12, 2017






d
 
[h3]Static IP Setup[/h3]
What in the world is a "Static IP Setup"?

Well you will notice that as you unplug or turn off your HeaterMeater (HM) and then turn it back on and hit the http://heatermeter.com/devices/  page that the Address value may/will change.  A changing IP is not desirable.

The IP Address is the location on your network that a device is assigned so it can be located.  Much like your home address is the location assigned to your home so it can be physically located in the world.  Your home router will assign the IP to the HM device however it sees fit and will not always use the same IP address.

Configuring a static IP is not mandatory but it makes life easy so you don't need to look up the new address every time to hit the dashboard and more importantly when you use an app like PitDroid on your phone to monitor and control things form your phone you will not need to enter the new IP address in every time for the app to connect to the HM and work properly.

Now everyone is likely to have a different brand and model of router so I will post some instructions for a Netgear router on how to do this.  These instructions are basically the same for any/all routers so they will give you the idea of what you need to do for yours.

Google the Static IP Setup instructiosn for your router 
Open a web browser on a computer that is on your network (IE, Firefox, Chrome, etc. are all web browsers)
In the web browser address bar enter the address to your router configuration page often it is http://192.168.0.1 
Login, *IMPORTANT*: it is a good idea to change the default router login password (THIS IS NOT THE SAME AS YOUR WIFI PASSWORD so don't confuse the two) to something strong and unique. If you keep/use the default router login password someone can easily Google what the password is for the model of your router and that is bad
Follow the next steps for a Netgear Static IP Setup documented here https://kb.netgear.com/25722/How-do-I-reserve-an-IP-address-on-my-NETGEAR-router:

Launch a web browser from a computer or mobile device that is connected to your router’s network.
Enter http://www.routerlogin.net.
A login window displays.
Enter the router user name and password.
The user name is *admin*. The default password is *password*. The user name and password are case-sensitive.
The BASIC Home page displays.
Select *ADVANCED > Setup > LAN Setup*.
The LAN page displays.
In the Address Reservation section, click the Add button.
The page adjusts.
In the *IP Address*  field, type the IP address to assign to the computer or server.
Choose an IP address from the router’s LAN subnet, such as 192.168.1.x.  (192.168.0.110 would be a good choice for the HeaterMeter)
Type the MAC address of the computer or server.
*IMPORTANT*:  Get your HeaterMeter MAC address like this while it is connected and running - If the HM is already on your network, you can copy its MAC address from the Attached Devices page and paste it here.
Click the *Apply*  button.
The reserved address is entered into the table.

The reserved address is not assigned until the next time the HeaterMeter contracts the router’s DHCP server. Reboot the HM and check that it now is bound to the IP you assigned by checking the page http://heatermeter.com/devices/
[h3]Electric Smoker (MES), HM, and PID Tuning Settings[/h3]
The information for configuring the HeaterMeter (HM) to use with an electric smoker is not easy to come by and has to be pieced together from all kinds of online sources.  Well I believe this section will act as a consolidated list of the settings needed for the HM to work well with an electric smoker like the MES.

*Non-PID Settings (these are mandatory):*

//TODO: Add section on deleting the BSSID value to avoid issues should you change router for a new one or due to old router dying!!!!
Fan Output:  Pulse
min: 100%
max: 100%
startup max: 100%

Lid Open Detection (this setting makes NO sense for an electrical smoker and will cut the heat off, it drove me nuts before I figured out how to basically disable it)
Activate at: 0%
Continue for: 30 seconds














settingsPage.png



__ tallbm
__ Jun 19, 2017






*PID Settings:*

Every kind of PID controller could potentially have a different set of steps/logic (algorithm) it uses to manage control behavior.  The HM PID steps and settings result in a slightly different behavior than the Auber electronic PID controller I have used as well.  The documentation for the HM PID behavior therefore does not exactly apply to an electric smoker like it does for a blower fan and working with coals in a more traditional smoker.

I will explain how these settings and the HM will work.

*Proportional "P"*: This is the setting that will be used for building temp in most PID controllers and more importantly is used to calculate how the "I" and "D" settings will respond help control the system.  Believe it or not the "P" tuning is really not going to do the heavy lifting here but is needed for the "I" and "D" settings to do the major work in this configuration
 *Integral "I"*: This is the setting traditionally helps bring the P value into tune helping to avoid major dips or major overshoots of temperature.  Well with these HM PID tuning values and an electric smoker the "I" tuning seems to only work on bringing the temperature up to the set point when the temperature is below the set point.  That's the behavior you will see with the "I".  So the "I" tuning is mostly responsible for getting up to the set temp.  The value should be low because every second the temp is under the set temp the "I" value makes the heat output signal grow and last longer.  You do not want this to grow too much for too long.
*Derivative "D"*: This is the trickiest setting to deal with and is the MOST important in use with the HM and the electric smoker.  The "D" looks back in time to figure out the rate of change that is occurring.  If the temp change is growing too fast it will cut the outpout so the temp stops growing.  Alternatively, if the temp is dropping too fast the setting will increase output so that the heating element cuts on and keeps the temp from dropping too fast.  The "D" will be the major player along with the "I" setting for the PID control of the electric smoker with the use of the HM.
Ok, a number of you may read that explanation and think "that's now how PID control and tunings work with what I am familiar with!"  I understand and must reiterate the point that different PID controllers can have different control logic and their PID tunings may cause things to behave differently.  That is definitely situation that is occurring in this case.  Again, the HM was built to use with a blower fan on charcoal so it was not exactly built to control the behavior of an electrical system and that makes things a challenge to figure out an understand :)

In all what will happen with the following PID settings is that the "I" will bring your temp up to the set temp and along with the "P" will overshoot by about 7-13 degrees.  

At that point the "D" will act like a parachute allowing the temp to slowly drop to the set temp.  The "D" is in a loosing battle but keeps the temp from plummeting. 

Once the temp drops below the set temp the "I" will begin to kick in to bring the temp back up to the set temp:

At this point the "D" may kick in to cut the power at time to keep the temp from increasing too rapidly.  Then the "D" will work again to slowly drop the temp back down to the set temp where then the "I" will kick in to bring the temp back up to the set temp.

This whole time the "P" is doing minimal work other then being the number that "I" and "D" will help perform it's calculations to control the heat.

Ok with all of that explained away, let's get to the PID settings, here they are:

*P*: 5
*I*:  1
*D*: 104
*Probe and Rack Placement*: Use the lowest rack position of the MES/electric smoker.  Place the smoker probe at the bottom of the rack in the center .  I use an alligator clip Thermocouple probe so it clips directly underside the rack at the bottom grate level.
*Temp Expectations*: Expect within a -+2 swing in temp around your set temp.  Temp range I have tested is 100F through to 325F.  At temps over 175F or so the temp swing gets even smaller!  Once thing I do at higher temps is set 1 degree high, so for a temp of 225F I set to 226F and the temp mostly sits between 225.5F to 226.3F.  
[h2]4. MES Cooking/Smoking Setup for Best Results[/h2]
So for best performance follow the PID tunings and use the lower rack first and then move upwards to higher racks.

The bottom 2 racks are the most consistently close to the set temp.

The top 2 racks have a greater temp discrepancy and may have trouble hitting the set temp.

I have noticed though that each rack in my system holds within it's temp range though the temp range may not be as close to the set temp as the bottom rack or the bottom 2 racks.

So in short, if your top rack is 15 degrees lower than the set temp and swings by 5 degrees then you can pretty much expect it to be consistent with that behavior.

This is why I use the bottom 2 racks as much as possible to get as close to the set temp with the lowest temp swing as possible.

I wish I could say that the MES could have an even temp all over with the HM setup but I just don't think it is possible with the initial design.  I've tried a bunch of stuff and the best I can get is predictable results, minimal temp swings, and greater control than the stock MES controller behavior.  I can now do sausage, bacon, chicken with edible skin, you name it I can do it with confidence!
[h2]5. Mods that exist in my system that may give me different/better results than another setup[/h2]
I have done quite a bit of mod'ing to ensure I get minimal temp swings, can actually hit my set temp, and to be able to manage smoke separately from heat management/cooking.

Mailbox Mod with AMNPS for smoke generation whether the smoker is on or off or at any temp
Convection Fan mod with somewhat variable speed control. I installed a convection fan to help stir air and smoke so I could get as much heat consistency within my smoker as possible.  This is the same idea as a convection oven.  It helps for sure but cannot overcome keeping the temps even across all racks but keeps the temps consistent at those racks
HeaterMeter with custom controller box that houses everything and controls the smoker and fan
[h2]6. Materials List[/h2]
Here is a list of materials that I used for the HM and Controller box mods.  More materials may need to be purchased but here is the best I could do along with prices.  I would love to post links but I think that is frowned upon unless someone states otherwise for this post.


Auberins.com
-------------

1 ea.     25A SSR Item #: MGR-1D4825 $9.95

1 ea.     Thermal Pad for Single Phase SSR Item #: SI-PAD        $0.99

1 ea.     HeaterMeter 3D Printed Case with Defects Item #: SD-HMCase             $16.00

1 ea.     External Mount Heat Sink for 25A SSR Item #: HS25ET $12.50

1 ea.     HeaterMeter for BBQ Control     $228.85
Item #: HeaterMeter

    HeaterMeter Bare Board - Four sensor ports (1 x TC, 3 x thermistor), Blue 
    HeaterMeter Accessories - Output Cable (Ethernet male to HM, Female 5.5mm end to SSR, needs to be paired with another wire bought separately)
    HeaterMeter Accessories - Raspberry Pi (Model B)
    HeaterMeter Accessories - 8GB SD Card
    ***DO NOT INCLUDE, BUY EDIMAX FROM AMAZON - HeaterMeter Accessories - Wireless USB Adapter
    HeaterMeter Probes - K Type ThermoCouple w/Alligator Clip (TC-K6A)
            (bought 3 ET-733 maverick hybrid probes cheaper on amazon)
    Blower Option - None
    Blower Adapter Option - None
    Power Adapter Option - None
            Got scratch and dent case


(Wifi Adapter that is supported and cheaper.  Get this one!!!!)
Edimax EW-7811Un 150Mbps 11n Wi-Fi USB Adapter, Nano Size Lets You Plug it and Forget it, Ideal for Raspberry Pi / Pi2, Supports Windows, Mac OS, Linux (Black/Gold)
Sold by: Amazon
$8.99


(Pairs with HM Output cable!!!! - Pigtail wire for control signal to the SSR, needs to connect to another wire that comes out of the HeterMeter, so is a combo)
1pc 59" 5.5 mm x 2.5 mm Barrel DC Power Plug Connector CCTV Arduino 5.5x2.5 12V
US $4.99
Sold by: Ebay



(Metal Controller Project Box that has plenty of space, is solid, and comes with a ground screw plus hole setup)
 Hoffman ASG8X8X4NK Pull Box, Screw Cover, Galvanized, 8" x 8" x 4"
Sold by: Amazon.com LLC
$13.63


(Power Chord for controller project box) 
Coleman Cable 09716 14/3 SJTW Power Tool Replacement Cord, 6-Foot
Sold by: Amazon.com LLC
Add-on Item
$6.55


(On/Off Switch, I went above and beyond for a 100 amp switch because the cheap chinese 20Amp rocker switches were melting on me)
Blue Sea Systems 7250 C-Series Toggle Single Pole
Blue Sea Systems
Sold by: Amazon.com LLC
$36.84


(MUST HAVE, Insulation Shrink Wrap for putting over connectors and any electrical wiring spots, this is a set of various sizes which is much needed) 
SummitLink 415 Pcs Black Assorted Heat Shrink Tube 10 Sizes Tubing Wrap Sleeve Set Combo
Sold by: Amazon
$9.69


(Flat Crimp Tool and some connectors) 
DELUXE WIRING KIT / JT&T / 6992F (with flat crimp tool!!!)
Sold by: Fry's Electronics
Price:$16.29
product/5924324

(chord relief grommit) Teenitor 24 Pcs Plastic Waterproof Adjustable 3.5 - 13mm Cable Gland Joints, PG7, PG9, PG11, PG13.5, PG16, Pack of 24
Sold by: Amazon
$8.99


(wirenuts) Gardner Bender 10-003 WireGard Screw-On Wire Connector, 22-14 AWG, Orange
Sold by: Amazon.com LLC
Add-on Item
$5.74

(Maverick Probes)
Maverick Et732 Genuine Replacement 6 Foot Hybrid Probe - 2 pack
Sold by: Amazon
$29.99


Maverick ET733 Genuine Replacement 6 Foot Hybrid Probe Can Be Used As Food and Smoker Probe
Sold by: Amazon
$19.95

(Fuse Holder)
uxcell AC 125V/15A 250V/10A Screw Cap Panel Mounted 5 x 20mm Fuse Holder Black 5 Pcs
Sold by: Amazon
$6.19


(Fuses)
Bussmann GMA-15A 15 Amp Glass Fast Acting Cartridge Fuse, 125V UL Listed, 5-Pack
Sold by: Amazon
$5.98

(Female Spades for Fuse Holder and Outlet sizes which are odd sizes)
SOLOOP 280Pcs Assorted F/M Crimp Connectors Spade Terminal Insulated Electrical Wire Connector Kit Set
Sold by: Amazon
$12.99

(Panel Box Power Socket/Outlets)
10 Pcs US 3 Pins Power Socket Plug Black AC 125V 15A
Sold by: Amazon
$5.72


(12V 3amp Adapter plug - MUST HAVE 3amp plug!!!)
Eleidgs 12v 3a Plug Power Supply 5.5 x 2.5 / 2.1mm + 5.5 x 2.1mm DC 12V Female Power Plug Adapter Plug Cable Plug + 1 Meter DC Male to Female Power Cord
Sold by: Amazon
$8.99


(Extension chord that can support the amps needed to be pulled over the length of the chord, 25feet)
Bayco SL-752L 25' OSHA NRTL Compliant Extension Cord w/Single Lighted Outlet - 15amp
Sold by: Amazon.com LLC
$11.53


Extra 14 AWG Wiring, about 9-12 feet shoudl work.

Heatgun for shrinking insulation (I carefully used a Butane BBQ lighter hahaha)

Wire cutters, Needle Nose Pliers, Phillips Screw Driver, Dremel rotary tool with Metal Cutting Wheels, Universal Bit 1/4 to  1-3/8 inch, regular drill bits, zip ties, etc.)
[h2]7. Pics of My HeaterMeter Controller Mod :)[/h2]












DSC_0234[1].JPG



__ tallbm
__ Apr 26, 2017


















DSC_0251[1].JPG



__ tallbm
__ Apr 26, 2017


















DSC_0254[1].JPG



__ tallbm
__ Apr 26, 2017


















DSC_0233[1].JPG



__ tallbm
__ Apr 26, 2017


















DSC_0247[1].JPG



__ tallbm
__ Apr 26, 2017


















DSC_0241[1].JPG



__ tallbm
__ Apr 26, 2017


















DSC_0239[1].JPG



__ tallbm
__ Jun 19, 2017


















DSC_0242[1].JPG



__ tallbm
__ Jun 19, 2017






I need to seal up the extra space around the new switch that does not melt below.













DSC_0351[1].JPG



__ tallbm
__ Jun 19, 2017


















DSC_0352[1].JPG



__ tallbm
__ Jun 19, 2017


















ptunes.png



__ tallbm
__ Jun 12, 2017


















DSC_0344[1].JPG



__ tallbm
__ Jun 19, 2017


















DSC_0349[1].JPG



__ tallbm
__ Jun 19, 2017


----------



## tallbm

Hi everyone.  I plan to do a loooooooong and detailed post on this topic in the 1st post and will update it as I go.  I will post when I do updates but my intent is to have all of the content to be in the 1st post of the thread so please bare with it as I add the content.  

If any of the table of contents/outlined bullet points above seem out of order or lacking please feel free to comment. 

Thanks!


----------



## old sarge

Sounds like an interesting endeavor. I look forward to reading your progress.  Are you replacing any of the stock wiring/connectors that are prone to corrosion or burning out?


----------



## tallbm

old sarge said:


> Sounds like an interesting endeavor. I look forward to reading your progress.  Are you replacing any of the stock wiring/connectors that are prone to corrosion or burning out?


Oh I definitely did when I rewired the MES.

I replaced the Rollout Limit Switch connectors with hi temp stainless steel ones as well as the connectors to the heating element with hi temp stainless steel ones.

Also I replaced the stock Rollout Limit Switch with a manual resetable 350F Rollout LImit Switch so I could push the temp a little over 300F on chicken cooks to get edible chicken skin and to allow for some extra room while dialing in my PID tuning settings :)

I also used high temp connectors in my controller box to connect to the box's on/off switch since I melted two cheapo Chinese switches.  The other connectors in the box are regular ones and have never shown any heat issues.  The issue was simply cheap Chinese switches.  Might as well been made of playdough hahahaha.

I may not get to continue adding content to the initial post until maybe Monday but we'll see.  There is still quite a bit of content to go with pictures and everything but maybe 1 person in the world will find it helpful.  Plus I now have it all documented in one place for my own needs so it's kind of my own little knowledge base article for reference :)


----------



## tallbm

Ok everyone.

The main post is Loooooong and has a ton of info.  Let me know if any of it seems off, wrong, or just doesn't make any sense hahaha.

This is kind of a 1st draft and will get better as people comment :)

I hope people find this info helpful.  Enjoy!


----------



## johnnyb54

TallBM, I applaud the work and the dedication that you put into your mod. Like yourself I like to build things that most people will not attempt. I do have a question on your decision to build rather then buy. The Auber controller (WSD-1501GPH) I purchased cost me $231.49 with shipping. The difference between the Auber I purchased and your HeaterMeter is I have no WiFi connectivity and no fan. The list of materials and cost per unit of the HeaterMeter you posted is $481.34, unless I miss calculated. The delta between the Auber and the HeaterMeter is $249.85. Other then the benefit of building your own unit, Wifi connectivity and fan control why did you go that route instead of a prebuilt? Again I appalled your ingenuity.


----------



## tallbm

johnnyb54 said:


> TallBM, I applaud the work and the dedication that you put into your mod. Like yourself I like to build things that most people will not attempt. I do have a question on your decision to build rather then buy. The Auber controller (WSD-1501GPH) I purchased cost me $231.49 with shipping. The difference between the Auber I purchased and your HeaterMeter is I have no WiFi connectivity and no fan. The list of materials and cost per unit of the HeaterMeter you posted is $481.34, unless I miss calculated. The delta between the Auber and the HeaterMeter is $249.85. Other then the benefit of building your own unit, Wifi connectivity and fan control why did you go that route instead of a prebuilt? Again I appalled your ingenuity.


That's a good question johnnyb54.

I had already done a rewire with an Auber controller and gave that setup to my mother as a gift.  It worked well.

My main reasons for doing the HeaterMeter over using another Auber plug-n-play were

the wifi capability
the control capabilities from my computer
the control capabilities from my phone
4 total probes (I like 2 smoker, 2 meat probes... I'll take as many as I can get before being tangled up in a mess lol)
Dasbhoard monitoring and cook stat keeping (I can see graphically what has happened from beginning to end of my cook with temps, stalls, etc. and see any data at any point along the graph)
The fun project aspect of it all, I like an interesting project
It was just so damn interesting!!!! I couldn't resist knowing if it was legit or not and I like a little challenge :)
In short, it gave me all kinds of capabilities I liked the idea of having and scratched my curiosity itch.  So that's basically it :)

So other than the wifi capability when compared to the Auber electric unit I basically have more probes and better monitoring.  I also like the idea of being able to go out to the pool and have the PitDroid phone app notify me when my temps are hit.  So drinking beer and playing guitar at the pool while the smoke/cook is going unattended was very desirable as well


----------



## johnnyb54

TallBM said:


> That's a good question johnnyb54.
> 
> I had already done a rewire with an Auber controller and gave that setup to my mother as a gift.  It worked well.
> 
> My main reasons for doing the HeaterMeter over using another Auber plug-n-play were
> 
> the wifi capability
> the control capabilities from my computer
> the control capabilities from my phone
> 4 total probes (I like 2 smoker, 2 meat probes... I'll take as many as I can get before being tangled up in a mess lol)
> Dasbhoard monitoring and cook stat keeping (I can see graphically what has happened from beginning to end of my cook with temps, stalls, etc. and see any data at any point along the graph)
> The fun project aspect of it all, I like an interesting project
> It was just so damn interesting!!!! I couldn't resist knowing if it was legit or not and I like a little challenge :)
> 
> 
> In short, it gave me all kinds of capabilities I liked the idea of having and scratched my curiosity itch.  So that's basically it :)
> 
> So other than the wifi capability when compared to the Auber electric unit I basically have more probes and better monitoring.  I also like the idea of being able to go out to the pool and have the PitDroid phone app notify me when my temps are hit.  So drinking beer and playing guitar at the pool while the smoke/cook is going unattended was very desirable as well :yahoo:



TallBM, I perfectly understand scratching that curiosity itch and applaud you for scratching it. Well done sir!


----------



## madtownmonkey

I just got my heatermeter up and running. I will probably use it in monitor mode for a bit. However I want to figure out how to control the MES through the existing SSR. There has to be one in the box somewhere. I can probably add a switch that will select the builtin controls v the heatermeter controls at the control voltage side of the relay.


----------



## madtownmonkey

I just saw a video showing replacement of the control panel. My guess is that on e could feed the heatermeter fan control into the relay control line right there, might have to adjust the voltage output of the heatermeter down from 12, but that remains to be seen. Add a single pole switch to switch between the control pane and heatermeter.


----------



## tallbm

madtownmonkey said:


> I just got my heatermeter up and running. I will probably use it in monitor mode for a bit. However I want to figure out how to control the MES through the existing SSR. There has to be one in the box somewhere. I can probably add a switch that will select the builtin controls v the heatermeter controls at the control voltage side of the relay.


Hi there and welcome!

The stock SSR for the MES controller is under the smoker and can be accessed if you drill the rivets out of the panel underneath the smoker.

My guess is that it is either the yellow box or the black box on the circuit board you can see in the pictures below.













DSC_0258[1].JPG



__ tallbm
__ May 4, 2017


















DSC_0302[1].JPG



__ tallbm
__ May 6, 2017






Can you re-leverage that SSR?  I'm sure you probably could but I don't know if it is worth the hassle to get in there, probably require removing the circuit board from the MES to get to the SSR, finding the correct connection points on the board to the SSR and then soldering to those points.  For less than $23 you can buy a 25A SSR (3-32V input signal) and heat sink and be ready to rock.  I don't know what the input signal requirements for the onboard SSR happen to be but the HeaterMeter control signal for the SSR maxes at 12V.

Be sure to test and confirm that the MES SSR also works within the same 12V signal voltage range so you know your HeaterMeter can controll it.













HE25Ea.jpg



__ tallbm
__ Jul 6, 2017






I guess you could potentially remove the existing SSR from the circuit board but you would need to make sure you don't damage anything on the SSR so you can re-solder to the connection points on the SSR.  

Worse case you ruin the existing MES' SSR and just have to buy one like the one above so no big deal.  Since you are rewiring the MES the existing circuitry and controller are basically of no use anyways so you can experiment all you like with little consequence

Feel free to let us know what route you go and what you find out! :)


----------



## tallbm

madtownmonkey said:


> I just saw a video showing replacement of the control panel. My guess is that on e could feed the heatermeter fan control into the relay control line right there, might have to adjust the voltage output of the heatermeter down from 12, but that remains to be seen. Add a single pole switch to switch between the control pane and heatermeter.


That is a possibility you will just need to know the voltage range the MES SSR works with for triggering/control.

The HeaterMeter will use anywhere from 0 - 12V for the signal and will manage that on it's own with no way for you to *really*  tell it to always use 100% outpout, even if you make the settings change to 100%min and max, it will still do percentages... very odd.


----------



## madtownmonkey

I think I have identified the ground and signal wire for the relay. It seems it's a 3.3V signal. I have ordered some parts from Amazon, which I hope will allow me to do a completely removable install (I will have to cut some holes in the plastic front plate. But that part can be purchased from Masterbuilt for less than $25 if I want to return the smoker to stock. I will post more when I get things together and do some testing.


----------



## tallbm

madtownmonkey said:


> I think I have identified the ground and signal wire for the relay. It seems it's a 3.3V signal. I have ordered some parts from Amazon, which I hope will allow me to do a completely removable install (I will have to cut some holes in the plastic front plate. But that part can be purchased from Masterbuilt for less than $25 if I want to return the smoker to stock. I will post more when I get things together and do some testing.


Very interesting.  Keep posting what you discover :)


----------



## tiros

I am working on a  PID for mine too!

It uses wifi, and a phone app to to control it. Its cheap too. I only have $25 in the whole project. (Not counting probes)

My board (blue) is shown hooked to the top of my grill in parallel with the MES control unit. In normal operation the MES controller is not used. My board replaces it completely. There is no rewiring, as I am using the original relay, driving it with a very slow PWM to not hammer its contacts. I get my power from the grill itself. I can put the old controller back at any time.













20170628_200909.jpg



__ tiros
__ Jul 14, 2017






A screenshot of my phone, while roasting 4 butts. I was testing the probe monitors. You can see when I opened the door to rotate position of meats. The oven is not being controlled in this pic, the original MES brain was still in charge of heating. Since then I have been working on tuning the PID section of my code. Trying to optimize my  PID values.  When that's done, I won't need the MES controller at all. I can hold temp much closer than the MES already but the project isn't quite "pork ready" .  The device can also text me if a probe is at set point ie: "Its Done!".













Screenshot_20170621-141734.png



__ tiros
__ Jul 14, 2017






By the way for Heatermeter, if you want use SSR, just pull the original controller, and connect the red and blue wires with a 1K ohm resistor. This will put the original relay hard on, then you can just use the SSR on the original plug. No need to rewire anything.


----------



## tallbm

Tiros said:


> I am working on a  PID for mine too!
> 
> It uses wifi, and a phone app to to control it. Its cheap too. I only have $25 in the whole project. (Not counting probes)
> 
> My board (blue) is shown hooked to the top of my grill in parallel with the MES control unit. In normal operation the MES controller is not used. My board replaces it completely. There is no rewiring, as I am using the original relay, driving it with a very slow PWM to not hammer its contacts. I get my power from the grill itself. I can put the old controller back at any time.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 20170628_200909.jpg
> 
> 
> 
> __ tiros
> __ Jul 14, 2017
> 
> 
> 
> 
> 
> 
> A screenshot of my phone, while roasting 4 butts. I was testing the probe monitors. You can see when I opened the door to rotate position of meats. The oven is not being controlled in this pic, the original MES brain was still in charge of heating. Since then I have been working on tuning the PID section of my code. Trying to optimize my  PID values.  When that's done, I won't need the MES controller at all. I can hold temp much closer than the MES already but the project isn't quite "pork ready" .  The device can also text me if a probe is at set point ie: "Its Done!".
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Screenshot_20170621-141734.png
> 
> 
> 
> __ tiros
> __ Jul 14, 2017
> 
> 
> 
> 
> 
> 
> By the way for Heatermeter, if you want use SSR, just pull the original controller, and connect the red and blue wires with a 1K ohm resistor. This will put the original relay hard on, then you can just use the SSR on the original plug. No need to rewire anything.


Hi there and welcome!

Wow that is a lot of cool info to absorb there.  

That is awesome that you've sorted out the wiring and such for the MES to leverage it with your own controller.  

I know different PIDs use different algorithms for control but please feel free to try my post HM PID settings and see if they are in the ball park for you.

When you say connecting the red and blue wires with the 1k ohm resistor will put the SSR to hard on, are you saying that the SSR will be switched to a fixed state of on thereby always allowing current to run through the SSR to the heating element?  

I'm a bit unclear about the statement because I figure the SSR would need to be in a state of off, not allowing current through to the heating element.  Then when the controller (HM in this case) sends the signal we would want SSR to switch to on thereby allowing current through to the heating element.

I could be misunderstanding so please let me know if that is the case.

Thanks for the input, and great contribution!


----------



## tiros

Hi Tall,

The MES doesn't use an SSR it uses a simple a relay. A PID controller ultimately controls the power applied to the heater. So once every period, the PID equation resolves to some kind of output, say 0-100%, based on the current temperature and the set point. The result is how much power is to be applied while waiting for the next update period/calc. So lets say the period is 60 secs. If the PID wants 50% power, it turns on the heater for 30 secs and then off for 30 secs than re-evaluates. 25% would be on 15 off for 45 etc...

OK so now we need cycle the element somehow. A relay can be used, since the period is so slow. One problem with relay is, say the output is 1%, that would mean the relay needs to be on for a mere 600 msec! It can't respond that fast. An SSR can. An SSR doesn't care about number of operations either. Using a short cycle time with a relay can make it fail faster. With careful coding though, and thanks to the oven being relatively slow to respond, this shortcoming can be reduced substantially.

From monitoring and timing the MES controller it seems they do not use PID. I think they want long on times to make sure the wood chips burn. I use an Amazen so I prefer temp accuracy. I was thinking of adding an MES mode to my code in case I want to use chips someday, The MES uses its own 10bit A/D to sample its crappy probe that falls out on the high end so my smoker can not reach 275. Heatermeter is deficient in this area as well https://electronics.stackexchange.com/questions/67171/input-impedance-of-arduino-uno-analog-pins. You really need to have a unity buffer amp to read a thermistor with a successive approximation a/d converter, as by definition the thermister will change impedance according to temperature!. The biggest noticable problem is channel to channel crosstalk, ie: the state or voltage of one channel will influence the reading of the adjacent channel. Also noticeable is multiple successive readings not being the same as the input capacitance stabilizes. Averaging these erroneous values will not yield the correct result.

For your application, you just need to put the MES relay on constantly. Its like a light switch, so once its on, you could then plug the box into some sort of 120v PID controller, and allow it to cycle power to the plug. Since the relay is hard on, its contacts see zero wear from the PID cycling the element. You wouldn't need any other electrical mods and all safety stuff is still intact. In the case of MES40 a 1k resistor jammed into the existing controller connector between RED and BLUE would do it.The existing controller removed,


----------



## tallbm

Tiros said:


> Hi Tall,
> 
> The MES doesn't use an SSR it uses a simple a relay. A PID controller ultimately controls the power applied to the heater. So once every period, the PID equation resolves to some kind of output, say 0-100%, based on the current temperature and the set point. The result is how much power is to be applied while waiting for the next update period/calc. So lets say the period is 60 secs. If the PID wants 50% power, it turns on the heater for 30 secs and then off for 30 secs than re-evaluates. 25% would be on 15 off for 45 etc...
> 
> OK so now we need cycle the element somehow. A relay can be used, since the period is so slow. One problem with relay is, say the output is 1%, that would mean the relay needs to be on for a mere 600 msec! It can't respond that fast. An SSR can. An SSR doesn't care about number of operations either. Using a short cycle time with a relay can make it fail faster. With careful coding though, and thanks to the oven being relatively slow to respond, this shortcoming can be reduced substantially.
> 
> From monitoring and timing the MES controller it seems they do not use PID. I think they want long on times to make sure the wood chips burn. I use an Amazen so I prefer temp accuracy. I was thinking of adding an MES mode to my code in case I want to use chips someday, The MES uses its own 10bit A/D to sample its crappy probe that falls out on the high end so my smoker can not reach 275. Heatermeter is deficient in this area as well https://electronics.stackexchange.com/questions/67171/input-impedance-of-arduino-uno-analog-pins. You really need to have a unity buffer amp to read a thermistor with a successive approximation a/d converter, as by definition the thermister will change impedance according to temperature!. The biggest noticable problem is channel to channel crosstalk, ie: the state or voltage of one channel will influence the reading of the adjacent channel. Also noticeable is multiple successive readings not being the same as the input capacitance stabilizes. Averaging these erroneous values will not yield the correct result.
> 
> For your application, you just need to put the MES relay on constantly. Its like a light switch, so once its on, you could then plug the box into some sort of 120v PID controller, and allow it to cycle power to the plug. Since the relay is hard on, its contacts see zero wear from the PID cycling the element. You wouldn't need any other electrical mods and all safety stuff is still intact. In the case of MES40 a 1k resistor jammed into the existing controller connector between RED and BLUE would do it.The existing controller removed,


Wow that's a lot of info, thanks for the input.

I now get what you mean about forcing the MES relay on.  If it is on and you use something like an Auber plug and play PID controller then the controller will feed power off and on to the MES plug and with the relay on it will always go to the heating element.  You have effectively "rewired" the MES with that one relay without actually rewiring the MES :)

Thanks for the explanation :)


----------



## madtownmonkey

My setup seems to work. It plugs between the on board control panel and the smoker inputs. I tested it this morning and I could control the temperature. I will put up photos and some links to the connectors and the other parts I used.

In all I think I spent around $20 on the connectors and the voltage divider to get the twelve bolt output down to 3.3 volts to control the onboard relay.


----------



## tallbm

Sounds cool, I can't wait to see the pics!


----------



## madtownmonkey

So I'll try toggle some information about how I added heater meter control to my MES 40.

I ordered some five pin connectors from amazon.


happily these turned out to exactly match the connectors used to connect the bluetooth controller to the MES.

I also ordered an adjustable voltage divider though you could easily use fixed resistors as well.


This allowed me to reduce the heater meter fan control line to 3.3 volts (which is what comes from the controller board.

I also ordered a weatherproof ethernet pass through.


to connect the heatermeter control line to the MES.

I also bought a single throw dual pole toggle switch at my local home depot.

There is a small amount of soldering involved in this project. I also used liberal amounts of heat shrink tubing.

I started by butchering an ethernet cable and using just the blue (ground) and blue white (fan control signal) I soldered thereto the ground and VCC pins of the voltage divider. I also soldered another blue wire to the ground pin (to carry through to the MES) and another blue white to the output of the potentiometer as shown below













IMG_0795.JPG



__ madtownmonkey
__ Jul 19, 2017






Now I started setting up the connectors. All the lines but the blue (signal) and white (signal ground) go through. The package comes with both male and female connectors so you can take one of each and solder together the black, greed and red wires. You can also solder together the white wires and solder in the blue wire from to potentiometer ground.













IMG_0796.JPG



__ madtownmonkey
__ Jul 19, 2017






That's really all the soldering. Now you can attach the blue wire from the controller side of your go between cable to one pole of the switch and the output side to the center connector. The blue white wire from the output of the potentiometer goes to the other pole as shown below. Now you can select between on-board control and heater meter control.













IMG_0798.JPG



__ madtownmonkey
__ Jul 19, 2017






Here' the final wired assembly, as you can see I put heat shrink everywhere.













IMG_0800.JPG



__ madtownmonkey
__ Jul 19, 2017


















IMG_0801.JPG



__ madtownmonkey
__ Jul 19, 2017






I used a stepped drill bit to drill holes in the plastic controller cover for both the switch and the ethernet pass through. Here's the pass through side (I put it on the left)













IMG_0803.JPG



__ madtownmonkey
__ Jul 19, 2017






Here's the switch side. There was plenty of room for the wiring.













IMG_0804.JPG



__ madtownmonkey
__ Jul 19, 2017






Here's the assembled panel on the MES. I think it looks pretty clean. Well the smoker is dirty but the install looks nice.













IMG_0806.JPG



__ madtownmonkey
__ Jul 19, 2017






I think theres room for something even nicer. You could take the 5 volt line from the heater meter controller and use that to automatically detect the heater meter connection and automatically switch to heater meter control.


----------



## tallbm

Hahahaha wow that is cool!

I can't wait to see it in action! :)

Oh by the way I blew one of my 15A quick bust glass fuses yesterday during a smoke.  I have a feeling it simply wore out or the controller box temp got too hot.  I replaced with another fuse, pulled the top off my controller box, and continued with no issue.  I also did about 8 pounds of smoked pork franks today for about a total of 6 hours of operation and no issue.

Just some info if you ever have an issue with a glass fuse busting :)


----------



## madtownmonkey

Cooked a couple of small briskets on Sunday. Ran the whole thing through heatermeter on my phone and ipad. They came out really well.


----------



## tallbm

madtownmonkey said:


> Cooked a couple of small briskets on Sunday. Ran the whole thing through heatermeter on my phone and ipad. They came out really well.


Congrats on the successful cook!

How cool is the HeterMeter controller?

Also did any of my info on settings help out at all?  I am hoping my PID settings really help people get dialed in or start them off closely.  Also that freaking "Lid Open" feature is a pain.  I hope that my notes on fixing that setting for the MES use were useful.

Let me know if any of my info helped or was the opposite of helpful haha :)


----------



## madtownmonkey

I definitely used your PID settings and they held the temp really well. The iphone interface is pretty nice the heatermeter controller is the bomb and  works really well. I had a probe in each of the briskets and everything just worked. Maybe next time I'll use a port forwarding service so I can monitor when I am away from my wifi. Here's what the interface looks lie in portrait mode, in landscape it gives you the graphs.













IMG_0808.PNG



__ madtownmonkey
__ Jul 25, 2017


----------



## tallbm

madtownmonkey said:


> I definitely used your PID settings and they held the temp really well. The iphone interface is pretty nice the heatermeter controller is the bomb and  works really well. I had a probe in each of the briskets and everything just worked. Maybe next time I'll use a port forwarding service so I can monitor when I am away from my wifi. Here's what the interface looks lie in portrait mode, in landscape it gives you the graphs.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> IMG_0808.PNG
> 
> 
> 
> __ madtownmonkey
> __ Jul 25, 2017


That's awesome and the app looks good. The PitDroid app I use on my Android phone is a bit less flashy but basically the same thing.

Also, did you use a 3Amp Power Plug from the start?  That was an initial headache I ran into and discovered after some initial research on the RaspberryPi3 behavior.  Once I upgraded to the 3Amp power plug the reboot and such went away.

As for the port forwarding, I'm really thinking about that as well but I'm leery or opening up my router/network in any fasion.  I DO have a DNS name I just paid for while doing some Amazon Web Service certification training.  The networking lab has you buy a cheap one if you want to participate in the lab so I got one for like $10 or $11 for a year so I could just use that DNS for it.   I'm still debating but as for now my TP20 reaches all the way out to the pool so I have the long range alert covered.  

I'm not really sure I need the full internet access.  I don't like the idea of leaving the house with the MES going.  If it starts to burn down I would like to be a 10 second sprint away rather than a drive away lol.

Here soon I'll do a post with my convection fan mod.  I just need to do another test chicken smoke with the stock MES pan installed to see if it blocks the chicken from dripping on the heating element and then I think I am will have 100% of my kinks worked out.  Right now chicken juices are dripping directly onto my flipped heating element thereby preventing the smoker from getting to 325F quickly hahaha.  If I have that solved by simply adding the stock water pan back (empty of course) then I don't believe I'll be making anymore mods :D


----------



## lovethemeats

Now that is cool. Seen a mod done to a Bradley. This is way more cooler. I'm glad nothing happened to this thread during the move to the new platform. Love the prices that you call out. Kinda gives a heads up for saving. How is your unit since then? I must say. Very cool.


----------



## tallbm

lovethemeats said:


> Now that is cool. Seen a mod done to a Bradley. This is way more cooler. I'm glad nothing happened to this thread during the move to the new platform. Love the prices that you call out. Kinda gives a heads up for saving. How is your unit since then? I must say. Very cool.



Thanks I'm glad you like it and I agree it is pretty cool lol.

The HeaterMeter has been working with no issues.  Now I just had an issue Thu night where my safety rollout limit switch was failing... while I had a brisket cooking!  I had to remove the brisket cool everything off and make the repair.  I got it all repaired in like 15 minutes and was back up and running.  Thank goodness I had extra rollout limit switches and I made a panel to access it so I wouldn't need to pull the back off my MES to access it lol. :D


----------



## Telemachus

madtownmonkey said:


> So I'll try toggle some information about how I added heater meter control to my MES 40.



Hey Monkey, and OP.  Thanks for this info.

I just got my MES 30 at Walmart for $55 yesterday, and I see a heater meter in my future.

I completely agree that using the existing wiring and relay is the way to go, why reinvent the wheel? I would assume in the future when this relay dies, I can replace it with SSR.

All raspberry pi boards have several GPIO pins that output 3.3V.  I would imagine they could be used to control the relay on the MES with very little change to the code.

Monkey, were you able to determine what the other pinouts on the 5 pin jst connector for the MES are for? What voltage does the standard controller run off of?

I'll be ordering my heater meter in the next few days most likely.


----------



## tallbm

Telemachus said:


> Hey Monkey, and OP.  Thanks for this info.
> 
> I just got my MES 30 at Walmart for $55 yesterday, and I see a heater meter in my future.
> 
> I completely agree that using the existing wiring and relay is the way to go, why reinvent the wheel? I would assume in the future when this relay dies, I can replace it with SSR.
> 
> All raspberry pi boards have several GPIO pins that output 3.3V.  I would imagine they could be used to control the relay on the MES with very little change to the code.
> 
> Monkey, were you able to determine what the other pinouts on the 5 pin jst connector for the MES are for? What voltage does the standard controller run off of?
> 
> I'll be ordering my heater meter in the next few days most likely.


Hi there and welcome!

Word to the wise get a 3 amp or better power plug/supply for the HeaterMeter.  If you go with the documented 1 amp it will crash and reboot a lot on you when using Wifi.  The Pi3 seems to get power hungry with some spikes and those spikes cause a reboot.  A 3 amp plug resolves this.  Best of luck :)


----------



## Mauritius

What an awesome project! Geekin out over here.


----------



## Telemachus

tallbm said:


> Hi there and welcome!
> 
> Word to the wise get a 3 amp or better power plug/supply for the HeaterMeter.  If you go with the documented 1 amp it will crash and reboot a lot on you when using Wifi.  The Pi3 seems to get power hungry with some spikes and those spikes cause a reboot.  A 3 amp plug resolves this.  Best of luck :)



I am going to probe some more into the wires that feed up into the stock controller.   It's possible there is already a 12V source (although what amperage?).  

Monkey already determined the wires that control the relay...  the others are likely a VCC of either 12V or 5V or both and another ground wire.

That also means there is a transformer and rectifier built in, that could likely be changed out if needed to give a steady 12v 3amp source for the heater meter.  

In my mind, running the whole thing off the main plug of the MES should be a primary goal.


----------



## tallbm

Telemachus said:


> I am going to probe some more into the wires that feed up into the stock controller.   It's possible there is already a 12V source (although what amperage?).
> 
> Monkey already determined the wires that control the relay...  the others are likely a VCC of either 12V or 5V or both and another ground wire.
> 
> That also means there is a transformer and rectifier built in, that could likely be changed out if needed to give a steady 12v 3amp source for the heater meter.
> 
> In my mind, running the whole thing off the main plug of the MES should be a primary goal.



Let us know what you find out.

Another less technical approach would be to just put a 12v 3amp plug down there in the chord or PCB compartment and wire a female end of a plug into the MES plug wiring and just plug the 12v plug into the wired in female plug. 
Then you just run the 12v plug wire through the MES like the existing wiring and you are all set in a nice neat, clean fashion.
Well not as nice and neat as your approach to wire into the MES power but the next best thing :)


----------



## Telemachus

Do any of you gentlemen know if there is an option to add a fourth probe to the heater meter if you don't get the thermocouple?  As my MES isn't going to see temps over 300'F, a thermocouple seems an overkill, but if its the only way to get 4 points of data, then so be it.

Also, looking at the schematic:  http://capnbry.net/linkmeter/pcb/hm-4.2/HeaterMeterPi.png

The standard Heater Meter PCB has a MCP1700-33 voltage regulator at IC4, so 3.3V is already on the board.  It should be pretty simple to add jumper to have the transistor that controls the blower fan trigger a 3.3V signal instead of 12V.  In that case, no external voltage divider or resistors will be needed to control the stock relay.

Or, alternatively, another 3.3v voltage regulator could be used at the connector side connected to 12V and ground, and using one of the unused holes on the cat-5 connector.  Then you would have both a switched 12V and 3.3V output.  The voltage regulator could be attached to the bottom of the board.


----------



## Telemachus

Looking at the power board on the bottom of my MES 30 sure enough there is a 12V AC transformer...  but only rated at 250 ma.  Not enough to power a heater meter when rectified.  It gets dropped down to 5V with a voltage regulator and that is what controls the stock controller.


----------



## tallbm

Telemachus said:


> Looking at the power board on the bottom of my MES 30 sure enough there is a 12V AC transformer...  but only rated at 250 ma.  Not enough to power a heater meter when rectified.  It gets dropped down to 5V with a voltage regulator and that is what controls the stock controller.



That sucks.  Thanks for doing the homework.  
There may be a more elegant solution but for now all I can see is taking the power from the MES cord and running through a 3 amp 12V adapter/plug and run the wiring through the MES body up to the heater meater.

Does this sound about right?


----------



## Telemachus

tallbm said:


> That sucks.  Thanks for doing the homework.
> There may be a more elegant solution but for now all I can see is taking the power from the MES cord and running through a 3 amp 12V adapter/plug and run the wiring through the MES body up to the heater meater.
> 
> Does this sound about right?


 
It sure does.  Still an elegant solution as there will be no external wires running and only 1 plug to the outlet.


----------



## tallbm

Telemachus said:


> It sure does.  Still an elegant solution as there will be no external wires running and only 1 plug to the outlet.


If I did my setup again I think I would go that route rather than creating my big controller box.

I have a convection fan installed into my MES and wired up to be fed through my controller box.  The variable controller doesn't give a fine grain enough control to really matter and I have learned that max speed on my fan is fine in every one of my applications so far so the variable speed idea is a moot point to begin with.

I would still wire in the convection fan BUT I wouldn't have built a big box with plugs and switches etc.  I think I would have come up with a way to have just put everything (ssr, heat sink, 12v plug for PID, etc.) down in the compartment where the MES pcb is at (in the bottom of the MES) and then ran wiring elegantly from there with a switch up top.  Switch would have been for off/fan only/HeaterMeter PID + heat + fan.  When I cold smoke I don't need the PID or the Heat going, just the fan.

I could then have had the HeaterMeter PID controller rest on top of the smoker just like the MES controller does today.
Oh well, hind sight and all :)


----------



## Telemachus

I don't understand the role of the SSR.  There is already a mechanical relay built in for the stock controller.

Does the heater meter cycle the heater element rapidly enough that you need to be worried about the built in relay blowing?


----------



## tallbm

Telemachus said:


> I don't understand the role of the SSR.  There is already a mechanical relay built in for the stock controller.
> 
> Does the heater meter cycle the heater element rapidly enough that you need to be worried about the built in relay blowing?



The HeaterMeter was built to control a blower fan blowing on charcoal.  It does so by supplying 0-12V to the fan based on the temp in the smoker vs the set temp.  Rigging it to work for an electric smoker means it would be cycling up and down through 0-12V as it deems fit so in theory it could hammer a relay.

Also I didn't have any info on the relay that was built into the MES so the SSR was the only way I knew to go.

With the SSR it will be swiched on with a signal between 3-32V.  The HeaterMeter will at times feed signal to the SSR below 3V even though that won't turn on the SSR but as the temp in the MES fails to move up the HeaterMeter will increase the signal to 3V or higher which then switches the SSR on which then allows power to feed to the heating element.

This is the "hack job" or work-around that allows the HeaterMeter to work with the MES even though it wasn't initially designed that way.  I could work on modifying the HeaterMeter project code to manage a Relay or an SSR but as horrible as it may sound I don't see the Return On Investment with using so much of my time to do something that only marginally improves my situation and/or meets such a small demand (that I am aware of).  :)


----------



## Telemachus

I understand completely.

 My heater meter got ordered yesterday so hopefully I will get to start tinkering by the end of the week. 

My plan is to use the signal that goes to the servo control but modify the code so that it is a constant on or off and not PWM.  Or I might use an unused pan on the AVR micro controller and add on another hook up for the MES leaving the other connections if I ever need them for a different smoker.

Looking at your setup on average do you have any idea how often the solid state relay is toggling  on and off during a given minute?  

If it is in a constant cycle of on off on off then yes and SSR makes a lot more sense.

If it is switching every 5 seconds or even less frequently than a mechanical relay should be able to hold up for quite some time.


----------



## tallbm

Telemachus said:


> I understand completely.
> 
> My heater meter got ordered yesterday so hopefully I will get to start tinkering by the end of the week.
> 
> My plan is to use the signal that goes to the servo control but modify the code so that it is a constant on or off and not PWM.  Or I might use an unused pan on the AVR micro controller and add on another hook up for the MES leaving the other connections if I ever need them for a different smoker.
> 
> Looking at your setup on average do you have any idea how often the solid state relay is toggling  on and off during a given minute?
> 
> If it is in a constant cycle of on off on off then yes and SSR makes a lot more sense.
> 
> If it is switching every 5 seconds or even less frequently than a mechanical relay should be able to hold up for quite some time.



In the image below you will see in light blue some peaks and valleys during the duration of the smoke.  That is the output/signal level of the "Fan" that you can measure against the Left vertical axis of the graph 0-100.  Anytime that valleys are below 25% (3V) then the SSR is in an Off state.  At 25%+ (3V+) then the SSR is in an On state.












ribsSmoke.png



__ tallbm
__ Sep 10, 2017






I can't easily tell from the image but there shows a possibility that the signal may hammer the Relay BUT there is also lots of evidence in the image that shows that the SSR is ON for much of the smoke.  I would really need to zoom in on the HeaterMeter graph and see what the signal data over time really is.

This isn't much definitive help but may give some educated guesses as to what you can expect with the signal during a smoke :)


----------



## Telemachus

Logic would have me believe the same, that 0% is 0v at 100% is 12V.

But Bryan Maryland over on ttwvb told me today that the output of the blower is actually a variable voltage output of 5V-12.1V.  It never goes below 5V.

I'm not sure how your SSR is ever turning off.

Other interesting info about the duty cycle too:

https://tvwbb.com/showthread.php?72953-Blower-Output-at-Constant-3-3V&p=801666#post801666


----------



## tallbm

Telemachus said:


> Logic would have me believe the same, that 0% is 0v at 100% is 12V.
> 
> But Bryan Maryland over on ttwvb told me today that the output of the blower is actually a variable voltage output of 5V-12.1V.  It never goes below 5V.
> 
> I'm not sure how your SSR is ever turning off.
> 
> Other interesting info about the duty cycle too:
> 
> https://tvwbb.com/showthread.php?72953-Blower-Output-at-Constant-3-3V&p=801666#post801666



I see you have been diving in full force :)
I'm looking over everything and it is starting to come back to me as to how it all works.

There are 2 different Fan Output settings:  Pulse and Voltage.

The default is Voltage and will give a constant voltage between 5-12.1V (according to documentation).
The Pulse setting will use a continuous series of pulses.  This would mean you get No/0V between pulses and 12V when the pulse is delivered.

For electric smokers (you have to dig up this info in the tvwbb forums not documentation) Bryan states that the Fan Output setting should be set to PULSE and that min, max, and startup max be set to 100%.
Interpreting the documentation (see link below) it appears that with the settings of 100%, when the PID output is 100% then the Pulse will fire at 100% Voltage output of 12V which should trigger the SSR to flip on and allow heat to move to the electric smoker heating element.

I was incorrect in thinking/stating that the PID output of 25% would give a voltage of 3V :oops: because the min/max/startup max are all at 100% and the documentation seems to state that when the PID Output is 100% then the min/max % will dictate the amount of voltage percent sent out which may be helpful for a fan but for an SSR  that is triggered between 3-32V, the settings are almost irrelevant.  100% should send a 12V pulse which is well within the 3-32V range to switch On the SSR.

NOW, the min/max % may be relevant for controlling the amount of voltage you would want to send to the MES relay since it works on lower voltage.  This may be a simple way to step down your Voltage and hold it at the right number :)
You would need to test this theory with with a multimeter to see what REAL percent works lol.

I'm not well versed in this area so bare with me.
As for hammering the relay, the frequency in the documentation is 490Hz or 490 pulses per second.  I THINK that if you mess with Servo Pulse Duration settings that could/would increase the Pulse Width so that the relay is ON longer and would get fewer switches on/off per second or per minute.  Again I'm not really sure here and what I am thinking may result in a constant ON state.
If I am thinking correctly then a duration of 10 seconds (10,000,000 micro seconds/us, the unit used in the setting) would give you 6 on's or so per minute so 12 switches on/off per minute (I think).

Do you know the number of switches the MES relay would likely be able to handle?

HeaterMeter Documentation for Fan Output: Pulse, Servo Pulse Duration, etc.:  https://github.com/CapnBry/HeaterMeter/wiki/Configuration-WebUI-Documentation


----------



## Telemachus

Servo control is a different beast altogether.  A servo is set up on a PWM, with 0.5-1.5 MS as the signal.  That is unrelated to the blower output that we are talking about using (but you knew that...)

Yes, the only way that your relay is working at all is if you are in the pulse mode of the blower.  You basically get full off (0V) or full on (12V) and your SSR input having such a wide range is taking it without a problem.

The blower cycle is set at 10 seconds in the code.  The amount of time it is on is calculated by taking the PID output divided by 10.  ie: 20% PID output, the relay is signaled on for 2 seconds and off for 8 seconds.

So maximum on/off over 1 minute would be 12 times.

Over 10 hours of smoking, that is 7200 toggles.

While its not as bad as the MP3 coordinated Christmas lights I once tried on a mechanical relay (it blew in a few minutes), its not ideal with a mechanical relay.

Still, it's there, and easy to access, so I'm going to use it until it blows.  Then I'll replace it with a SSR.


----------



## tallbm

Telemachus said:


> Servo control is a different beast altogether.  A servo is set up on a PWM, with 0.5-1.5 MS as the signal.  That is unrelated to the blower output that we are talking about using (but you knew that...)
> 
> Yes, the only way that your relay is working at all is if you are in the pulse mode of the blower.  You basically get full off (0V) or full on (12V) and your SSR input having such a wide range is taking it without a problem.
> 
> The blower cycle is set at 10 seconds in the code.  The amount of time it is on is calculated by taking the PID output divided by 10.  ie: 20% PID output, the relay is signaled on for 2 seconds and off for 8 seconds.
> 
> So maximum on/off over 1 minute would be 12 times.
> 
> Over 10 hours of smoking, that is 7200 toggles.
> 
> While its not as bad as the MP3 coordinated Christmas lights I once tried on a mechanical relay (it blew in a few minutes), its not ideal with a mechanical relay.
> 
> Still, it's there, and easy to access, so I'm going to use it until it blows.  Then I'll replace it with a SSR.



Thanks for the clarification!  There is so much information and so many technical concepts to wrap ones head around, it is easy to get lost or on the wrong track lol.

I'm all for you giving it a shot until it wears out.  It will be a good exercise.
For safety sake I hope that the stock safety Rollout Limit Switch cuts the power off should the relay die in the ON position.  I would suggest you also set alarms so that you are warned in situations where the relay may die in the ON position.  This way if you have a set temp of 225F and the smoker hits 300F you know something has gone wrong and that maybe your relay died in the ON position.  The opposite will hold true that once it hits 225F, you can set an alarm at like 170F so you know if the relay died in the off position :)

I'm eager to see how this all turns out! :)


----------



## Telemachus

I'm pretty sure Tiros is using the stock mechanical relay with his PID project.  He basically built a heat meter from scratch, but only using a 5V micro controller and a cheap wifi board.  

He's pretty tight lipped about his schematics and source code, however.  I guess that is his prerogative.


----------



## tallbm

Telemachus said:


> I'm pretty sure Tiros is using the stock mechanical relay with his PID project.  He basically built a heat meter from scratch, but only using a 5V micro controller and a cheap wifi board.
> 
> He's pretty tight lipped about his schematics and source code, however.  I guess that is his prerogative.



Once you get to writing the PID algorithm and controlling everything then the stock relay shouldn't be an issue.
I don't personally know enough about the electrical component side of things to enter into a project like that.  I'm 100% positive I could pick it all up but I am almost positive I wouldn't want to invest the time to do so lol.

Now if I wanted to get into creating IOT devices or moving into that realm of the industry then I could justify creating little projects like that and tying it to IOT and AI concepts.  If/When that day comes then the smoker will be a candidate for my own IOT PID controller type of device hahahaha :D


----------



## Telemachus

I soldered up my heater meter this weekend.   I added a 3.3V voltage regulator to the blower output and connected the Vout to pin 2 on the rj45 jack.  

That way if I want to use the blower in the future it remains untouched on its native pin.   The MES relay will be attached to ground and my pin 2.


----------



## tiros

Telemachus said:


> I'm pretty sure Tiros is using the stock mechanical relay with his PID project.  He basically built a heat meter from scratch, but only using a 5V micro controller and a cheap wifi board.
> He's pretty tight lipped about his schematics and source code, however.  I guess that is his prerogative.



Not really, its nothing proprietary.

Here's some details:
The Esp8266 I use is a micro controller with built in Wifi. It runs at 3.3 volts. The board has a linear regulator.
The Microchip part is the 12 bit spi A/D, it is not the controller. There also 2 quad op amps for buffering, along with some resistors and capacitors.

The Esp8266 is fully supported by the Arduino guys. You can even use the Arduino IDE. 
I am using the BLYNK platform for IOT. I use a local Raspberry Pi Blynk server for lowest latency, and unlimited app resources (free energy).

I see your post says the transformer is only 250ma. I'm not sure my Gen1 has. Esp uses more than that iirc but I think only in surges, maybe a big cap would help. Maybe I am under powered. I didn't see any power issue on my scope.

As for the relay:
Basically the PID interrupt occurs ever 200msec, and it evaluates every 60 seconds. At the eval point it decides the power level for the next 60 seconds. If its too small, it saves the small bit and adds it to next eval. This way the relay doesn't get pulsed on too short of a time, and still preserves the smaller results.
To Wit:
////RELAY OUTPUT CODE: We are here at pid timer rate
////This code executes at pid timer speed, NOT AT PID COMPUTE SPEED!
//turn the output pin on/off based on pid output
//Limit minimum on/off time, per PID cycle
void outputToRelay(double output, int bNewPidCalc)
{
  unsigned long RelayMillis;
  static int iMakeUpMillis=0, iOweMillis=0;

    if(output<0) output=0;
    if(output>PWM_STEPS) output=PWM_STEPS;

    RelayMillis=(unsigned long) (output+.5)*(PID_CYCLE_TIME/PWM_STEPS);
    //RelayMillis=1000;
    //RelayMillis=29000;
    //RelayMillis=4500;

    if(bNewPidCalc) {
      iMakeUpMillis=iOweMillis;
      //Serial.print("iOweMillis: ");Serial.print(iOweMillis);Serial.print(" iMakeUp: ");Serial.print(iMakeUpMillis);Serial.println();
    }

    RelayMillis+=iMakeUpMillis;

    //A short turn skips this cycle and adds to next cycle
    if(RelayMillis < RELAY_MIN_TIME && RelayMillis) {
      iOweMillis=RelayMillis;
      RelayMillis=0;                               
    }
    //A short turn off subtracts from next cycle
    else if(RelayMillis > PID_CYCLE_TIME-RELAY_MIN_TIME && RelayMillis < PID_CYCLE_TIME) {
      iOweMillis=RelayMillis-PID_CYCLE_TIME;
      RelayMillis=PID_CYCLE_TIME;
    }
    else {
      iOweMillis=0;   
    }

    unsigned long now = millis();
    if(now - windowStartTime>=WindowSize)  {    //time to shift the Relay Window
      windowStartTime += WindowSize;
    }
    if(RelayMillis >= now - windowStartTime) HeatControl(1);
    else HeatControl(0);
}

As for the sensor:
In my gen 1, the internal sensor is supplied with 5 volts from the MB regulator. With a suitable terminator, I can read that, but the output will be referenced to the 5 volt supply. Not the best situation for a ratio metric A/D. Better is to use an external probe. I use Thermoworks, it comes with a nice little grate clip too.

Mine is hand wired. If you want to make a board up, I can help you out.


----------



## tallbm

And there you go folks.
The code and logic for managing the relay for an MES in a practical manner :)


----------



## tallbm

Telemachus said:


> I soldered up my heater meter this weekend.   I added a 3.3V voltage regulator to the blower output and connected the Vout to pin 2 on the rj45 jack.
> 
> That way if I want to use the blower in the future it remains untouched on its native pin.   The MES relay will be attached to ground and my pin 2.



Sounds awesome!
I cheated and bought the whole HM intact from Auber :D


----------



## Telemachus

It seems to be working well, the output is 3.3V when trying to raise the pit temp, and 0V when it reaches the correct temperature.

I'll attach it to the smoker for final testing before I internalize the 12V transformer and 3D print a case.


----------



## tallbm

Telemachus said:


> It seems to be working well, the output is 3.3V when trying to raise the pit temp, and 0V when it reaches the correct temperature.
> 
> I'll attach it to the smoker for final testing before I internalize the 12V transformer and 3D print a case.



Looks awesome and exciting!  I can't wait to see it hooked up and then all put together :)

Also are you changing out the safety rollout limit switch for a higher threshold one?  Just curious :)


----------



## Telemachus

tallbm said:


> Looks awesome and exciting!  I can't wait to see it hooked up and then all put together :)
> 
> Also are you changing out the safety rollout limit switch for a higher threshold one?  Just curious :)



No I have no plans to touch the limit switch.  If it ain't broke...

As far as I can tell, most PID mods are bypassing the switch entirely.  By using the stock wiring and controlling the heating element in the same manner as the stock controller, the innate safety features should remain intact.

Also, it appears that almost all features on the heater meter function with 5v power to the pi...  with the exception of the piezo buzzer and the 12V blower output.  If I were to rewrite the code to use a digital output pin on the atmel microcontroller instead of the one controlling the blower, this whole thing could potentially run off of the built in 5v in the MES.

The pi zero W seems not as power hungry as it's elder brethren...


----------



## tallbm

Telemachus said:


> Also, it appears that almost all features on the heater meter function with 5v power to the pi...  with the exception of the piezo buzzer and the 12V blower output.  If I were to rewrite the code to use a digital output pin on the atmel microcontroller instead of the one controlling the blower, this whole thing could potentially run off of the built in 5v in the MES.
> 
> The pi zero W seems not as power hungry as it's elder brethren...



That's good to hear. 
The pi version in my setup was fine until I hooked up everything to it and then added wifi.  It would spike and stave and that would cause a reboot until I got a 3A power supply.

If you hook everything up and then run into the issue you know where to look for a fix :)


----------



## Telemachus

Pretty stoked right now!

HM is running entirely off of the 5V supplied by the MES.  I used your PID settings and set the temp to 230.  I got a little freaked out when it initially shot up to 275' and was ready to abort but then it brought itself back down and has been holding steady.

At least with a Pi Zero W, the built-in power supply seems sufficient.   I am powereing it through the 5V pin on RJ45 port.  Web server is running great.

In other words, HM can run without any additional power supplies or relays on stock MES!

I did do one more modification to the HM.  I ran a jumper wire from pin 5 of the atmel microcontroller to an output pin on the RJ45 jack (Red wire in pic).  That pin puts out 3.3V when blower is on, and 0V when off.  This interfaces directly with the relay built into the MES (red wire in my case).  The 3.3V voltage regulator I previously installed is not necessary (I will likely remove it before I install in the case).

The only functionality missing without a 12V power supply is lack of Piezo Buzzer...  but that drove my wife crazy anyways.  A text message is much more useful as an alarm.


----------



## tallbm

Telemachus said:


> Pretty stoked right now!
> 
> HM is running entirely off of the 5V supplied by the MES.  I used your PID settings and set the temp to 230.  I got a little freaked out when it initially shot up to 275' and was ready to abort but then it brought itself back down and has been holding steady.
> 
> At least with a Pi Zero W, the built-in power supply seems sufficient.   I am powereing it through the 5V pin on RJ45 port.  Web server is running great.
> 
> In other words, HM can run without any additional power supplies or relays on stock MES!
> 
> I did do one more modification to the HM.  I ran a jumper wire from pin 5 of the atmel microcontroller to an output pin on the RJ45 jack (Red wire in pic).  That pin puts out 3.3V when blower is on, and 0V when off.  This interfaces directly with the relay built into the MES (red wire in my case).  The 3.3V voltage regulator I previously installed is not necessary (I will likely remove it before I install in the case).
> 
> The only functionality missing without a 12V power supply is lack of Piezo Buzzer...  but that drove my wife crazy anyways.  A text message is much more useful as an alarm.



Man that is exciting and awesome as hell!
I bet that when you have some load in the smoker you don't spike so high.

I don't know how the responsiveness of your unit would much different from my unit but no two things are the same :)
After a little testing you may want to try and tweak the PID values to avoid such a large overshoot if it still persists.  Just know that it took me quite a bit of tinkering to find the PID numbers I posted so don't get discouraged if you don't get it right the 1st time (or the 2nd - 50th time lol).  I think with some load it won't overshoot as much.

As for the buzzer it is damn near useless in my opinion.  The PitDroid phone app and alarm do well for me so I don't have to be within earshot of the smoker when the alarms go off :)

Just be sure the Lid Open Detection settings are set (0% and 30 seconds) to effectively disable that "feature".  Lid Open Detection will drive you nuts and surely extend your smoking time if it goes off :)

Keep the posts coming, I can't wait to see more... Maybe even a Stock MES HM setup guide some day :D


----------



## Telemachus

Yeah, I realize now that there are several parts of the HM board that you don't even need to populate for an MES, but who knows when it will be used for another type of smoker that will require them.

After about an hour I increased the temp up to 240.  Overshot again but not as much.  I agree with some meat in there it might not be such a big deal.

I don't think I could even come close to your masterful OP...  I'll just tag on here if you don't mind.


----------



## tallbm

Telemachus said:


> Yeah, I realize now that there are several parts of the HM board that you don't even need to populate for an MES, but who knows when it will be used for another type of smoker that will require them.
> 
> After about an hour I increased the temp up to 240.  Overshot again but not as much.  I agree with some meat in there it might not be such a big deal.
> 
> I don't think I could even come close to your masterful OP...  I'll just tag on here if you don't mind.



Good to see the overshoot is not going wild after a new set temp.

I have no problem with you adding all that info here it at all :)


----------



## tallbm

@*Telemachus*

Do you have plans to wire in an On/Off switch or do you plan to just plugin/unplug for the on/off functionality?

I was just curious because I can visualize some approaches but making them LOOK elegant may be a bit more involved an is a bit of a sticking point in my head at the moment :)


----------



## Telemachus

I am designing a new case that will fit atop the MES and mount on just like the stock one.  It is going to cover up both the power port and the rj45 port on the left hand side and the cable will exit the bottom.  The right side ports will be open for the probes.

In theory it would be pretty simple to wire an on/off switch into the new case...  it would just interrupt the 5V power supply.

That having been said, when the smoker is not in use it gets unplugged and covered up...  so not much use to me really.

If i do leave it plugged in, I already have 3 Raspis running 24/7...  one for the doorbell, one for the 3d printer, one for my son's jukebox...  one more wouldn't hurt much.  Solar power is plenty cheap!


----------



## tallbm

Telemachus said:


> I am designing a new case that will fit atop the MES and mount on just like the stock one.  It is going to cover up both the power port and the rj45 port on the left hand side and the cable will exit the bottom.  The right side ports will be open for the probes.
> 
> In theory it would be pretty simple to wire an on/off switch into the new case...  it would just interrupt the 5V power supply.
> 
> That having been said, when the smoker is not in use it gets unplugged and covered up...  so not much use to me really.
> 
> If i do leave it plugged in, I already have 3 Raspis running 24/7...  one for the doorbell, one for the 3d printer, one for my son's jukebox...  one more wouldn't hurt much.  Solar power is plenty cheap!



Makes sense.  
If I had it to do all over again I wouldn't have added my so-called variable speed controller for the convection fan I installed into my MES.  That would have greatly reduced the needs on the size of the box.
I also would have tried reuse as much space as I could with the built in MES compartments and so.  I would have drastically cut down the need for my controller box which is basically a hunk of metal hahaha.

It works very well as it is so I'm not gonna mess with it unless something really craps out.  Oh how hind sight is 20-20 :D


----------



## Telemachus

Naw... your box rox!  Own it, and love it!

I would imagine you could use the blower control on the HM to control your variable speed convection fan.  It would be pretty simply to use another pin to control your relay, and would only take a few changes in the source code...


----------



## tallbm

Telemachus said:


> Naw... your box rox!  Own it, and love it!
> 
> I would imagine you could use the blower control on the HM to control your variable speed convection fan.  It would be pretty simply to use another pin to control your relay, and would only take a few changes in the source code...


Maybe when something breaks down.  As of now I'm gonna rock it until it fails :D


----------



## Telemachus

Could you share some details with me about how you went about tuning your PID?  My overshoots are crazy high!

(BUT doesn't that chicken look great?)


----------



## tallbm

Telemachus said:


> Could you share some details with me about how you went about tuning your PID?  My overshoots are crazy high!
> 
> (BUT doesn't that chicken look great?)



Warning:  Long post of with lots of boring info lol :D

Well I started from scratch knowing nothing about PID tunning.

I tried to use the types of tunings I could find when it came to the HM and the blower fan BUT it was not apples to apples since the blower fan stokes a heat source and the electric smoker heats up an element.  The response time is drastically different.

Then I tried to incorporate some info I found from PID tuning with HVAC systems and again not apples to apples.

The next iteration was to try and and go with really high numbers (in regards to PID) to try and get things in tune since I figured the numbers would course correct more quickly but things were too erratic at various set points, so another approach was needed.

I then tried to use the tunings from the Auber PID from the first MES rewire job that I gave to my mother as a gift.  I gleaned more info but again not apples to apples because the algorithms were not the same between the Auber and the HM, so back to the drawing board.

At this point I just went and read up on a bunch of PID tuning in general rather than specific systems (blower + charcoal, hvac, SV, etc.).  Armed with my trial and error knowledge, I came to realize that I would have to just start with plain jane PID tuning tactics and start at a base low numbers for tuning and work up to find the right combo.
I started with a base low number for P and then gathered my info on it's behavior.
Then on to tuning I and gathering the behavior info.
Finally moving to tuning D and gathering the behavior info.

I went through a number of iterations of this to see what was working along the way an the result of a set of values for the entire PID tuning.

After doing it enough times and gathering the info I found the magic set of values that worked for the HM and it's PID algorithm.

In the end I found that the documentation for the standard HM PID tuning was of no real use because it was all centered around a blower fan and the responsiveness being way faster than an electrical element based system.

I found that it was educational but not very helpful to try and utilize tuning info and values from other systems like HVAC, SV, or the Auber units because their systems had way different performance response times AND each one likely had a different PID algorithm.  This meant I was never apples to apples and was always apples to elephants :)

I found that the only thing that worked for me was to do basic principles of PID tuning practice in conjunction with the knowledge I gained from the HM documentation on how the HM PID control behaved in general and the fact that I had a slow responding system compared to most systems out there that are documented or have tuning info available.

With all of that info I was able to try and try again with the most generic of PID tuning practices while understanding my system more with each attempt until I dialed it in :)


*Steps that Should Lead to Better Performance*

I THINK you have mentioned that you have a different algorithm for your HM so my tuning values may not be spot on.

Try to reduce the P value to 3 and see how things respond.  Remember that all of the I and D behaviors are going to be calculated off of the P value so only change it and see how things behave.  Reducing P in general should reduce overshoot but you also don't want it to fail to hit the set temp.

[EDIT: Removed erroneous portion of the statement.]
From there I would leave the "I" tuning alone.
I would bump D up to like 120 - 140 to see if it can get a minor decrease in overshoot.  The idea would be that it would maybe slow the initial ramp up to set temp a little so that it can't overshoot so badly.

Again start with only P and see how things respond.
After a number of P reduction trials, go with the best performing P and then increase D and perform trials there to see if you can help the overshoot.

I think you will get there it just takes some effort.  Let me know if any of this info makes sense/helps and ask away if you have any questions.  Best of luck! :)

OH, and the chicken does look amazing!  Chicken was my go-to with all of this trial and error dialing because it is the cheapest.  Man did I get a ton of chicken smoking in and a great appreciation for smoked chicken hahaha! You are on your way to consistently amazing smoked food my friend :D


----------



## Telemachus

Yeah I need to work it out.  My temp shot over 300' last night.  I'm not sure when the therm protection switch is supposed to kick in but I just opened the door first.

I was thinking of following Bryans method here:

https://tvwbb.com/showthread.php?69444-Quick-PID-Tuning-Example&highlight=Tuning

Why do you say I can't go below 1?


----------



## tallbm

Telemachus said:


> Yeah I need to work it out.  My temp shot over 300' last night.  I'm not sure when the therm protection switch is supposed to kick in but I just opened the door first.
> 
> I was thinking of following Bryans method here:
> 
> https://tvwbb.com/showthread.php?69444-Quick-PID-Tuning-Example&highlight=Tuning
> 
> Why do you say I can't go below 1?



Well I guess you can lol.

Maybe I was confusing it with the Auber value range.  I believe the Auber cannot do fractional numbers, only whole Integers.  My bad :)


----------



## muddydogs

Would numbers off my Auber help you any? I've got a couple sets of numbers from Auto tuning it at different temp settings. I'm trying to figure this PID deal out so I figure if I auto tune at different temp setting and different ambient temps maybe I will get an idea of what does what.


----------



## Telemachus

I guess they can't hurt... the heater meter is made to turn a variable speed fan up and down, so it really is different than many other PID.

Tall, what does the output on your HM look like when you are smoking?  I thought the percentage output would just go back and forth between 0 and 100, but it moves all over the place.


----------



## tallbm

Telemachus said:


> Tall, what does the output on your HM look like when you are smoking?  I thought the percentage output would just go back and forth between 0 and 100, but it moves all over the place.



I think I have the answer for you.

My output is up and down between 0 and 100% but usually doesn't hit 100% unless I am ramping up to the set point from 0F or after a door open, see some of my recorded smokes here:












ribsSmoke.png



__ tallbm
__ Sep 10, 2017


















brisket3Cook.png



__ tallbm
__ Aug 25, 2017


















chuckieSmoke.png



__ tallbm
__ Jun 24, 2017


















ptunes.png



__ tallbm
__ Jun 12, 2017


















ploaves.png



__ tallbm
__ Jun 7, 2017


















HmTuning.png



__ tallbm
__ May 15, 2017






According to documentation and what is seen in the behavior/graphs above.  I believe the setting "on above" is the answer to your mystery.  According to the HM documentation:

*on above* - Do not run the blower at or below this PID output. The blower output is linearly increased from this value to 100%, where the blower output will be MAX. Setting to 50% means that the fan won't turn on until the PID output is above 50%. To replicate the old "only on at MAX" setting, set "on above" to 99%. (LinkMeter v13)
For our electric smoker setup the "on above" setting should be 0.
So if I am reading everything properly, when the PID output is above 0% then the Pulse ON signal is sent.  Also having the Min and Max set to 100% makes it so you get 100% signal output, so only 12V sent rather than a lower voltage.

This all means that if you have a PID output of > 0 then you should be getting a 12V (3V in your case) control signal sent out to the switch (SSR/relay) so it will cut ON the power to the heating element.
Hence the output in the HM graphs never really hitting 100% output to come on.
I do think that the graph fails to display the 0% output well but I'm sure it is there and I would just need to zoom in.  

When watching in real time I see the graphed output go to 0 in the output valleys but it doesn't stay there very long because the system loses heat so quickly that the heat has to be switched back on quickly and then it takes a bit of time to build the heat back up.
I'm sure the combo of quick heat loss and slow heat build up over hours of smoking makes the 0% output valleys invisible unless you zoom in.

How does this all sound? :)


----------



## Telemachus

I certainly see 0 in the P tuning phase.  But when I add in I and D it never seems to quite get there.  Could it be that anything less than 50% turns on the fan at 100% and anything over 50 turns it off?

Using Zeigler-Nichols method tonight I have gotten to where I am happy enough with my results.  I never shoot much over 5 degrees now and the oscillation is pretty minimal.


----------



## tallbm

Telemachus said:


> I certainly see 0 in the P tuning phase.  But when I add in I and D it never seems to quite get there.  Could it be that anything less than 50% turns on the fan at 100% and anything over 50 turns it off?
> 
> Using Zeigler-Nichols method tonight I have gotten to where I am happy enough with my results.  I never shoot much over 5 degrees now and the oscillation is pretty minimal.



Wow sounds like you got dialed in!

Anything is possible, so your less than and greater than 50% notion might be happening but I'm not completely sure it is.  I say this because you can see in detail the overall PID output go from 0-100% and you can enable the PID display to show each value's percentage in real time.  I've seen plenty of times where these values and the overall output is 0% or the values having a negative total % value.  I'm thinking that the graph is just not displaying the 0% well all the time... I could be wrong here as well :)

In addition to seeing the output % in the bar just under the flames, you can hit the "P" key and it will display the individual PID % values in real time as they are calculating.  See the PID detailed display in the upper left hand corner of the following image.  The values all add up to be greater than 100% so output is 100%












ribsSmoke.png



__ tallbm
__ Sep 10, 2017





With that little display open you can see detailed behavior of your individual PID output %.

In the following image you can see that the P and the D values add up to like -93% which is way below 0 total so the PID output is 0%.












ploaves.png



__ tallbm
__ Jun 7, 2017






In short, I see the PID output both as a total and as individual values go to 0% (or a negative total with the detailed PID values shown).  At the same time of 0 output I see the temp slow down or drop.
Seeing all of this leads me to believe that there is a graphing issue rather than a functional issue when it comes to 0%.

Again I could be wrong.  Feel free to turn on the detailed PID display and watch it at 0% and see what your temperature does, then note if for some reason the 0% output valleys fail to show up or even dissapear on the graph (I believe I've even seen the 0 output graph valleys disappear). 

Let me know your thoughts and any observations you make with the PID detailed display on :)


----------



## jr_ece

tiros said:


> Not really, its nothing proprietary.
> 
> Here's some details:
> The Esp8266 I use is a micro controller with built in Wifi. It runs at 3.3 volts. The board has a linear regulator.
> The Microchip part is the 12 bit spi A/D, it is not the controller. There also 2 quad op amps for buffering, along with some resistors and capacitors.
> 
> The Esp8266 is fully supported by the Arduino guys. You can even use the Arduino IDE.
> I am using the BLYNK platform for IOT. I use a local Raspberry Pi Blynk server for lowest latency, and unlimited app resources (free energy).
> 
> I see your post says the transformer is only 250ma. I'm not sure my Gen1 has. Esp uses more than that iirc but I think only in surges, maybe a big cap would help. Maybe I am under powered. I didn't see any power issue on my scope.
> 
> As for the relay:
> Basically the PID interrupt occurs ever 200msec, and it evaluates every 60 seconds. At the eval point it decides the power level for the next 60 seconds. If its too small, it saves the small bit and adds it to next eval. This way the relay doesn't get pulsed on too short of a time, and still preserves the smaller results.
> To Wit:
> ////RELAY OUTPUT CODE: We are here at pid timer rate
> ////This code executes at pid timer speed, NOT AT PID COMPUTE SPEED!
> //turn the output pin on/off based on pid output
> //Limit minimum on/off time, per PID cycle
> void outputToRelay(double output, int bNewPidCalc)
> {
> unsigned long RelayMillis;
> static int iMakeUpMillis=0, iOweMillis=0;
> 
> if(output<0) output=0;
> if(output>PWM_STEPS) output=PWM_STEPS;
> 
> RelayMillis=(unsigned long) (output+.5)*(PID_CYCLE_TIME/PWM_STEPS);
> //RelayMillis=1000;
> //RelayMillis=29000;
> //RelayMillis=4500;
> 
> if(bNewPidCalc) {
> iMakeUpMillis=iOweMillis;
> //Serial.print("iOweMillis: ");Serial.print(iOweMillis);Serial.print(" iMakeUp: ");Serial.print(iMakeUpMillis);Serial.println();
> }
> 
> RelayMillis+=iMakeUpMillis;
> 
> //A short turn skips this cycle and adds to next cycle
> if(RelayMillis < RELAY_MIN_TIME && RelayMillis) {
> iOweMillis=RelayMillis;
> RelayMillis=0;
> }
> //A short turn off subtracts from next cycle
> else if(RelayMillis > PID_CYCLE_TIME-RELAY_MIN_TIME && RelayMillis < PID_CYCLE_TIME) {
> iOweMillis=RelayMillis-PID_CYCLE_TIME;
> RelayMillis=PID_CYCLE_TIME;
> }
> else {
> iOweMillis=0;
> }
> 
> unsigned long now = millis();
> if(now - windowStartTime>=WindowSize)  {    //time to shift the Relay Window
> windowStartTime += WindowSize;
> }
> if(RelayMillis >= now - windowStartTime) HeatControl(1);
> else HeatControl(0);
> }
> 
> As for the sensor:
> In my gen 1, the internal sensor is supplied with 5 volts from the MB regulator. With a suitable terminator, I can read that, but the output will be referenced to the 5 volt supply. Not the best situation for a ratio metric A/D. Better is to use an external probe. I use Thermoworks, it comes with a nice little grate clip too.
> 
> Mine is hand wired. If you want to make a board up, I can help you out.



So just the Esp8266 as the brains? I'm just reading up on Arduino controllers. Sounds like one (Uno?) might be necessary to program the Esp8266, but from your post and pic the Esp8266 is all you need with some logic, power, and protection around it.


----------

