Gboard and DS18B20 Temperature Sensors

Hi

I am relatively new to Arduino and am wondering if someone can assist…
I am trying to send a temperature to a online data base.
I have managed to get this working on my Arduino Uno and an ethernet shield.
I now need to get this working via gsm.

I am using an Arduino Gboard (http://imall.iteadstudio.com/im120411004.html).
I have connected the digital output of the sensor (DS18D20) to pin A4 of the board.
I am powering the sensor with my Uno as i am not sure where to get the correct power from the Gboard from.

The Code I am using is the following;

#include <call.h>
#include <gps.h>
#include <GSM.h>
#include <HWSerial.h>
#include <inetGSM.h>
#include <LOG.h>
#include <SIM900.h>
#include <sms.h>
#include <Streaming.h>
#include <WideTextFinder.h>
#include <SoftwareSerial.h>
#include <SPI.h>
#include <OneWire.h>
#include <DallasTemperature.h>

//this is for the sensors
#define ONE_WIRE_BUS 4
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress sensor1 = { 0x28, 0xBD, 0xDC, 0x98, 0x05, 0x00, 0x00, 0xE4 }; // This is Sensor 1

int looped = 1;
boolean started = false;

void setup()
{
  Serial.begin( 9600 );
  
  Serial.println("GSM Shield testing. ");
  
  pinMode(GSM_ON, OUTPUT); // pin 6-Gboard
  //pinMode(6, OUTPUT); 
  pinMode(GSM_RESET, OUTPUT); //pin7-Gboard
  
  if(gsm.begin(9600))
 {
      Serial.println("\nstatus=READY");
        started=true;
        Serial.println(started); 
 }
  else Serial.println("\nstatus=IDLE"); 
  
  
  //starting up the sensors
   sensors.begin();
   sensors.setResolution(sensor1, 10);

float getTemp(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempC(deviceAddress);
  if (tempC == -127.00) {
    Serial.print("Error getting temperature");
  } else {
    return tempC;
    
  }

}

void loop()
{
  
   delay (1000);
    sensors.requestTemperatures();
    float temp1 = getTemp(sensor1);
    Serial.print("Temp1 C: ");
    Serial.println(temp1);
}

The result I get is;

GSM Shield testing.

status=READY
1
Temp1 C: 0.00
Temp1 C: 0.00
Temp1 C: 0.00
Temp1 C: 0.00

ect…

Any help would be appreciated as finding information on this Gboard and its workings has proved to be challenging.

Thanx

Can you read the sensor with the examples of the Dallas Temperature Control library?

What does the compiler states, is there enough memory left?

Note that interrupts can corrupt the data transfer between sensor and chip,

Last but not least, a temperature of 0.00 often points to failing connection, so check the wires /pins used. mind you you use in code pin 4 and you state you connected it to A4 => analog4 is not pin 4 !!

Thanx for the reply.

Can you read the sensor with the examples of the Dallas Temperature Control library?

No I have not been able to read with this board but have been able to read with my uno.

What does the compiler states, is there enough memory left?

It says It is using 16kb of 30kb

code pin 4 and you state you connected it to A4 => analog4 is not pin 4 !!

I am not really sure how to address the sensor via what pin.
I have been looking at this diagram : ftp://imall.iteadstudio.com/IM120411004_GBoard/Documents/SCH_IM120411004_GBoard.pdf
which makes it look like A4 is on pin 27, but replacing the 4 with 27 dosen’t help.

I have also come across this fourm post “http://forum.arduino.cc/index.php/topic,127209.0.html
Which states that “To use the Analog inputs as digital ports you address them as d14-d19”.
As these are digital sensors I believe this is what I am trying to do. However if I replace the 4 with d17 for eg the code will not compile.

Any help would really be appreciated.

I know it has been some time since you posted this topic, but I ran across it trying to solve the same problem. In your code where you identify the pin number the DSB1820 signal line is attached to:

define ONE_WIRE_BUS 4

Since you are attached to the Electronic Bricks Interface of the Itead Studios GBoard A4, the digital pins start with 14. So A0 is 14, A1 is 15, A2 is 16, A3 is 17, A4 is 18 and so on. This line of code should read:

define ONE_WIRE_BUS 18

Make this simple change and it should work.