I've connected a temperature sensor (DS18B20) to my Pi and want to read it using 1-wire, but it doesn't work.

I have loaded the w1-gpio and w1-therm modules, added them to /etc/modules and rebooted a bunch of times.

This is the contents of /sys/bus/1w/devices:



i am using LM35 SENSOR

1 Answer 1


A LM35 sensor is not a DS18B20.

The LM35 signals the temperature by generating an analogue voltage proportional to the temperature which must be read by an external ADC attached to the Pi.

A DS18B20 is a digital sensor which signals the temperature by sending a digital bit pattern down a 1-wire bus (single wire) connected to the Pi.

You need to buy an ADC, e.g. a MCP3008 or similar.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.