Arduino Nano @ delay signal

Hello,

I use the arduino Nano.

I'm trying to create a delay signal (~1.2sec) after turning power ON.

Pin "D2" reading power ON, with a resistor 20K to GND and 1K to +5V
Pin "D13": output for delay signal
But I get an oscillation on signal output ?!

Could anyone please explain this issue ?

Here is my code:

// Set pin numbers:
const int powerOn = 'D2';     // at pin #2, adding a resistor 1K pull up and a resistor 20K to GND !!! ***
const int BLM_RESET = 'D13';  

// variables will change:
int poweronState = 0;      // variable to read the status of power

void setup() {
  // initialize the powerOn pin as an input:
  pinMode(powerOn, INPUT);  

  // initialize delai_1.2 s as an output:
  pinMode(BLM_RESET, OUTPUT);

  // read the state of the poweronState value:
  poweronState = digitalRead(powerOn);
}
  
void loop() {
   // check if the power is ON. If it is, the pin #2 is HIGH:
  if (poweronState == HIGH) {  // power is ON
    delay(1200); // waiting for 1200 ms (1.2s) before BLM_RESET is actived HIGH
    digitalWrite(BLM_RESET, HIGH);
    }

  else { 
    // if power is OFF, turn BLM_RESET off:
    digitalWrite(BLM_RESET, LOW);
    // delay(20);
    } 
}

You're not using a Nano 33 IoT so your topic has been moved to a more suitable location on the forum.


Where do you get the below from?

That should just be 2 and 13, no D and no ticks around them.

the


signal

Thanks for replying. Note.

You are using pin 13.
I think your problem is that the bootloader flashes the pin13 LED just after power up (or reset).

Try using any other pin for your delay signal.

1 Like

Hi all,

I found the problem: I use the USB cable (or +5V on board, pin 27) to power pin D2.
After using the power extern, I don't see the oscillation on the delay signal.

Thanks for your support !

Hi, I see the same behave on other pin. Your idea is closed to this issue.
Thanks for replying.

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