Go Down

Topic: Digital pins power jolt at bootup issue (Read 330 times) previous topic - next topic

fxmech

I posted this in another section of the forum thinking it was a servo specific issue, but I just discovered it is with the arduino itself.
When the arduino boots up( receives power) it sends some kind of spike out of the digital pins.

I am using the servo library with a servos signal wire attached to digital pin 8.
When I plug in power the servo spins CCW a few degrees even with a completely blank sketch

void setup()
{
}
void loop()
{
}

is there a way to get around this???  My problem is that the servo cant move outside of specific limits without causing damage to the mechanism.
The initial jolt I mentioned above happens even before the setup() function so it can potentially go out of bounds upon powerup...

Any ideas why this happens or how to avoid it???

CrossRoads

On a reset, the pins revert to inputs until your sketch starts and makes them outputs and sets their level.
You can add external pullup or pulldown resistors to keep them in the off-state until that  happens.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

fxmech

#2
Jan 16, 2013, 10:56 pm Last Edit: Jan 16, 2013, 10:59 pm by fxmech Reason: 1
I just realized that the problem is not in the arduino but in the servo itself so it will jump when power is applied even if the signal wire is not connected.
The issue would go away if the arduino was running already when the servo got power because the jump would still be there but the arduino would correct it before it moved too far off course....

Is there any way of disabling the 5Vout pin temporarily during boot up from within the actual arduino software...  I don't know if the 5V pin is wired through the regulator straight to Vin or if it is switchable in some way...  If I could delay it until the arduino was ready to go, it would solve this on other similar issues Ive had in the past

I guess it could work by adding a relay type circuit that will keep the 5v line to the servo cut until it gets a signal from one of the digital pins....
Id rather solve it on the software end since I do a lot of this type of work and the alternative would bean adding the additional circuitry every time I do this...

CrossRoads

5V is not switchable on board, you'd need an external P-channel MOSFET for that.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up