PID control of Ceramic heater element

I'm looking for some comments suggestions for a newbie who is just starting with Arduinos. Much to learn but looking for nudge in the right direction.

I am trying to create an Arduino controlled ceramic heater element. I have a Hakko soldering iron heater element and basically I am trying to make the arduino control the heater temperature to a set point and to use the built in K-type thermocouple as the feedback for the PID loop.

The heater will be powered by a separate 12V power supply using a logic level N channel MOSFET trigered by the arduino. The K type thermo couple is read by the arduino via a MAX 6675 chip.

I'm really at the beginnings of the arduino software side but through my reading I have found a library (MAX6675)that reads the K type and converts to a digital input through the SPI.

My question are these:

  • Can I use the standard PID libraries for this? They all seem to only reference an analog input? How hard would it be to use the digital signal that is read by the MAX6675?
    -I guess I'm really looking for a good example to look at that is similar to this, I seem to be a bit overwhelmed with the number of PID examples and how complicated some of them get.

Thanks

Yes you can use the PID library - it needs a numeric input from the sensor- doesn't matter how you get it, so you can just use the temperature value the library gives you. I was inclined to say that since you have digital output though, there's not much point using the PID. However, then I looked at this example:
Arduino Playground - PIDLibraryRelayOutputExample which proves me wrong :wink:

Thanks Bill -
So then I suppose since I'm using a MOSFET not a relay then I could make the int WindowSize = 5000;
really short period of time if need be.

And then when I get my temperature from the MAX6675 routine from here:

// Read the temp from the MAX6675
	temperature = temp.read_temp();

Then use that in the input value of the PID routine here:

Input = analogRead(0);

So it would something like:

Input = temperature;

Is that it?

Thanks