Soldering station - PWM Noise

I am trying to build a soldering station and I have a problem. I cannot read the temperature because the PWM output (or someting along this line) induces noise, about 30mV. How can I get rid of it? A capacitor? How big and where?

What kind of temperature sensor are you using? How are things wired?

The temperature sensor is the one inside the thermocouple. It outputs about 10mV, but I have a noise of -30mV and I cannot read the temperature. When I turn off or disconnect the PWM which drives the soldering iron, it works fine.

(deleted)

OK - turn PWM off, take a reading, turn it on.

:art:

If I turn the analogWrite off and on I don't think it will be ON for enough time to heat up the iron and the PID that I'm using won't be efficient.

You turn PWM on/off for only microseconds or milliseconds.

I just tried something like :

  analogWrite(11, 0);
  Input = analogRead(0);
  Input = map(Input, 0, 450, 25, 350);
  analogWrite(11, Output);

And it doesn't work. If I do turn it off completly it does work.

Interesting. If I just set analogWrite(11, 0) I still get that error.

(deleted)

The values for the Input (after the map function) are oscillating between real value (let's say 200, because I have previosly heated the iron with another soldering station then plug it in my circuit) and 25, which is reading 0 on the analong input. It goes something like this :

200
25
25
25
190
25
25
25
185
25
25

(The values decrease because the iron cools down.

(deleted)

spycatcher2k: OK - ignore values if they are == 25, if you have a oscilloscope, probe around and see if you can find similar interference else where, It has to be coming from somewhere.

Just having a wild guess here. I know that when you connect let's say motors or relays, you use a diode anti parallel with them, because of the inductive current. Could this be the case, as the heating element could be acting as an inductance?

The noise is definitly coming from the soldering iron. If I remove it, the temperature reads just fine.

Or you can just take 50 measurements, throughout values outside the expected range, then average them.

Qdeathstar: Or you can just take 50 measurements, throughout values outside the expected range, then average them.

But what about when the soldering station starts and the temperature really is 25? And how can I be sure that those temperatures outside of 25 are correct? Many others have implements some sort of circuit like this and haven t seen them encountering this problem.

(deleted)

That is the problem. Nothing. I just made a PCB. Here is my schematic (ignore the Red over the capacitor). : http://i.stack.imgur.com/zuWZd.jpg Here is a similar one : http://4.bp.blogspot.com/_TmkhRGDDp84/TIVjR5M5_uI/AAAAAAAAAMM/lx4bbLeApT8/s1600/palanka.jpg

Is your iron earthed to utility mains ?

Boardburner2: Is your iron earthed to utility mains ?

Yes

try disconnecting it and see if it makes a difference.

Boardburner2: try disconnecting it and see if it makes a difference.

This is what I thought was the problem at first, I did and unfortunately it did not make any difference.