Unsure about data transfer

I have a DS18B20 temperature sensor connected to pin 10 on my UNO. I understand that the data is read from the sensor but I am a bit unclear on how this data is transferred.

I have used Serial.begin(96000) in my program but on the it says

"All Arduino boards have at least one serial port (also known as a UART or USART): Serial. It communicates on digital pins 0 (RX) and 1 (TX) as well as with the computer via USB. Thus, if you use these functions, you cannot also use pins 0 and 1 for digital input or output."

Does this mean that even though my sensor is connected to pin10 it will be using UART serial communication for data transfer?

any further clarification would be appreciated??

Thanks in advance

You need to post a link to the datasheet for the sensor and the code that you are using.

Does this mean that even though my sensor is connected to pin10 it will be using UART serial communication for data transfer?

That seems very unlikely. But it may be using SoftwareSerial.

...R

The DS18B20 uses a custom data transfer protocol (usually called 1-Wire, although a data wire and a ground connection are required), which requires a library of support code. The 1-Wire protocol can use any digital pin for the data transfer, and does not use the UART.

9600 not 96000

http://www.hacktronics.com/Tutorials/arduino-1-wire-tutorial.html

Arduino uses I-wire to get information from sensor, and uses serial to send that to the serial monitor vis USB cable.

Thanks for the replies.

Yes sorry I meant 9600. I think the example I am using uses 1-wire. I have looked into this communication a bit but struggle to understand it fully.

Would the UNO then use UART for communication with a GSM shield for example?

You can hardly be in any doubt about it. If the programme uses 1-wire, it will call for the onewire library. It is possible to to use the DS18B20 without onewire, but it is a rather pointless exercise.
Comms with a GSM shield would be via the serial pins.

Great I understand a bit more now I think. Thanks for your help

Rather than guess, use the sample program that is with your Arduino programming environment(IDE). Look under "file" for "examples", for "onewire", then "DS18x20 Temperature".

I used this to test the two DS18B20 sensors I bought. Works great. Then integrated the sample code with my oven controller program.

Paul

Paul_KD7HB:
Rather than guess, use the sample program that is with your Arduino programming environment(IDE). Look under "file" for "examples", for "onewire", then "DS18x20 Temperature".

Smeesh, I wouldn't do that if I were you. That programme would have to be about the worst piece of junk ever written, and you would have to wonder how the hell it was let out into the public arena. The only useful bit in it is:

// The DallasTemperature library can do all this work for you!
// http://milesburton.com/Dallas_Temperature_Control_Library

and it isn't even code, it's a comment. And indeed it is a valid one - one that everybody else follows, without having it suggested by a clown who can't follow his own advice. I have often wondered where this rubbish came from. Now I know.

There is more than one way to use the DS18B20 - all using the DallasTemperature library. The one I linked to is the one I found most sensible.

OK thanks guys.

Another quick question you might be able to help me with, is it possble to adapt my code to make it more power efficient.

I have read about disabling ADC and SPI and I2C but I cant find how to do it?

Not going to gain much with an Uno. Go to battery powered Promini, 8 MHz.

OK thanks.

Also a thought I had, if I deleted print.ln commands for the serial monitor would that increase the power efficiency of the board?

I think that would be as futile as those attempts in reply#9. Getting rid of the green LED would surely be a lot more beneficial. Power efficiency is a den of black arts, but it starts somewhere around reply #10, and likely includes a voltage regulator that is one hell of a lot more efficient than that on your Uno.
One of the best sites on this matter is
http://www.home-automation-community.com/arduino-low-power-how-to-run-atmega328p-for-a-year-on-coin-cell-battery/
and in the light of it, I settled for a 5v 16 MHz Pro Mini. The ProMini is essentially a stripped down Uno.

OK thanks for the advice.

I understand that it may make very little difference I am just trying to investigate any improvement that could be made. I'm surely going to look into getting rid of an LED but I'm unsure on how to do so at this moment in time.

smeesh:
I'm surely going to look into getting rid of an LED but I'm unsure on how to do so at this moment in time.

Taking a knife to the relevant PC track should do it but I would suggest you leave the Uno alone, and do the deed on a Pro Mini when you are ready, thereby keeping the Uno virgo intacto for other projects. There is a note on surgery on pro Mini in the link posted above

is it possble to adapt my code to make it more power efficient.

See Nick Gammon's excellent tutorial on power saving methods.