Welcome! Log In Create A New Profile

Advanced

Thermistor outputting 0 ...

Posted by buZztiaan 
Thermistor outputting 0 ...
February 21, 2012 08:42AM
Hiya, just built my first printer (weeeeeee)

BUT

The thermistor keeps outputting 0 through Sprinter or Marlin

My setup is ; arduino mega 1280, RAMPS v1.3, arcol hotend v4

The main weird thing is that when i write a small arduino sketch doing analogRead(13) (the pin for T0) and just write it over serial, i DO get valid values from the thermistor. But when i let Sprinter or Marlin do the same, I just get 1023. (and thus 0 degrees)

I've tried measuring the thermistor, it outputs around 95kOhm when idle. So it seems proper. There is also no short to the hotend and no short to the power resistor.

I'm going to try replacing the thermistor with just some known value resistor to see it that helps a bit ..
But maybe someone here has an idea what the problem could be??

*Fingers crossed*
Re: Thermistor outputting 0 ...
February 21, 2012 09:08AM
Congratulations, and welcome! smiling smiley

Here's a few pointers:
Can you move the motors, so you are sure you have a working connection to the printer?
You have updated your thermistor table, and not set the firmware to use a thermocouple by accident?
Try attaching the thermistor to the bed pins, and see if you get temperature there.


--
-Nudel
Blog with RepRap Comic
Re: Thermistor outputting 0 ...
February 21, 2012 09:10AM
Nudel Wrote:
-------------------------------------------------------
> Congratulations, and welcome! smiling smiley

Tnx and hi smiling smiley

> Here's a few pointers:
> Can you move the motors, so you are sure you have a working connection to the printer?

Yeah all 4 the axis are moving back & forth (X Y Z and E)

> You have updated your thermistor table, and not set the firmware to use a thermocouple by accident?

Yeah, I asked arcol which thermistor i should pick, and it was listed in the firmware, so i selected it.

> Try attaching the thermistor to the bed pins, and see if you get temperature there.

Cool, good tip, will try this in an hour when i'm at my workshop again smiling smiley
Re: Thermistor outputting 0 ...
February 21, 2012 10:01AM
Zero temp measurement use to mean a thermistor is not well connected (or connected to the wrong input).


Are you sure MOTHERBOARD is configured to 33 (RAMPS) on your firmware configure.h?
Re: Thermistor outputting 0 ...
February 21, 2012 11:13AM
Well, I just replaced the thermistor with a known value resistor (55KOhm)

In my test firmware i get '950' from the analogRead(13)
But in Sprinter it still says '0'

I'll post my code here for reference :

int val = 0;

void setup() {
 pinMode(10, OUTPUT);
 Serial.begin(115200);
}

void loop() {
 val = analogRead(13);
 Serial.println(val);

 // I used this part to 'bake' my fire cement , the 44444 was something like 188 then
 if (val > 44444) { 
  digitalWrite(10,HIGH);
  delay(2000);
 } else {
  digitalWrite(10,LOW);
  delay(2000);
 }

}
Re: Thermistor outputting 0 ...
February 21, 2012 11:15AM
misan Wrote:
-------------------------------------------------------
> Zero temp measurement use to mean a thermistor is
> not well connected (or connected to the wrong
> input).

Well, my test firmware (above) is working ... when i heat it up it starts to drop ..

> Are you sure MOTHERBOARD is configured to 33
> (RAMPS) on your firmware configure.h?

Yes, 100% sure
I also changed analogRead(TEMP_0_PIN) to analogRead(13) in manage_heater() .. to no avail sad smiley
Re: Thermistor outputting 0 ...
February 21, 2012 11:27AM
Well, if your code works and Sprinter does not it seems it's a firmware problem.

Could you download a fresh copy of Sprinter and just change MOTHERBOARD to 33 to see if it works?
Re: Thermistor outputting 0 ...
February 21, 2012 11:39AM
I was using RAMPS with Sprinter with RepSnapper and wasn't getting any temperature either. I never changed any settings and went to pronterface instead of RepSnapper and it works fine. I don't know why it would make a difference but it did. I could move all the axis with no problem but could never get a temp reading.
Re: Thermistor outputting 0 ...
February 21, 2012 11:44AM
Ok, then it was working ok.

You know, the temperature message reporting changed a while ago (to include hotend and hotbed temps) and I guess RepSnapper is not able to understand the new syntax. You can see the temperature likely within RepSnapper if you go the communication log window, that shows you the messages exchange between your computer and Arduino board in realtime.
Re: Thermistor outputting 0 ...
February 21, 2012 11:45AM
Just grabbed fresh git of Sprinter, changed MOTHERBOARD to 33 and THERMISTORHEATER to 5

But still the same T:0 B:0 reply sad smiley
Re: Thermistor outputting 0 ...
February 21, 2012 11:47AM
and if you leave THERMISTORHEATER to its default value of 1?
Re: Thermistor outputting 0 ...
February 21, 2012 11:52AM
Exactly the same result with THERMISTORHEATER set to 1
Re: Thermistor outputting 0 ...
February 21, 2012 11:54AM
You should go to IRC and ask Kliment: [webchat.freenode.net]

He is often there.

For some reason I do not know my last message it is not being accepted by the anti-spam bot....
Re: Thermistor outputting 0 ...
February 21, 2012 12:01PM
I just tried putting a jumper on T0 , and that worked! T:357 is reported by pronterface now ..

I wonder why this works, and a 55KOhm doesnt ..
Re: Thermistor outputting 0 ...
February 21, 2012 12:31PM
What voltage does 55K give at the pin? If you convert that to an ADC value and look for the nearest in the thermistor table do it seem like a reasonable temperature? Perhaps the wrong pull up resistor is fitted or the wrong table is being used.


[www.hydraraptor.blogspot.com]
Re: Thermistor outputting 0 ...
February 21, 2012 12:33PM
Also 55K is not a preferred value. Is that a measured value?


[www.hydraraptor.blogspot.com]
Re: Thermistor outputting 0 ...
February 21, 2012 12:36PM
If we can trust his ADC measurement, he should have around 4.6 volts. But I have no clue what 55Kohm means for THERMISTOR 1 :-)
Re: Thermistor outputting 0 ...
February 21, 2012 01:41PM
Well, on recommendation of Kliment, I just added 5V to the PCB from an external power source.
But still T:0 >_<
Re: Thermistor outputting 0 ...
February 21, 2012 01:57PM
By looking at thermistor table for THERMISTORHEATER 1 the output for a count of 950 on the ADC value should give you a temperature around 38C. Whether 55K gives you 950 or not I do not know, but I get aprox 4.6 V with 55K and 4.7K resistors divisor when powered at 5Volts, so this seems consistent with that resistor.

The fact that shorting the resistor you do have a change suggests that you have the wiring right and that the firmware is reading from the proper pin.

Why you get T:0 I do not know.
Re: Thermistor outputting 0 ...
February 21, 2012 02:08PM
Same here...

I'm considering rebuilding the circuit around analog pin 13 on a breadboard with the same two softwares, checking to see if there is a difference.
Wondering if i have the parts smiling smiley
Re: Thermistor outputting 0 ...
February 21, 2012 03:13PM
With 55k the ADC reading should be 1023 * 55 / (55 + 4.7) = 942 so the firmware should display a temperature more than 38C.

The voltage on the pin should be VCC * 55 (55 + 4.7). If it isn't the circuit is wrong. If your test program read 950 that seems pretty close, so it seems the firmware is wrong.


[www.hydraraptor.blogspot.com]
Re: Thermistor outputting 0 ...
February 21, 2012 03:14PM
You just need a 4K7 resistor (a capacitor may help smoothing out measurements but is not really needed).
Re: Thermistor outputting 0 ...
February 22, 2012 11:29AM
Well, i've rebuild the circuit
Just like this :

+5V -> 4.7K Ohm -> [analog pin 13] -> Thermistor -> GND

And _STILL_ Sprinter is giving me T:0 ...
Re: Thermistor outputting 0 ...
February 22, 2012 11:54AM
What software are you running? RepSnapper? Reprap Host?
Re: Thermistor outputting 0 ...
February 22, 2012 12:05PM
buZztiaan:

0) Make sure your Arduino IDE is configured to the right type of board (Mega1280, right?)
1) what is the voltage measured from GND to analog pin 13
2) what is the voltage measured from +5 to GND
3) what is the value your software is giving for analogRead(13) in your minimal arduino program
4) what is the output to the M105 command issued from Arduino terminal when Sprinter is uploaded to your Mega (remember to set the right baudrate for the terminal window)

It all suggest a firmware problem from all the above signs. You may want to post your firmware somewhere and put a link here so it can be reviewed . It could also be something wrong with your Arduino IDE that somehow causes the problem.
Re: Thermistor outputting 0 ...
February 22, 2012 03:02PM
Did you solder the RAMPS board yourself? You may want to inspect and refloat anything that does not look perfect.
Re: Thermistor outputting 0 ...
February 22, 2012 03:19PM
misan Wrote:
-------------------------------------------------------
> buZztiaan:
>
> 0) Make sure your Arduino IDE is configured to the
> right type of board (Mega1280, right?)

yeah 1280

> 1) what is the voltage measured from GND to analog
> pin 13

4.55

> 2) what is the voltage measured from +5 to GND

4.73

> 3) what is the value your software is giving for
> analogRead(13) in your minimal arduino program

988 for enviroment temperatures with the Thermistor
957 with 55KOhm resistor

> 4) what is the output to the M105 command issued
> from Arduino terminal when Sprinter is uploaded to
> your Mega (remember to set the right baudrate for
> the terminal window)

The reply to the M105 command is :

ok T:0 B:0

> It all suggest a firmware problem from all the
> above signs. You may want to post your firmware
> somewhere and put a link here so it can be
> reviewed . It could also be something wrong with
> your Arduino IDE that somehow causes the problem.
Re: Thermistor outputting 0 ...
February 22, 2012 04:24PM
None of those number make sense.

If you have a 4.73V supply to a potential divider with 55K and 4.7K you will get 4.73 * 55 / (55 + 4.7) = 4.36V. You get 4.55V. Since I am a firm believer in Ohm's law your resistors must not have the stated value or your meter is inaccurate.

I am not familiar with the firmware but it should be using the supply voltage as the ADC reference. If it uses an internal reference you will have big problems with the supply being so low compared to 5V.

The ADC should read 1023 * 4.55 / 4.73 = 984. It actually reads 957 so that means 957 * 4.73 / 1023 = 4.42V, closer to the predicted voltage from Ohms law, so looks like your meter is faulty.

What value does the table give for 957?

Is it possible your test program uses AVCC for the reference but Sprinter uses an internal reference?

Edited 2 time(s). Last edit at 02/22/2012 04:27PM by nophead.


[www.hydraraptor.blogspot.com]
Re: Thermistor outputting 0 ...
February 23, 2012 02:48AM
Your 5v source is kind of low, but I do not think this is the cause of the problem. The first three answers to my questions are ok ( I understand 4.55v in 1 corresponds to an ADC count of 988, which is fine for a 4.7V supply). Of course still getting T:0 is not.

If you post your firmware source code we can upload to our board and see if the problem holds with known-to-be-working systems or not. If you have a dropbox account is as simple as zipping the firmware fiolder and copying the zip file to the public folder and posting the public link.
Re: Thermistor outputting 0 ...
February 23, 2012 05:37AM
Yes 988 is about right for 4.55V, but 4.55V is not right for 100K.

With 4.7V and a 4K7 pull up, the voltage across the thermistor would be 4.7V * R / (R + 4.7K). That makes R = 4.55 * 4700 / (4.7 - 4.55) = 143K. That would probably be a temperature below 0.


Is the 4K7 pull up the right value? Seems like it might be too low.


[www.hydraraptor.blogspot.com]
Sorry, only registered users may post in this forum.

Click here to login