This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

  • 0 voto(s) - 0 Media
  • 1
  • 2
  • 3
  • 4
  • 5
INDICADOR TEMPERATURA DS18B20 TM1637
#1
[Imagen: 040-7-seg-led-fig-03-96dpi.png]

Hola quiero montar un circuito que vi en la red  , que es un indicador de temperatura con el sensor DS18B20 y el display TM1637 , el circuito esta montado con Arduino Nano y yo lo monte con el Arduino Uno , el problema que tengo es que el sensor marca 0C no funciona tengo una duda , si me pueden ayudar , las conexiones en el Arduino Nano es CLOCK D9 DATA D8 SENSOR PIN 10 , yo las conexiones las puse igual en el Arduino Uno , entonces no se donde esta el problema  , les pongo el codigo .
// TM1637_7_seg_led_display_DS18B20_nnn
//
// Floris Wouterlood
// august 5, 2018
// reports temperature of a DS18B20 probe
// open source - use as you wish

   #include <TM1637Display.h>
   #include <OneWire.h>
   #include <DallasTemperature.h>
   #define onewirepin 10

   OneWire oneWire(onewirepin);
   DallasTemperature sensors(&oneWire);

   // follows the device address unique for this specimen of DS18B20. You must supply the correct address
   DeviceAddress Probe = {0x28, 0xFF, 0x7B, 0x74, 0xA3, 0x15, 0x04, 0x93 };
   // if you do not know the device address, use an onewire address finder sketch to determine it.
   
   const int CLK = 9;                // set the CLK pin connection to the display
   const int DIO = 8;                // set the DIO pin connection to the display
   int t_ds18b20 = 0;                // temperature vraiable
   
   const uint8_t DEGREES[] = {
   0x0, 0x0,
   SEG_A | SEG_B | SEG_G | SEG_F,    // superscript o
   SEG_A | SEG_F | SEG_E | SEG_D,    // C
   };

   TM1637Display display(CLK, DIO);  // set up the 4-Digit Display.


void setup(){

  Serial.begin (9600);
  Serial.print ("Initializing Temperature Control Library Version ");
  Serial.println (DALLASTEMPLIBVERSION);
 
  sensors.begin ();                  // initialize the sensor and set resolution level
  sensors.setResolution(Probe, 10);
 
  display.setBrightness(0x0a);      // set display to maximum brightness
  delay(1000);
 
  Serial.println();                  // debugging: report DS18B20 data to Serial Monitor
 
  Serial.print ("Number of Devices found on bus = ");  
  Serial.println (sensors.getDeviceCount());   
  Serial.print ("Getting temperatures... ");  
  Serial.println ();   
}


void loop()
{

  sensors.requestTemperatures();    // command all devices on bus to read temperature
  printTemperature(Probe);          // call to subroutine
  to_the_display();                 // call to subroutine
}

// subroutines =======================================================================

void printTemperature(DeviceAddress deviceAddress)
  {

float tempC = sensors.getTempC(deviceAddress);

   if (tempC == -127.00)
   {
   Serial.print ("Error getting temperature  ");
   }
   else
   {
   t_ds18b20=tempC;
   Serial.print (tempC);
   Serial.println ("   *C");
   }
}

void to_the_display (){

  display.setSegments(DEGREES); //Display the Variable value;
  display.showNumberDec(t_ds18b20,false,2,0);
  delay (4000);
}
  Responder


Posibles temas similares…
Tema Autor Respuestas Vistas Último mensaje
  ARDUINO TERMOMETRO DHT11 TM1637 pascual 3 1,692 24-07-2019, 09:47 PM
Último mensaje: Lepes