PID Temperature Control - PROPORTIONAL

Hi all,

Sorry if it seems like this is a topic that has been ‘done-to-death’ but I am struggling to find an equivalent project to take guidance from…

Essentially most (if not all) of the thermocouple temperature control projects I can see are using the PID to provide on/off control of a relay or SSR that switched a heating element. What I need is to output a proportional PWM to one of the output pins that changes its value according to the power output requirement as a %

Can anyone kindly provide advice how to achieve this in the first incidence? Ideally with an example that uses MAX 6675 (I have access to a 31855 also but aim to upgrade to this if neccersary at a later point and modify the code)

The aim is to use a filter on the output pin to give me a 0-5v analog out signal - I then intend to either modify the timers to get 12 or 16 bit output or if it will be easier / better use a DAC chip to provide the output signal. Any advice you might be able to give here would also be much appreciated (8 bit output should work for testing in principal but will not be enough long term)

Thank you kindly in advance :slight_smile:


I suggest using Brett Beauregard's PID library: It provides the output as an analog value that ranges between two limits that you can configure; for example, between 0.0 and 100.0 for a percentage, or 0 through 255 for outputting directly to an analog pin.

To convert the PWM output to an analog value, it is as simple as adding an RC circuit, and perhaps an op-amp buffer.

Install the PID library ( and start with File->Examples->PID_v1->Examples->PID_Basic

Change the analogRead() to code that reads the current temperature.

If you use an external D/A in place of the analogWrite() you should use SetOutputLimits() to set the Output range to match the range of your D/A. For example if you have a 10-bit D/A use SetOutputLimits(0.0, 1023.0)

Thanks for the guidance guys - :)

Sorry for slow reply also - been hectic at home so not had much project time!