Output pins at startup

17 Aug 2013

Hello everyone,

I face a problem, I need your lights... My mbed engages different 12V relays. For this, I use my digital outputs that control transistors. When the output is zero, the relay is not activated. Ok.

The problem occurs at startup (when the card is powered). It seems that the pins are not 0 when the card is powered (but before the program actually starts). Suddenly, the relay will operate briefly and then go off when the program runs. And normally, it should not engage at startup.

Do you understand my problem? Is there a way to get the pins to 0 by default at startup?

I have not encountered this problem before...

Thank you, Simon

17 Aug 2013

The mbed pins are configured as inputs when the device first boots so the inputs to your transistors are actually floating at this point. You could add a pull down resistor between the base of your transistor and ground to keep it pulled low unless you actively apply a high voltage to the pin. I would think that 1k ohms would work.

I hope that helps,

Adam

17 Aug 2013

Almost, the default state of the pins is pull-up, this is how the device is designed, software can't change it. However the default pull-up resistors are fairly large, if you add an external pull-down on the low-end of what Adam recommends I expect it to go fine.

18 Aug 2013

Thanks for your help! A 1k resistor effectively solve the problem, it's perfect.