Arduino keeps restarting (memory issue?) - DHT11 + Arduino IoT cloud

Hi folks,

today I tried to get my MKR1000 to show the temperature information from the DHT11 in the Arduino app on Android.

The code I have working so far is to let the MKR1000 connect to my WiFi and let the sensor information show up in the serial monitor.

When trying to add Arduino Cloud components in the sketch, the code executes and after 2 reads from the sensor it restarts again and this goes in a loop.

The end result I would like to have is to view the sensor information on Android app. Any suggestions on how to do that?

Thank you for your time.

This is my code so far:

#include <SPI.h>
#include <WiFi101.h>
#include "thingProperties.h"

///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;    // your network password (use for WPA, or use as key for WEP)
int status = WL_IDLE_STATUS;     // the WiFi radio's status

#include "DHT.h"
#define DHTPIN 5
#define DHTTYPE DHT11


void setup() {
  //Initialize serial and wait for port to open:

// ------------------->>>>>>>>>>>>>>> I ADDED THESE 2 LINES <<<<<<<<<<<-------------------------

  // check for the presence of the shield:
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present");
    // don't continue:
    while (true);

  // attempt to connect to WiFi network:
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:

  // you're connected now, so print out the data:
  Serial.println("You're connected to the network");


void loop() {

  float h = dht.readHumidity();
  // Read temperature as Celsius (the default)
  float t = dht.readTemperature();
  // Read temperature as Fahrenheit (isFahrenheit = true)
  float f = dht.readTemperature(true);

  if (isnan(h) || isnan(t) || isnan(f)) {
    Serial.println(F("Failed to read from DHT sensor"));

  float hif = dht.computeHeatIndex(f, h);

  float hic = dht.computeHeatIndex(t, h, false);

  Serial.print(F("Humidity: "));
  Serial.print(F("%  Temperature: "));
  Serial.println(F("°C "));


If you place the following, right after Serial.begin(9600); ,

Serial.print("\r\n Initializing... \r\n");

what is the Result?

No luck there. I have found that it is the following library that causes the problems.

#include "thingProperties.h"

Isn't this library needed to communicate with the Arduino IoT cloud?

I didn't mean it as a cure. If it kept knocking out "Initializing. . ." then that would indicate, I think, a 'reset' (something taking Vcc unacceptably low).
When a library is lacking, sketches (usually?) do not Compile [Verify].

@runaway_pancake, thank you for your reply. unfortunately, it made no difference in the sketch. I am at a loss here since that library is needed to connect to the Arduino IoT Cloud, yes?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.