Hello! Very Happy to be here!
I currently have a functioning circuit consisting of an Uno, SSD1306 .96" OLED, and a MLX90614
temp sensor. Both the OLED and Temp Sensor is connected to ports A4 and A5 on the UNO, with VCC on the OLED to 3.3v and 5V to the sensor. I am finding that when I have a foot or more wire length the OLED will not illuminate and the temp sensor will not function (process wont initiate), however, when the wire length is less than a foot it boots up and displays temperature accurately. I tried various gauges of wire as well as solid copper thinking CCA could the issue to no avail.
This will not work in my application because the OLED display needs to be at least 12ft. from the Arduino and the temp sensor needs to be around 4 or 5ft. from the Arduino. Any ideas what may be causing this? Is the current just not there, or does it have something to do with the shared ports (A4/A5) and causing resistance. Would putting the sensor on different ports eliminate this problem, and if so, how would I activate (for lack of a better word) those alternative ports in the sketch to do exactly what they are doing now when using less than a foot of wire?
Beyond that, I came up with the idea to incorporate wireless functionality from the sensor to the OLED display. Of course I will need a second UNO to achieve this and I have already purchased the
NRF24L01 modules to facilitate this. I really need assistance here with modifying my existing sketch to enable this functionality. Essentially, what sketch would I use on the sensor side Arduino (transmitter) and what sketch would I use on the OLED display side Arduino (receiver) , with the current configuration as a example in mind. I will paste a copy of my current sketch below.
This has been a three week process and I'm at a loss at this point, and my deadline is this coming weekend so any assistance or input is tremendously appreciated!
/*
- MLX90614 Infrared Temperature Sensor and SSD1306 Oled display Module with Arduino
- Non-Contact Thermometer
*/
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_MLX90614.h>
// For the SSD1306 I2C supported Oled Display Module
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
double temp_amb;
double temp_obj;
void setup()
{
Serial.begin(9600);
mlx.begin(); //Initialize MLX90614
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //initialize with the I2C addr 0x3C (128x64)
Serial.println("MLX90614 Infrared Temperature and Oled display with Arduino");
display.clearDisplay();
display.setCursor(5,20);
display.setTextSize(2);
display.setTextColor(WHITE);
display.println("NELO MEDIA:");
display.setCursor(25,35);
display.setTextSize(2);
display.print("NMCS");
display.display();
delay(5000);
}
void loop()
{
temp_amb = mlx.readAmbientTempF();
temp_obj = mlx.readObjectTempF();
display.clearDisplay();
display.setCursor(25,5);
display.setTextSize(1);
display.setTextColor(WHITE);
display.println("Temp :");
display.setCursor(10,20);
display.setTextSize(3);
display.print(temp_obj);
display.print((char)247);
display.print("F");
display.display();
delay(1000);
}