Materiales a utilizar:
- Sensor MLX90614
- Batería de litio 3.7v a 1000mAh
- Módulo ESP32 DEVKITV1 30 Pines
- Display Oled 128×64 0.96 I2C SSD1306
- Mini Protoboard 170 Pts
- Micro Switch 2 pines
- Cables Dupont Corto H-H
Descargar y agregar librerías para el Display Oled
Editar la librería Adafruit_SSD1306
Múltiple conexión 12C al ESP32 conectando el sensor y el display oled
Ya que modificaste la librería lo siguiente será realizar las conexiones:
/*El siguiente código permite se permite obtener la lectura del sensor MLX90614 en la pantalla oled, utilizando el ESP32 como microcontrolador, el interfaz de comunicación es I2C para obtener las lecturas y comunicación con la oled para mostrar información de temperatura Ambiente y de un Objeto*/ /**************************************** *Definir librerías, instancias y constantes *Para la pantalla OLED ****************************************/ #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define OLED_RESET LED_BUILTIN Adafruit_SSD1306 display(OLED_RESET); #if (SSD1306_LCDHEIGHT != 64) #error("Altura incorrecta, cambie en la libreria de Adafruit_SSD1306.h!"); #endif //Imagen que se mostrara al iniciarse el código const unsigned char PROGMEM logo [] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x06,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xc0,0x70,0x80,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x0f,0x00,0x30,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0xe0,0x00,0x0c,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x1e,0x00,0x00,0x03,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x0c,0x00,0x00,0x00,0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xc0,0x03,0x00,0x00,0x00,0x30,0x00, 0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x01,0x04,0x00,0xc0,0x00,0x00,0xec,0x00, 0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x04,0x13,0x00,0x30,0x00,0x07,0x07,0x00, 0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x10,0x60,0xc0,0x0c,0x00,0x30,0x39,0x00, 0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x41,0x98,0x30,0x03,0x03,0x81,0xc1,0x00, 0x00,0x00,0x00,0x01,0x80,0x0f,0xff,0xff,0x07,0x06,0x08,0x00,0xd8,0x0e,0x01,0x00, 0x00,0x00,0x00,0x06,0x00,0x10,0x00,0x00,0x1c,0x41,0x86,0x00,0x00,0x70,0x01,0x00, 0x00,0x00,0x00,0x18,0x00,0x40,0x00,0x00,0x66,0x10,0x61,0x80,0x03,0x80,0x01,0x00, 0x00,0x00,0x00,0x3f,0x01,0x00,0x00,0x01,0xe1,0x84,0x19,0x80,0x0c,0x00,0x02,0x00, 0x00,0x00,0x00,0x20,0x1f,0xf8,0x00,0x06,0x18,0x61,0x86,0x00,0x10,0x00,0x06,0x00, 0x00,0x00,0x00,0x20,0x00,0x00,0xf0,0x0b,0x06,0x18,0x78,0x00,0x40,0x00,0x04,0x00, 0x00,0x00,0x00,0x3f,0xc0,0x00,0x06,0x18,0xc1,0x86,0x60,0x01,0x80,0x00,0x08,0x00, 0x00,0x00,0x00,0x00,0x07,0xfc,0x01,0x86,0x30,0x61,0x80,0x06,0x40,0x00,0x10,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x61,0x84,0x1a,0x00,0x18,0x40,0x00,0x20,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x8e,0x18,0x61,0x8c,0x00,0x60,0x20,0x00,0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x89,0x86,0x18,0x70,0x01,0x80,0x20,0x03,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x61,0x83,0xc0,0x02,0x00,0x10,0x0c,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x18,0x20,0x00,0x02,0x00,0x10,0x30,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x06,0x0c,0x00,0x01,0x00,0x08,0xc0,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x01,0x83,0x00,0x00,0x80,0x0b,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x00,0x60,0xc0,0x00,0x80,0x04,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x0c,0x00,0x30,0xc0,0x18,0x30,0x00,0x40,0x04,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x33,0x00,0x0c,0x30,0x06,0x18,0x00,0x20,0x06,0x00,0x00,0x00, 0x00,0x00,0x00,0x10,0x40,0x80,0x03,0x0c,0x01,0x04,0x00,0x20,0x02,0x00,0x00,0x00, 0x00,0x00,0x00,0xef,0x80,0x61,0x00,0xc3,0x01,0x02,0x00,0x10,0x03,0x00,0x00,0x00, 0x00,0x00,0x00,0x83,0x00,0x1e,0x00,0x30,0xc1,0x01,0x00,0x18,0x01,0x00,0x00,0x00, 0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x0c,0x31,0x20,0x80,0x08,0x01,0x00,0x00,0x00, 0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x03,0x0f,0x10,0x40,0x04,0x00,0x80,0x00,0x00, 0x00,0x00,0x01,0x83,0x00,0x00,0x06,0x00,0xc3,0x0c,0x20,0x04,0x00,0x80,0x00,0x00, 0x00,0x00,0x00,0xc6,0x00,0x00,0x18,0x00,0x30,0x02,0x10,0x02,0x00,0x40,0x00,0x00, 0x00,0x00,0x00,0x38,0x00,0x00,0x60,0x00,0x0c,0x03,0x08,0x01,0x00,0x40,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x03,0x03,0x0c,0x84,0x03,0x00,0x20,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x06,0x00,0xf0,0x42,0x0c,0x00,0x20,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x04,0x00,0x00,0x21,0x30,0x00,0x10,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x04,0x00,0x00,0x18,0xc0,0x00,0x10,0x00,0x00, 0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x04,0x00,0x00,0x0c,0x40,0x00,0x70,0x00,0x00, 0x00,0x00,0x0f,0x00,0x06,0x00,0x00,0x04,0x00,0x00,0x02,0x20,0x03,0x10,0x00,0x00, 0x00,0x00,0x30,0xc0,0x18,0x00,0x00,0x04,0x00,0x00,0x01,0x10,0x0c,0x30,0x00,0x00, 0x00,0x00,0xc0,0x30,0x20,0x00,0x00,0x04,0x00,0x00,0x00,0x88,0x30,0xc0,0x00,0x00, 0x00,0x03,0x00,0x0c,0x80,0x00,0x00,0x0c,0x00,0x00,0x00,0x65,0xc6,0x00,0x00,0x00, 0x03,0xec,0x00,0x02,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x32,0x18,0x00,0x00,0x00, 0x06,0x18,0x00,0x00,0x00,0x00,0x70,0x40,0x00,0x00,0x00,0x08,0x60,0x00,0x00,0x00, 0x0c,0x08,0x00,0x00,0x00,0x01,0x9d,0x80,0x00,0x00,0x00,0x05,0x80,0x00,0x00,0x00, 0x08,0x08,0x00,0x00,0x00,0x03,0x06,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00, 0x0c,0x18,0x00,0x00,0x00,0x02,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x06,0x10,0x00,0x00,0x00,0x02,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x03,0xe0,0x00,0x00,0x00,0x03,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x01,0xd8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, }; /**************************************** *Definir librerías, instancias y constantes *Para el sensor MLX90614 ****************************************/ #include <Wire.h> #include <Adafruit_MLX90614.h> Adafruit_MLX90614 mlx = Adafruit_MLX90614(); /**************************************** *Funciones principales ****************************************/ void setup() { display.begin(SSD1306_SWITCHCAPVCC, 0x3C); display.clearDisplay(); display.drawBitmap(0,0,logo,128,64,1); display.display(); delay(500); mlx.begin(); } void loop() { Oled_mlx(); //Función para la oled y el sensor } void Oled_mlx() { display.clearDisplay(); display.setTextSize(2); display.setTextColor(WHITE); display.setCursor(0,0); display.println("T_Ambiente"); display.print(" "); display.println(mlx.readAmbientTempC()); //mlx.readAmbientTempF() display.println("T_Objeto"); display.print(" "); display.println(mlx.readObjectTempC()); //mlx.readObjectTempF() display.display(); }
en que programa hicieron el diagrama de conexion del sistema?
Se realizó en Fritzing