Setting pins to LOW as arduino starts up?

Hi there,

First off, thank you to everyone who's posting on this forum. Your input has helped me a great deal up to this point. I have now reached an issue which I cannot find an answer to by simply searching, so I decided to jump onboard and ask myself. =]

I am currently putting together a battery operated Luxeon LED array that is controlled via PWM from an Arduino pro mini. So far, things have worked well. I am able to dim the LED by feeding it to my LED driver's 'EN' pin, which effectively 'turns off' the LED when it is fed a LOW signal, varies the brightness according to PWM values, and keeps the LED to full ON if its not grounded or connected to the arduino.

Now the issue that I'm running into is when I turn my switch on to power the whole setup. The Arduino apparently gives the pin a HIGH signal (or some higher voltage), causing the LED to turn on full for a few seconds until the Arduino is done setting itself up and begins running my program. The same effect happens if I press the reset button. I'm wondering if there is a way to prevent this from happening as the Arduino starts up (code commands), or if there is some sort of hardware method (transistors or diodes perhaps) to keep the EN pin grounded/LOW until it is sent PWM signals from the arduino.

Basically, the goal is to have the LED stay off as I turn on the power, and only turn on when the program starts running.

I'd really appreciate you guys' help. =]

Use this in the setup.

analogWrite(ledPin, 0);

Hmm, no luck. I tried using digitalWrite as well but the LED still turns on briefly as I turn on/reset the arduino.

Thanks for the prompt response though. =] Would you happen to have any other ideas?

How about posting your code?

digimike - he said it happens between hitting the reset button and the program starting. Posting code won't make a jot of difference.

Posting a schematic and some datasheet links on the other hand...

What you are seeing is that the Arduino pin is a 'floating input' until your sketch gets to take control of the pin and sets it to output mode. Your driver needs to see a solid zero as soon as power is applied to it if you don't want this behavior. This doesn't happen until after the bootloader has timed out and passed control to your sketch.

So what you need is a simple external pull-down resistor, say 10K ohms wired between the drivers EN pin and it's ground pin. Try that and see if it doesn't fix things up for you.


So what you need is a simple external pull-down resistor, say 10K ohms wired between the drivers EN pin and it’s ground pin. Try that and see if it doesn’t fix things up for you.

Ah that works! Such a simple fix too. I was definitely overthinking this one. =] I’ll definitely keep this ‘floating input’ detail in mind. Thanks for the help!