7

Pin 13 fires relay when powering on... How to disable? I'm using pro mini 5v 16MHz and a DC 12V 2 Channel Relay Module Optocoupler. The relay Jd-VCC is powered by a 12V and it's VCC is 5V (the same as Arduino VCC). The relay is active low and I soldered pins 12 and 13 of the pro mini to IN1 and IN2 of the relay.

When I power the board up it cycles Pin 13(and the on-board LED) ON and then OFF before resuming to the code I uploaded. I believe that this can be fixed by disabling this blinking function in the startup process.

I understand that I can use other pins. Why not learn how to remove this from startup, if I prefer to use this pin for circuit layout purposes?

Any help would be much appreciated. Most of my searches ended up with people using the pin as an input... My issue is when using D13 as an active low pin it has some funky behavior at startup but then works as programmed.

Thanks!!!

1
  • Tehee, imagined your TV going on and off every time you would reboot/program your Arduino xD. But Majenko has some good solutions I see.
    – Paul
    Mar 23, 2016 at 13:41

1 Answer 1

11

There are three things you can do:

  1. Remove the bootloader entirely and program the board with a hardware programmer (USB-ASP, Another Arduino, etc).
  2. Edit the bootloader source, recompile, and reinstall it to the board using a hardware programmer (as in option 1).
  3. Just don't use pin 13 for the relay.

Of the three options the third one is by far the simplest.

6
  • :( no fun... I just moved my pins down to D11 and D12. I was hoping it was a simple as commenting some code out in the bootloader.
    – P-nut
    Mar 23, 2016 at 15:31
  • 3
    One step is as simple as commenting some code out in the bootloader. The rest of the steps involve compiling that bootloader and installing it. All can be done, but is it really worth the effort when you can just choose different pins?
    – Majenko
    Mar 23, 2016 at 15:32
  • There is a define in the bootloader: LED_START_FLASHES - you could set that to zero, and recompile. But then you need extra hardware to upload it. Plus, compiling the bootloader is not something the IDE is set up to do.
    – Nick Gammon
    Mar 23, 2016 at 20:17
  • @NickGammon: Way back in the day I saw a youtube video of someone programming the bootloader by putting switches/resistors on the SPI pins, and toggling it in by hand. I've gone looking for that video again, but can't find it :( Mar 24, 2016 at 2:40
  • That would take a long time. Mind you, I had to key my first assembler into my Motorolo 6800 by typing it in in hex. After that, I could use that version to assemble the next one.
    – Nick Gammon
    Mar 24, 2016 at 4:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.