Unable to do usb communication of the non invasive thermometer with the app.

For my college project I have created a non invasive thermometer using the app. My components for the project are:

1. Microcontroller: Nodemcu - ESP8266    2. Temperature Sensor - MLX 90614  3. Proximity Sensor - APDS - 9960

Arduino Code:

#include <Wire.h>
#include <SparkFun_APDS9960.h>
#include <Adafruit_MLX90614.h>

SparkFun_APDS9960 apds = SparkFun_APDS9960();
uint8_t proximity_data = 0;
Adafruit_MLX90614 mlx = Adafruit_MLX90614();

void setup() {

  mlx.begin();
  apds.init();
  apds.enableProximitySensor(false);

  Serial.begin(9600);

}

void loop() {
  String temperature = "";
  apds.readProximity(proximity_data);

   if (proximity_data == 255 && mlx.readObjectTempF() < 100) {

    temperature = String(mlx.readObjectTempC(), 1);
    Serial.print(" Body Temperature:");
    Serial.println(mlx.readObjectTempC());
    delay(1000);

  }
  
  if (proximity_data == 255 && mlx.readObjectTempF() > 100) {

    temperature = String(mlx.readObjectTempC(), 1);
    Serial.print(" Body Temperature:");
    Serial.println(mlx.readObjectTempC());
    Serial.print(" CRITICAL \n");
     delay(1000);

  }  
}

 

There is no error in the arduino ide code. The sensors works well and the values are shown properly on yhe serial monitor. But on interfacing with the app, garbage values get printed. The app is similar to yours.

Could you please guide, what might be the issue and how to resolve it.

 

Before sending the data to the app, could you use UART to check if the data is transmitted is the actual data? How you are debugging the code?

  Joined February 12, 2018      696
Monday at 02:11 PM