jolle-pe
Posts: 10
Joined: Wed Jan 02, 2013 1:56 pm

How to connect a temperature sensor?

Sat Jul 19, 2014 11:02 am

Hi,

i have a temperature sensor for the raspberry pi.
It was part of a "getting started" bundle.

But there was no description how to wire the board to the raspberry pi.

Image

It looks like this.
As a part of the bundle, there was a break out coupler and a breadbord.

Now I want to put all this stuff together and want to measure the temperature.
How do i manage the wiring and I need a program code for read the input.

Greetings

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: How to connect a temperature sensor?

Sat Jul 19, 2014 11:04 am

That looks like an analogue sensor. Does it have any identifying marks. The Pi has no analogue gpios.

Could you link to the bundle you bought?


User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to connect a temperature sensor?

Sat Jul 19, 2014 11:08 am

Search google for DS18B20 1-wire temp sensor.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

jolle-pe
Posts: 10
Joined: Wed Jan 02, 2013 1:56 pm

Re: How to connect a temperature sensor?

Sat Jul 19, 2014 11:12 am

Does anyone have a program code for checking the temperature?

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to connect a temperature sensor?

Sat Jul 19, 2014 11:15 am

Extend your google search. There are thousands of examples out there.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: How to connect a temperature sensor?

Sat Jul 19, 2014 11:20 am

Search the site for DS18B20. There should be plenty of code. I think it also need a 4K7 pull-up to 3.3V. Perhaps the module contains a resistor pull-up.

It's simplest if you connect the DAT (data) line to gpio4 as there are Linux drivers (w1-therm, w1-gpio) to read the DS18B20.

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to connect a temperature sensor?

Sat Jul 19, 2014 11:20 am

jolle-pe wrote:Does anyone have a program code for checking the temperature?
Did you try Google? This temperature sensor is very popular and there are hundreds of program examples using it.

Return to “Automation, sensing and robotics”