Nano 33 constantly 'resets' on power module

I am having a weird problem with Nano 33 on 9V power supply module with LCD. In trying to debug, I stripped down /re-wrote to very basic code, but this happens any time I am using this setup.

If I upload code to Nano via IDE, everything works 100% perfect so I believe my circuit is fine. But if I upload exact same code via Cloud (only changing Cloud-specifics, variable setup etc) the LCD powers on, runs a second, then seems to reset and start over. So via IDE on the code below, I get 1, 2, 3... as expected. But on Cloud, I see 1, then it pauses a sec, LCD looks to reset, I see 1 again... repeat forever.

The code is below, but I must be missing something here?

Thoughts?

/* 
  Sketch generated by the Arduino IoT Cloud Thing "Untitled 2"
  https://create.arduino.cc/cloud/things/884c164a-8299-4333-a1a8-353e052dfc57 

  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  int ctr;

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

#include "thingProperties.h"
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(1500); 

  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  
  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
 */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  lcd.setCursor(0,0);
  lcd.clear();
  ctr++;
  lcd.print(ctr);
  delay(500);
  
  
}


/*
  Since Ctr is READ_WRITE variable, onCtrChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onCtrChange()  {
  // Add your code here to act upon Ctr change
}

are you using the 5V pin to power the LCD and other stuff?
when you upload the code through the IDE locally, you are connected through USB at 5V. When you upload the code from the cloud powered by your 9V adaptor, that would be a difference :

  • 5V: This pin outputs 5V from the board when powered from the USB connector. Note: for it to work, you need to short theor VBUS jumper on the back of the board. If you power the board from the VIN pin, you won’t get any regulated 5V and even if you do the solder bridge.

(from the documentation)

I am using power supply module on 5V jumper to power LCD and Nano. In both cases, I upload code to Nano via USB but then in both cases, am not using USB for power. Literally just upload code from IDE via USB, then remove USB and plug in Nano to breadboard / power supply, works. Upload code via Cloud, then remove USB, plug in Nano to breadboard / power supply, resets.

I do have other IoT / Cloud code working fine with dashboards et al, just something wrong with my LCD setup??

Are you using 5v or 9V

Where is the power source connected?

Do I get correctly that the vey same code with cloud access runs in both cases?

Thank you for your replies.

9V battery on Elegoo power supply module, jumped on 5V pins (not 3.3). As for your code question - the code is 99.9% the same in IDE vs Cloud, only difference being the Cloud-specific and required changes such as #include "thingProperties.h" and declaring the ctr in Cloud > Setup tab versus before Void Setup in IDE. When I upload each version, and use 100% exact same hardware, circuit, everything (literally the same not a duplicate setup on other hardware) only the IDE one runs. Hardware and circuit are the same, Nano unit is the same, only diff is one code base from IDE, one from Cloud. This leads me to believe it is something in code or the Cloud version itself, but no idea what??

Also, I have many other IoT sketches running fine on same hardware (just no LCD) and it all works.

The doc seems to hint that the 5V pin is an output (not sure why it would be driving different behaviors)

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