Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MLX90614 temperature output

Status
Not open for further replies.

Anon_1234

Newbie level 4
Joined
Dec 5, 2020
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
30
Hello I am constructing iot project using MLX90614 and Nodemcu using the Arduino IDE. However, when coding is uploaded the output comes out the same as shown. Can anyone tell me what are the possible reasons. Thank you in advance.
ouput test 1.png
 

Hi,

O.K. looks good so far. For me.

I assume this is not what you expect, but you don´t give any information about
* what you expect
* what problem you see
* your code
... and so on.

So it´s almost impossible to help.

Klaus
 

Hi,

O.K. looks good so far. For me.

I assume this is not what you expect, but you don´t give any information about
* what you expect
* what problem you see
* your code
... and so on.

So it´s almost impossible to help.

Klaus

1. Supposedly I wanted to measure the temperature of a human body, but so far the temperature does not change.
2. I think the problem is figuring out if there is a problem either for the coding or my sensor.
3. Apologies', below is the coding that I made but still a work in progress :

Code:
// List of Libraies
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <Wire.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
#include <Adafruit_MLX90614.h>


//initialize IRTherm
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
float TempReading;

//Nodemcu connecting to internet IDE

const char *ssid = "*****"; [canceled out by moderator]
const char *pass = "*****"; [canceled out by moderator]

//object initialization
float T_ambient,T_object;
unsigned long int timer;
String url;

WiFiClient client;

void setup() {
Serial.begin(9600);
  Serial.print("Adafruit MLX90614 test");
  mlx.begin();
}

//loop for thermal
void loop()
  {
  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC());
  Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");
  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempF());
  Serial.print("*F\tObject = "); Serial.print(mlx.readObjectTempF()); Serial.println("*F");
  Serial.println(millis());
  delay(500); 

  }
 
Last edited by a moderator:

Hi,

is your sensor wired correctly, including pullups?
If you´re in doubt, just post a photo.

I´m not familiar with the sensor and it´s library.. so i guess I can´t give any detailed help on this.

Klaus
 

There is also something odd about those milliseconds figures. The delay in the loop is 500 milliseconds but the difference displayed is 11905mS so something is delaying the measurements.

Are you using the MLX90614 alone or is it on an interface board with other components?
You include MQTT libraries, is there more code that could be causing the delay while publishing or subscribing to an MQTT broker?

Brian.
 

Hi,

is your sensor wired correctly, including pullups?
If you´re in doubt, just post a photo.

I´m not familiar with the sensor and it´s library.. so i guess I can´t give any detailed help on this.

Klaus
As far as I've done all the wirings have been done according to the tutorial. I apologize, I am relatively new to the IoT project and not sure what you mean by pullups. I provided the image of my circuit, but for better description refer the table provided. Thank you.
Wiring_Table.PNG
Circuit_Diagrem_Test1.jpeg
 

There is also something odd about those milliseconds figures. The delay in the loop is 500 milliseconds but the difference displayed is 11905mS so something is delaying the measurements.

Are you using the MLX90614 alone or is it on an interface board with other components?
You include MQTT libraries, is there more code that could be causing the delay while publishing or subscribing to an MQTT broker?

Brian.
So, from your statement, there may be a delay from the libraries that are currently not yet being used? For the circuitry, I have only connected the MLX90614 with the Nodemcu via the Nodemcu Base. As far as the coding, I have only uploaded the ones that I have shown previously.
 

Hi,

I am relatively new to the IoT project and not sure what you mean by pullups

I made a quick websearch, it seems the pullup resistors are included on the sensor PCB, see the attached picture.

EdaboardPic.png


According to the MLX90614 datasheet [1], the sensor is available in a 3 V and 5 V version. Please check if your board includes the shown LDO. If so, please perform a voltage measurement across the shown resistors to clarify if which voltage your sensor is using. If it is 5 V version and it includes a LDO, your sensor board needs a larger Vin than 5 V e.g. 5.5 V.

As you are using an Arduino board which usually uses 5 V logic levels, and a sensor which might provide 3 V logic levels, this might be the problem.

[1] https://www.melexis.com/en/documents/documentation/datasheets/datasheet-mlx90614

BR
--- Updated ---

... I just have seen you are using only the Arduino IDE and a Nodemcu, which uses 3.3 V logic levels. Nevertheless, please check the voltage by your sensor borad.
 
So, from your statement, there may be a delay from the libraries that are currently not yet being used?
It is possible but we can't tell if there is other code you haven't shown us. For example in many of my MQTT based projects I put all the publishing and subscribing code in a different 'tab' in the IDE. Certainly, if something is sending MQTT data there will be some delay while the code in the library decodes and checks for addressing but it shouldn't normally be anything like as long as the delay you are seeing.

The pull-up resistors are essential so check your board has them. The voltage on the SDA and SCL lines must also be at 3.3V logic levels to match the nodeMCU board so check for a regulator being fitted as Stenzer recommended. If it does have a regulator and it is a 3.3V one you might have to power the sensor from the 5V pin on the nodeMCU as it needs some 'overhead' to drop down from. If it doesn't have a regulator, power it directly from the 3.3V pin on the nodeMCU.

The reason for the pull-ups is that the I2C communication system uses 'open drain' or 'open collector' connections. All the devices on the bus have the capability to sense the presence of a voltage (when receiving) or short the voltage to ground (when transmitting a logic '0') but they have no way to produce a high voltage (logic high) on the lines. This is quite intentional as it allows several devices to share the same SCL and SDA connections without the risk of one driving high at the same time as another drives low. The pull-up resistors are there to 'pull up' the lines to logic high level unless one of the devices is pulling it low. The resistor values are a compromise, lower values allow the bus to work faster but also draw more current, higher values draw less current but they can't 'lift' the wires to logic high as quickly so the bus speed is limited. Generally, values between about 1K and 4.7k are used and you only need one resistor on SDA and one on SCL regardless of how many devices are in parallel on the bus.

Brian.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top