Pages: [1]   Go Down
Author Topic: Digital pins power jolt at bootup issue  (Read 321 times)
0 Members and 1 Guest are viewing this topic.
Los Angeles
Offline Offline
Full Member
***
Karma: 1
Posts: 148
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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???
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Los Angeles
Offline Offline
Full Member
***
Karma: 1
Posts: 148
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
« Last Edit: January 16, 2013, 04:59:58 pm by fxmech » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

5V is not switchable on board, you'd need an external P-channel MOSFET for that.
Logged

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.

Pages: [1]   Go Up
Jump to: