Dallas temperature float value

Hello, Im finally find some time and turn on my seeduino which i have almost one year in cabinet and start to learn some Arduino Basic. Im creating simple reef controller, just to learn and help monitoring my glass baby :slight_smile:

First I create testing menu and connect two DALLAS temperature sensors. After loosing half of my hairs I finally get it work. I use oneWire for connecting two sensors and use one digital pin. But, I can`t figure how I can see float values from sensors. I mean now my temperature jumps after 0.5 Celsius. I study a lot of almost same setups but people has say 25.12 C . What Im missing? DALLAS is digital signal it is for that? I read something about digital to analog converter but it seems that complicate things. Or may I use two analog TMP36GT9Z which takes me 2 analog pins, but its ok. There is for sure float values. There is my code, sorry for form but Im really happy that it works somehow :slight_smile: Thanks a lot guys.

/*
 
 The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
   * ends to +5V and ground
   * wiper to LCD VO pin (pin 3) */

//SET TEMPERATURE
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 10 //Define temp pin
OneWire oneWire(ONE_WIRE_BUS); //Other sensors One Wire
DallasTemperature sensors(&oneWire);


DeviceAddress aqua = { 0x28, 0x42, 0x7B, 0xB4, 0x01, 0x00, 0x00, 0x2C };
DeviceAddress air = { 0x28, 0xCB, 0x62, 0xB4, 0x01, 0x00, 0x00, 0xDF };
                        
//SET LCD
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

//SET VARIABLE
int mainMenu = 500;
int changeMenu = 3500;
int lcdLight = 13;

void setup() {
  // Start DALLAS library
  sensors.begin();
  sensors.setResolution(aqua, 5);
  sensors.setResolution(air, 5);

  // set up the LCD's number of colu mns and rows: 
  pinMode(lcdLight, OUTPUT);
  lcd.begin(20, 4);
  lcd.noDisplay();
  delay(3000);
  lcd.display();
  digitalWrite(lcdLight, HIGH); //Turn on display
  delay(1000);
  //Main Page
  lcd.setCursor(2,0);
  lcd.print("AQUA CONTROLLER");
  delay(mainMenu);
  lcd.setCursor(8,1);
  lcd.print("by");
  delay(mainMenu);
  lcd.setCursor(3,2);
  lcd.print("DEATH FISH Co.");
  delay(mainMenu);
  lcd.setCursor(3,3);
  lcd.print("version 1.0.1");
  delay(changeMenu);
  
  lcd.clear();
}


void loop() {
  sensors.requestTemperatures(); // Send the command to get temperatures
  float aquaTemp = sensors.getTempC(aqua);
  float airTemp = sensors.getTempC(air);
  //LCD MENU
  lcd.setCursor(0,0);
  lcd.print("Temp Aqua");
  lcd.setCursor(2,1);
  lcd.print(aquaTemp);
  lcd.setCursor(12,0);
  lcd.print("Temp OUT");
  lcd.setCursor(14,1);
  lcd.print(airTemp);
  lcd.setCursor(2,2);
  lcd.print("NO SENSORS FOUND");
  delay(500);
  lcd.setCursor(2,2);
  lcd.print("****************");
  delay(500);
  
  lcd.setCursor(0,3);
  lcd.print("Ph:");
  lcd.setCursor(12,3);
  lcd.print("ORP:");
  
  delay(1000);
 
}

I'm not sure I understand what your problem is. The DallasTemperature::getTemperature() returns a float.

If your values are not increasing in less than 0.5 degree C increments, it is not a library problem. Either your sensor is not accurate to less than 1/2 a degree, or the way you display it on the LCD has a problem. Try printing the value to the serial port.

Thanks a lot for fast repply. There is serial port, its same as on display :~ I have this temprature sensor:

http://www.gme.cz/teplotni-cidla-s-cislicovym-vystupem/ds18b20-p530-067/

blackchicken:
I mean now my temperature jumps after 0.5 Celsius. I study a lot of almost same setups but people has say 25.12 C . What Im missing?

  sensors.setResolution(aqua, 5);

sensors.setResolution(air, 5);

You could try setting the sensors to a higher resolution? The valid range was 9 - 12 bits. Although the value you're specifying is invalid, the Dallas implementation constrains it to be in the range 9 - 12 so in effect you are selecting 9 bits currently. If you want better resolution I suggest you try changing the resolution to 12 bits.

It works IT WORKS!!!!!!! :wink: :astonished: 8) :slight_smile: ]:smiley: :smiley: :grin: XD Im idiot I have 9 but for testing purposes i left 5 but dont try 12. Thanks a lot guys.