hello everybody, I´m new in the forum, is the first time that use arduino in my life, I really want to know the code to use the sensors LM35 and DS18B20 working at the same time with the same Arduino and how connect them. I will use 2 LM35 And two DS18B20 sensors in my final project at the University in order to get temperatures in my solar water heater. thanks !!!!!
Google "arduino lm35" or "arduino ds18b20". One of the several tens of thousands of hits might be of help.
The OneWire library has and example for the DS18B20:
ian_pixu: I will use 2 LM35 And two DS18B20 sensors in my final project at the University i
I won't ask why you would use two types of sensor in the one job, but you might consider why you would do that before your professor asks you. I don't know anything about the LM35, but here is the source I used for the DS18B20.
Strip out what you don't need.
LM35's just an analogRead(): divide the reading by 2 (ok, more correctly multiply by 500/1023 = 0.478) for degrees C.
Hi, I'd use and do use the DS18B20 every time!! Just makes sense and perhaps more accurate, depending how many bits you use, and a FLOAT Var.
As Nick ask why would you want to use 2 different devices to do the same job? If you want some consistancy.