I bought from FunGizmos few DS18S20 temperature sensors to test for my small robot project and last week they finally got into my hands but only today I had the time to try them out.
To connect the sensors to the Arduino board I choose the parasite mode which derive power directly from the data line ( no need for an external power supply anymore
), below are the pinouts, the electronic scheme and a photo of the circuit (though, really simple as I used a breadboard) :

pinouts ds18s20

Arduino connection for Dallas DS18S20

After a little bit of research of Dallas’s one-wire interface and downloading the onewire library from Arduino.cc I came out with a nice function to detect all the DS18S20 and DS18B20 sensors from a one-wire bus.
Here is the detection and temperature reading code : tutorialpedia.
A sample of their output :
–Search started–
Device is a DS18S20 : 10-1D-30-F9-01-08-00-51
–Search ended–
for the detection code and
Temp = 79.25 F or 26.25 C
Temp = 79.14 F or 26.19 C
Temp = 79.14 F or 26.19 C
Temp = 79.25 F or 26.25 C
for the temperature retrieving code.
Other helpful links :
* onewire.h library
* Dallas DS18S20 official document
Posted in Arduino.
By Trimbitas Sorin
– August 23, 2009
As you may know, from now on all the code from this blog will be on tutorialpedia.
I started writing some Arduino tutorials so I needed a syntax highlighter for the code I wrote, the best choice was GeSHI but it didn’t had a language file for Arduino code so I wrote it.
An example of it at work : Blinking a LED with Arduino.
To download it click here : GeSHi Arduino language file.
Hope this will help you.
Posted in Arduino.
By Trimbitas Sorin
– August 18, 2009
Sometimes you really need to use the Serial port (UART or USART) of Arduino to communicate with your computer (or other devices) for debugging or readings.
Arduino uses digital pins 0 (RX, receive) and 1 (TX, transmission) for Serial communication with all devices and the USB cable for communication with the computer (and the built-in Serial Monitor from the Arduino IDE).
The code for doing this is pretty simple, you just need to initialize the serial port and set the baud rate (symbols per second) like this : Serial.begin(9600); and then receive/transmit using the next functions : print, println and write. For official documentation on this click here.
As an example .. I wrote 2 small programs that does this :
- the first one : uses the Hello World! from the previous post and it outputs to the Serial Monitor the current status of the LED using print and println functions.
- the second one : is fully based on the first example but it also receives data from the computer to turn on/off the LED using the read function.
You can see their code on Tutorialpedia.
To start the Serial Monitor from Arduino IDE .. just click the last button from the option’s bar and set the baud rate to match your own baud rate used while initializing with Serial.begin(). After pressing the Serial Monitor button a new black area will appear where you can send data to your Arduino board or see the output of it.

Serial Monitor from Arduino's IDE
Posted in Arduino.
By Trimbitas Sorin
– August 17, 2009
Latest Comments