Only works on serial monitor

Hello everyone. I recently made a project to turn on and off the light and fan in my room using edge impulse studio. The hardware I used is Arduino nano 33 ble sense board. I created the project in edge impulse and downloaded the arduino library so that I can add few lines of code to control the relays. I flashed the microphone continues code to my board. To my surprise the code only runs when the serial monitor is open. If I give supply to the board through a powerbank or any other sources, it is not classifying the audio. What to do when I want my project to run standalone?(i.e., without connecting the board with my laptop).

Hello @abishekr007,

Can you add maybe a debug flag to avoid instantiate the Serial.begin and all the serial print?



Am having the same problem on the same hardware also using a keyword spotting model,
@abishekr007 did you find a working solution.


In your code, do you have something similar as if(Serial):

void setup() {
  //Initialize serial and wait for the port to open:
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB

void loop() {
  //proceed normally

If so, put the code:

  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB

in the comments.


@Joeri thank you, it worked i can’t believe i was stuck all weekend because of this.