หมวดหมู่ | Sensor/Encoder |
ราคาปกติ | |
ลดเหลือ | 80.00 บาท |
สถานะสินค้า | พร้อมส่ง |
สภาพ | สินค้าใหม่ |
ลงสินค้า | 14 ต.ค. 2557 |
อัพเดทล่าสุด | 24 พ.ค. 2561 |
จำนวน | ชิ้น |
เซ็นเซอร์วัดอุณหภูมิ แบบ Digital 1-Wire. วัดอุณหภูมิได้ตั้งแต่ -55°C to +125°C
File PDF >>> Link
Library OneWire >>> Link
Library dallas temperature control >>> Link
คู่มือการใช้งาน >>> Link
การต่อสายใช้งาน ดังนี้
- Red >>> Vcc
- Yellow >>> Signal
- Green >>> GND
ให้ต่อ R ค่า 4.7k-10k คร่อมระหว่างขา Red กับ Yellow ด้วย
Example Code Test Temp.
#include
#include
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
void setup(void)
{
// start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin();
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print("Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperatures
Serial.println("DONE");
Serial.print("Temperature for the device 1 (index 0) is: ");
Serial.println(sensors.getTempCByIndex(0));
delay(500);
}
Example Code Temp On/Off Relay.
#include
#include
int Temp;
const int Relay = 8; // Digital output pin that the Relay is attached to
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
void setup(void)
{
pinMode(Relay, OUTPUT);
digitalWrite(Relay, HIGH);
// start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin();
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print("Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperatures
Serial.println("DONE");
Temp = sensors.getTempCByIndex(0);
Serial.print("Temperature for the device 1 (index 0) is: ");
Serial.println(Temp);
if(Temp >= 60) { // Relay OFF
digitalWrite(Relay, HIGH);
}
else if(Temp <= 55) { //Relay ON
digitalWrite(Relay, LOW);
}
}
สอบถามสินค้าหรือต้องการใบเสนอราคาหรือใบกำกับภาษีโปรดติดต่อทางร้านก่อนสั่งซื้อครับผม
- ติดต่อผ่าน LINE ID : csanthanaboun
- เบอร์โทร 0909761799
หน้าที่เข้าชม | 332,811 ครั้ง |
ผู้ชมทั้งหมด | 120,848 ครั้ง |