Robofun Senzor Temperatura Inlantuibil Brick (DS18B20) - Motherboard

36,00 Lei 30,60 Lei
Stoc sku: SEN-VRM-23
In stoc

Durata de livrare: 1 - 3 zile lucratoare

Limita stoc
Adauga in cos
Cod Produs: 00002457 Ai nevoie de ajutor? +40 373 813 088
La achizitionarea acestui produs primiti 1 Lei pentru comenzile viitoare
Adauga la Favorite Cere informatii
  • Descriere
  • Review-uri (0)

Senzor Temperatura Inlantuibil Brick (DS18B20).

Precizie : 0.5 grade Celsius.

Gama : –55°C to +125°C .

Este o componenta bazata pe senzorul de temperatura Dallas DS18B20

Spre deosebire de alti senzori de temperatura, aceasta componenta permite conectarea simultana a unui numar foarte mare de senzori de temperatura (fiecare senzor dispune de o adresa unica pe 64 de biti), iar lungimea firelor poate atinge fara probleme cateva sute de metri.

Componenta motherboard dispune de un conector cu surub cu trei pini, precum si de un senzor Dallas DS18B20 deja lipit pe placa.

Asadar, daca vrei sa masori temperatura intr-o singura locatie, ai nevoie nevoie doar de componenta motherboard.

Daca vrei sa masori temperatura in doua locatii, ai nevoie de componenta motherboard si de un senzor de temperatura Dallas DS18B20. Un senzor este deja lipit pe motherboard, iar pe celalalt il conectezi cu fire in pinii cu surub. Fire de conectare potrivite sunt acestea - https://www.robofun.ro/index.php?route=product/search&search=fir%20conexiune%20multifilar%200.35

Daca vrei sa masori temperatura in N  locatii, ai nevoie de componenta motherboard si de N-1 senzori de temperatura Dallas DS18B20

 

Librarie Arduino Senzor Temperatura: - http://www.milesburton.com/?title=Dallas_Temperature_Control_Library

Librarie Arduino OneWire (va trebui sa o instalezi si pe aceasta) - http://www.pjrc.com/teensy/td_libs_OneWire.html

 

 

 

 

 

 

 

 

 

Cod sursa:

#include "onewire.h"
#include "dallastemperature.h"

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
#define TEMPERATURE_PRECISION 9

// Setup a oneWire instance to communicate
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire);

// arrays to hold device addresses
DeviceAddress insideThermometer, outsideThermometer, outsideThermometer1;

void setup(void)
{
  // start serial port
  Serial.begin(9600);
  Serial.println("Dallas Temperature IC Control Library Demo");

  // Start up the library
  sensors.begin();

  // locate devices on the bus
  Serial.print("Locating devices...");
  Serial.print("Found ");
  Serial.print(sensors.getDeviceCount(), DEC);
  Serial.println(" devices.");

  // report parasite power requirements
  Serial.print("Parasite power is: "); 
  if (sensors.isParasitePowerMode()) Serial.println("ON");
  else Serial.println("OFF");

  // assign address manually.  the addresses below will beed to be changed
  // to valid device addresses on your bus.  device address can be retrieved
  // by using either oneWire.search(deviceAddress) or individually via
  // sensors.getAddress(deviceAddress, index)
  //insideThermometer = { 0x28, 0x1D, 0x39, 0x31, 0x2, 0x0, 0x0, 0xF0 };
  //outsideThermometer   = { 0x28, 0x3F, 0x1C, 0x31, 0x2, 0x0, 0x0, 0x2 };

  // search for devices on the bus and assign based on an index.  ideally,
  // you would do this to initially discover addresses on the bus and then 
  // use those addresses and manually assign them (see above) once you know 
  // the devices on your bus (and assuming they don't change).
  // 
  // method 1: by index
  if (!sensors.getAddress(insideThermometer, 0)) Serial.println("Unable to find address"); 
  if (!sensors.getAddress(outsideThermometer, 1)) Serial.println("Unable to find address"); 
    if (!sensors.getAddress(outsideThermometer1, 2)) Serial.println("Unable to find address"); 

  // method 2: search()
  // search() looks for the next device. Returns 1 if a new address has been
  // returned. A zero might mean that the bus is shorted, there are no devices, 
  // or you have already retrieved all of them.  It might be a good idea to 
  // check the CRC to make sure you didn't get garbage.  The order is 
  // deterministic. You will always get the same devices in the same order
  //
  // Must be called before search()
  //oneWire.reset_search();
  // assigns the first address found to insideThermometer
  //if (!oneWire.search(insideThermometer)) Serial.println("Unable to find address for insideThermometer");
  // assigns the seconds address found to outsideThermometer
  //if (!oneWire.search(outsideThermometer)) Serial.println("Unable to find address for outsideThermometer");

  // show the addresses we found on the bus
  Serial.print("Device 0 Address: ");
  printAddress(insideThermometer);
  Serial.println();

  Serial.print("Device 1 Address: ");
  printAddress(outsideThermometer);
  Serial.println();

  Serial.print("Device 2 Address: ");
  printAddress(outsideThermometer1);
  Serial.println();

  // set the resolution to 9 bit
  sensors.setResolution(insideThermometer, TEMPERATURE_PRECISION);
  sensors.setResolution(outsideThermometer, TEMPERATURE_PRECISION);
    sensors.setResolution(outsideThermometer1, TEMPERATURE_PRECISION);

  Serial.print("Device 0 Resolution: ");
  Serial.print(sensors.getResolution(insideThermometer), DEC); 
  Serial.println();

  Serial.print("Device 1 Resolution: ");
  Serial.print(sensors.getResolution(outsideThermometer), DEC); 
  Serial.println();
  
    Serial.print("Device 2 Resolution: ");
  Serial.print(sensors.getResolution(outsideThermometer1), DEC); 
  Serial.println();
  delay(1000);
}

// function to print a device address
void printAddress(DeviceAddress deviceAddress)
{
  for (uint8_t i = 0; i < 8; i++)
  {
    // zero pad the address if necessary
    if (deviceAddress[i] < 16) Serial.print("0");
    Serial.print(deviceAddress[i], HEX);
  }
}

// function to print the temperature for a device
void printTemperature(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempC(deviceAddress);
  Serial.print("Temp C: ");
  Serial.print(tempC);
  Serial.print(" Temp F: ");
  Serial.print(DallasTemperature::toFahrenheit(tempC));
}

// function to print a device's resolution
void printResolution(DeviceAddress deviceAddress)
{
  Serial.print("Resolution: ");
  Serial.print(sensors.getResolution(deviceAddress));
  Serial.println();    
}

// main function to print information about a device
void printData(DeviceAddress deviceAddress)
{
  Serial.print("Device Address: ");
  printAddress(deviceAddress);
  Serial.print(" ");
  printTemperature(deviceAddress);
  Serial.println();
}

void loop(void)
{ 
  // call sensors.requestTemperatures() to issue a global temperature 
  // request to all devices on the bus
  Serial.print("Requesting temperatures...");
  sensors.requestTemperatures();
  Serial.println("DONE");

  // print the device information
  printData(insideThermometer);
  printData(outsideThermometer);
    printData(outsideThermometer1);
    delay(1000);
}

 

 

Proiect rețea de senzori de temperatura de tip MySensors

Proiect Hunting the Heat

Proiect Ceas IoT cu programare OTA

Daca doresti sa iti exprimi parerea despre acest produs poti adauga un review.

Review-ul a fost trimis cu succes.

Suport clienti Email tehnic si cereri de oferta B2B: contact@robofun.ro

+40 373 813 088 info@robofun.ro

Compara produse

Trebuie sa mai adaugi cel putin un produs pentru a compara produse.

A fost adaugat la favorite!

A fost sters din favorite!