Pages: [1]   Go Down
Author Topic: Thermistor shield from arduino-direct  (Read 1510 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I'm a software developer, but I'm also a total newbie in electronic. I've bought the thermistor shield from arduino-direct. When I try to read the value, I always get 142 ±1. Nothing happens even when I try to heat the thermistor with my fingers.

Is there any tutorial using this shield?

Thank you
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 642
Posts: 50365
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Having posted several times now, you should be aware of the drill. Where is the link to the shield/device/whatever that is causing the problem? Where is the code that is not performing as intended?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wasn't aware there was a way to post questions.

Where : http://arduino-direct.com/sunshop/index.php?l=product_detail&p=39
What : Thermistor 103 with a LM358 chip and some resistors.

Code :
Code:
int thermPin = A0;
float thermValue = 0;

void setup ()
{
  Serial.begin (9600);
}

void loop ()
{
  thermValue = analogRead (thermPin);
  Serial.println (thermValue);
  delay (1000);
}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've found the code from a Chinese web site, but it still gives only 9 as a value.

http://translate.google.ca/translate?js=n&prev=_t&hl=fr&ie=UTF-8&layout=2&eotf=1&sl=auto&tl=en&u=http%3A%2F%2Fitem.taobao.com%2Fitem.htm%3Fid%3D6208909767&act=url


Code:
#include <math.h>

double Thermister (int RawADC) {
 double Temp;
 Temp = log (((10240000/RawADC) - 10000));
 Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
 Temp = Temp - 273.15; // Convert Kelvin to Celcius
 Temp = (Temp * 9.0) / 5.0 + 32.0; // Convert Celcius to Fahrenheit
 return Temp;
}

void setup () {
 Serial.begin (115200);
}

void loop () {
 Serial.println (int (Thermister (analogRead (A0)))); // display Fahrenheit
 delay (100);
}

Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 642
Posts: 50365
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Rather than all that complicated code, see if you are reading anything from the analog pin.

Code:
int thermPin = 0; // NOT A0 (A0 is a digital pin)

void setup()
{
   Serial.begin(9600);
}

void loop()
{
   Serial.print("Analog pin reading: ");
   Serial.println(analogRead(thermPin));
   delay(100);
}

If you don't get different readings as the temperature changes, the problem is with the hardware. If you do get different readings, the problem is with the software.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know it's been a while, but I didn't touch my arduino for a while.

I figured out that arduino-direct don't always follow wire color standards. After checking the PCB, I noticed that they flipped their cables color. The black wire is for signal and the white as the ground...

Now it works, I only need to converted the value to human readable.

Thanks
Logged

Belgium
Offline Offline
Sr. Member
****
Karma: 1
Posts: 283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a bunch of bricks from arduino-direct, they are made by Flamingo EDA. Look on the underside of the printboard. Mine all have - + and S markings, so no problem to connect them...
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmmm... I have check all my bricks from them and I don't see the + - s markings. They might have add them lately.
Logged

Pages: [1]   Go Up
Jump to: