3 CH Sensor Suhu DS1820 LM35 TC
3 CH Sensor Suhu DS1820 LM35 TC
3 CH Sensor Suhu DS1820 LM35 TC
com]
Kebutuhan Hardware :
Arduino UNO Board
Modul sensor temperatur DS182/22
Modul sensor LM35
Modul Sensor Thermocouple dg driver MAX6675
Power Supply 7-9 Vdc
DS1820/22 Waterproof
DS1820/22
Thermocouple &
MAX675
2 Inkubatek [supported by : www.tokotronik.com]
LM35
Schematics
5V 5 V (red)
11 Data (yellow)
3 Inkubatek [supported by : www.tokotronik.com]
5V VCC
GND GND
8 S0
9 CS
10 SCK
5V 5V
GND GND
Source Code/Sketch :
/*************************************
* Sensor DS1820
* SO --> PIN 8
* CS --> PIN 9
* www.tokotronik.com
* ***********************************/
#include <OneWire.h>
4 Inkubatek [supported by : www.tokotronik.com]
#include <Wire.h>
#include "max6675.h"
int thermoDO = 8;
int thermoCS = 9;
//============================================
void setup(void) {
Serial.begin(9600);
//===========================================
void loop(void) {
byte i;
byte present = 0;
byte type_s;
byte data[12];
byte addr[8];
//===================================
if ( !ds.search(addr)) {
ds.reset_search();
delay(250);
return;
5 Inkubatek [supported by : www.tokotronik.com]
switch (addr[0]) {
type_s = 1;
break;
type_s = 0;
break;
type_s = 0;
break;
return;
ds.reset();
ds.select(addr);
// we might do a ds.depower() here, but the reset will take care of it.
present = ds.reset();
ds.select(addr);
data[i] = ds.read();
}
6 Inkubatek [supported by : www.tokotronik.com]
if (type_s) {
if (data[7] == 0x10) {
else {
else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms
else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms
tempDS=celsius;
//====================
adc = analogRead(0);
tempLM=(adc*5)/10;
//====================
celsius=thermocouple.readCelsius();
tempTC=celsius;
Serial.print("Temp DS1820=");
Serial.print(tempDS);
Serial.println(" Celcius");
Serial.print("Temp Thermocouple=");
Serial.print(tempTC);
Serial.println(" Celcius");
Serial.print("Temp LM35=");
7 Inkubatek [supported by : www.tokotronik.com]
Serial.print(tempLM);
Serial.println(" Celcius");
delay(1000);
Jalannya Alat :
Jalankan Serial Monitor (dari menu Tool – Serial Monitor) set baud rate pada nilai 9600 bps. Pada
Serial Monitor akan tampil nilai temperature yang dibaca oleh Arduino dengan sensor suhu DS1820 ,
LM35 dan Thermocouple. Jika temperatur berubah, tampilan di Serial Monitor akan mengikutinya.