Controlling Fan in CPU WIth PID use Sensor Temperature DS18B20

Guys,,, i'm Murinto from Indonesia I need your help to know all about sensor DS18B20. :sweat_smile: How to program it in Arduino if i use 4 sensor???

Thanks a lot guys,,, :) Murinto

HI Murinto,

You should read the data sheet to get the details - http://datasheets.maxim-ic.com/en/ds/DS18B20.pdf - important is the pullup resistor in the schematic

for ready to go samples check - http://milesburton.com/Dallas_Temperature_Control_Library -

Thanks robtillaart , your answers very helpful me.. :) Sorry to double post.

I want to Ask you Controlling Fan in CPU with PID. Do you have idea to help me??

Thanks,, Murinto

I want to Ask you Controlling Fan in CPU with PID. Do you have idea to help me??

Check - http://arduino.cc/playground/Code/PIDLibrary -

Thanks, robtillaart

I have been seen it.. i want to make control fan with PID based on data temperature...

thanks,,, Murinto

Hi robtillaart
I have been tried DS18B20 sensor,
when i use 1 sensor, i can get number of temperature,
if i try 2 sensor use one wire i can’t get temperature…

#include <OneWire.h>
#include <DallasTemperature.h>
 
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2
 
// Setup a oneWire instance to communicate with any OneWire devices 
// (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
 
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
 
void setup(void)
{
  // start serial port
  Serial.begin(9600);
  Serial.println("Dallas Temperature IC Control Library Demo");

  // Start up the library
  sensors.begin();
}
 
 
void loop(void)
{
  // call sensors.requestTemperatures() to issue a global temperature
  // request to all devices on the bus
  Serial.print(" Requesting temperatures...");
  sensors.requestTemperatures(); // Send the command to get temperatures
  Serial.println("DONE");

  Serial.print("Temperature for Device 1 is: ");
  Serial.print(sensors.getTempCByIndex(0)); // Why "byIndex"? 
    // You can have more than one IC on the same bus. 
    // 0 refers to the first IC on the wire
 
}

Need your help…
:sweat_smile:

Hi

If you are presently having difficulties communicating with the sensors, the wiring is the first place I'd be looking.

When you say you don't get the temperature when you try a 2nd one, are you still getting the temperature from the first sensor or do no sensors report a temperature once you add the 2nd? Are you using parasitic power mode, or 3 wires? What value pull-up resistor are you using on the 1wire interface? If you're using a 4k7, try another value toward the other end of the range (1k). I found 4k7 was fine for shorter distances, and just the one sensor but needed to change this as I added wire and distance, but your experience may differ. I presently have one of these sensors on the rooftop, connected by a 30m length of wire and a 2nd one on the Arduino shield (I'm not using parasitic power) and it's working great with a 1k resistor as the pull-up.

Can you share your circuit with us?

Cheers ! Geoff

are you still getting the temperature from the first sensor or do no sensors report a temperature once you add the 2nd?

yes, i still get temperature from the first sensor

Are you using parasitic power mode, or 3 wires?

What value pull-up resistor are you using on the 1wire interface?

4k7 ohm

Cheers !

file:///C:/Users/acer/Desktop/Fix%20TA/Sensor%20Suhu/Gambar%20Suhu%20Fix.jpg

How to insert image?? he..he i can''t to insert image of schematic DS18B20

Hi, Lots of DS18B20 information and how-to here: http://arduino-info.wikispaces.com/Brick-Temperature-DS18B20

And here is Rik, showing how he is reading from many DS18B20's on the same wires: http://rik94566.wordpress.com/2012/04/06/ds18b20-external-power-5-probes-working/#comment-636

Murinto92:

Are you using parasitic power mode, or 3 wires?

the data sheet for the sensor shows the two ways to get power. Which are you using? Often people report parasitic mode is prone to difficulties, though I've not used it personally.

I would suggest reading the data sheet, and try a different pull up resistor value.

Geoff

Which are you using?

http://www.hobbytronics.co.uk/ds18b20-arduino i try based upon it

Hi, Lots of DS18B20 information and how-to here: http://arduino-info.wikispaces.com/Brick-Temperature-DS18B20

And here is Rik, showing how he is reading from many DS18B20's on the same wires: http://rik94566.wordpress.com/2012/04/06/ds18b20-external-power-5-probes-working/#comment-636

Thanks i will try it

Thanks all.. I can read 4 sensor now... ^_^

:)