Products for USB Sensing and Control
Products for USB Sensing and Control

#### sales inquiries

##### quotes, distributor information, purchase orders
sales@phidgets.com

#### technical inquiries

##### support, advice, warranty, returns, misshipment
support@phidgets.com

#### website inquiries

web@phidgets.com

##### Unit 1 - 6115 4 St SE Calgary AB  T2H 2H9 Canada
Projects Dealers Terms and Conditions Discontinued Products Phidget21 Documentation

# Phidget Smoker Project #1: Control a Bradley Digital Smoker using Phidgets

## Introduction

This project demonstrates the use of the Phidget JavaScript libraries for node.js to control a Bradley digital smoker. The smoker was modified with an external thermocouple attached to a Phidget 1051_2, and the power to the heating element was interrupted with a Phidget 1014_2 relay. A Linux PC running the Phidget network server and node.js was connected to the 1014 and 1051, and a custom node.js program controlled the smokers temperature.

The smoker was controlled with a web page served from a node.js server implemented with Koa, connect to a Phidget Temperature Sensor channel and a Phidget DigitalOutput channel (the relay). A simple graph was created using vis.js to show changes in the internal temperature of the smoker.


class Smoke {
constructor {
this.conn = new Conn('phid://localhost:5661', 'smoke');
this.conn.connect();
this.sensor1 = this.conn.TemperatureSensor();
this.sensor1.setChannel(0);
this.sensor1.onTemperatureChange = function (t) {
this.newTemp(t);
}.bind(this);
this.sensor1.open();
this.relay = this.conn.DigitalOutput();
this.relay.setDeviceSerialNumber(382656);
this.relay.open();
}
}



## Hardware

The smoker was monitored with a thermocouple installed near the middle of the cooking area and attached to a Phidget 1051_2 single channel Temperature sensor. The power cord to the heating element was cut and a Phidget 1014_2 relay was inserted to control the actual power to the element.

## Software

A simple web server was implemented with Koa and Node.js that connected to the Phidget Network server using the Phidget22 Node.js JavaScript library. A Phidget Temperature Sensor channel was created to monitor the temperatures from the 1051_2, and a DigitalOutput channel was created to control 1014_2, and by extension the heating element in the smoker.

Initially we intended to implement a PID loop to accurately manage the temperature inside of the smoker, but quickly realized that the Bradley smoker is barely able to maintain temperatures above 200°F, and over 240°F is almost impossible; instead, we simply turn on the element when below the temperature, and turn it off when above. In practice, the element was almost always on.


newTemp(t) {
var state = this.relay.getState();
if (t < target && !state)
this.relay.setState(1);
if (t >= target && state)
this.relay.setState(0);
}



## Conclusion

The Bradley smoker is a fairly economical and easy to use smoker for the general public, but is somewhat limited with the stock components. First, the heating element is barely adequate and second the temperature control and measurement is border line terrible. That being said, the limited power of the heating element is most likely due to safety concerns, and the temperature (within reason) is simply not that important when smoking most meats; as a result, the Bradley is fine for all but the most pedantic.

Now, since we are pedantic (and want to cook multiple trays of meat at the same time), an additional burner can be added to the smoker. By getting the supply power from the Bradley; setting the temperature on the Bradley as high as it will go, and controling when that power actually goes to the heating element with the Phidget 1014_2 we gain fine control of temperature. For safety, the Bradley will cut the power if things get too hot, which could happen if the case of a software or hardware failure, but will otherwise not be part of controlling the real smoker temperature.