How to switch my arduino from 3v to 5v ?

My arduino duemenilove seems to be stuck at 3v, servos only seem to work when connected to the 3v pin, is there anyway to change it to 5v?

Firstly, NEVER try to run a servo/motor/solenoid, etc. directly from the Arduino. Not only because they’re inductors (and could destroy the Arduino), but because they can easily draw to much current and fry the Arduino.

Try testing the 5V pin with a DMM, it’s possible you “fried” it… :o

servos only seem to work when connected to the 3v pin

The 3V output pin on the arduino can only supply a maximum of 50mA so it is limited as to what you can use it for. Defiantly not for a servo.

It is possible that you have blown the servo if you connected it to 3V and fed it 5V input pulses, but then maybe the servo has some sort of input protection.

NEVER try to run a servo/motor/solenoid, etc. directly from the Arduino

Good adivce for motors and solenoids, but there should be no problem connecting servos to arduino. Powering a servo on the 5v line should not damage to an Arduino although there may be insufficient power to drive the servo. The Arduino digital pin is driving the servo logic only and only a very small current ( a few ma) is required.

hi,
The servo is a spektrum s75, its rated at 4.8v, it seems to work fine, i first tried it at 5v it just jittered slowly, i then tried the 3v3 pin & it worked perfectly

I also tried powering it from the ac/dc adaptor, disconnecting the usb cable first, & still got the same problem

Is there anyway to force it to use 5v instead of 3v? or is my arduino not just working properly?

Or is it definitely a power issue?
I’m connecting it to the PWM 9 pin

I’ve also tested several other different brands of servos, a helipro hps001 & they all have the same problem, they just jitter back & forth at 5v but work fine at 3v

I’m using the source code from ladyada’s site

#include <ServoTimer1.h> ServoTimer1 servo1; ServoTimer1 servo2; void setup() { Serial.begin(9600); // set up Serial library at 9600 bps 
Serial.println("Servo test!"); 
servo1.attach(10); 
servo2.attach(9);
 } void loop() { Serial.print("tick"); 
servo1.write(180); 
servo2.write(0); 
delay(1000); 
Serial.print("tock");
 servo1.write(0); 
servo2.write(180);
 delay(1000); 
}

Many servos need a narrower range of pulses than you are sending.
See if it works on 5v by changing your sketch to write 20 and 160 instead of 0 and 180.

Also, ServoTimer1 is very old code, any reason you are not using the servo library distributed with arduino. I doubt that is causing your problem but why not use the latest code.

hi, ill try the 20 & 160

I just followed ladyada’s tutorial & installed the .h library

at
http://www.ladyada.net/make/mshield/use.html

I tried using ladyada’s code without installing the library she suggested on her site, but i just got a lot of errors

I’ll try the sketchbook examples again just to be on the safe side, thnx

You can ignore these first two, as they were mentioned above… (who needs to read through posts?:D)

You should NEVER use the (it’s actually a 3.3v, not 3v) pin! The pin can only provide 50ma MAX. That’s barely enough to run two LEDs, assuming they’re at full brightness.

Generally, servos take about 50-100ma when they don’t have a load… and with a load can go up from 600ma to 1000ma. And obviously, that is WAY too much for the pin to handle.

Basically, if you keep taking more power than the pin can offer, since the 3.3v is coming from the FTDI chip, there’s a possibility of frying that. (then you wouldn’t be able to upload sketches without another board)

Take a gander through here, maybe the schematics will offer some help, they’ll reduce servo-jitter. (or drifting) Which both can result from noise on the power supply.

Also, if the Servo is rated for 4.5v max, running it at 4.87v (about what you get when using the USB power) can shorten the life of your servos. (and possible cause it to just… not work, and be stubborn.)

which tutorial?

You may want to ask on that site why the distributed servo library isn’t used.

Also, if the Servo is rated for 4.5v max…

Servos like the Spektrum S75 are designed for a nominal 4.8 volts (the nominal voltage from four 1.2v NiCad or NiMH batteries). These servos should be capable of handling the fully charged battery voltage, which can be 5.5 volts or more.

The torque and speed performance is specified at the nominal voltage but this is not the rating for maximum voltage the servo can handle

Running the S75 on 5 volts should not be a problem.

Good adivce for motors and solenoids, but there should be no problem connecting servos to arduino. Powering a servo on the 5v line should not damage to an Arduino although there may be insufficient power to drive the servo. The Arduino digital pin is driving the servo logic only and only a very small current ( a few ma) is required.

What mem says is true of the logic line (white wire or orange wire usually). It does not draw much power. This assumes that the servo is getting its power on the other two wires directly from the battery.

When I read “never run a servo from an Arduino” I agree-- the power for a servo (red/black or red/brown) should not be sourced from any Arduino pin. It might work on a bench when there is no torque resisting the servo’s movement, but blow out unexpectedly in your project later. Servos draw a LOT of current when they must overcome physical resistance to achieve their position. That includes lifting weight, pushing or pulling on linked hardware, etc. Many servos have no safety, where they will stop trying in the face of too much resistance. They will draw and draw until they burn themselves out, or burn out whatever is supplying their power.

Since most hobby servos have a nice three-pins-in-a-row connector, it’s convenient to think you can connect them to three Arduino pins and offer LOW, HIGH, SERVOOUT outputs on them to test out features. Doing it that way is flirting with disaster.

hen I read “never run a servo from an Arduino” I agree-- the power for a servo (red/black or red/brown) should not be sourced from any Arduino pin.

Yes, that’s what I meant when I first posted that :).

Just to be clear, I was referring to powering the servo from the 5v power line. It may be necessary for some servos to have an external power supply, but the Arduino board would not be damaged by connecting a servo power lead to the 5v line. The 5v power line is the one marked 5V power, it is not a digital or analog pin.

ATmega328 digital outs can only supply ~40~50mA. But the Arduino is not just an ATmega328 chip. None of the Duemilanove board is really rated to support motors well, and servos are motors.

The MC33269D-5.0 regulator used on the Duemilanove has a rated 800mA limit if using an extreme voltage shift (15V), perhaps a bit higher if you’re using 9V as your source. This regulator provides power TO the mentioned 5V port if the power is provided through the power jack or USB port. The regulator will still fail sometime.

If you are powering your Duemilanove board from USB, the USB 2.0 host hardware itself may limit itself to 500mA before tripping a protective fuse. Some hosts may require a reboot to reset this fuse. That means running from VIN isn’t a good idea if using USB as a power source.

I couldn’t find stall current information on the E-Flight / Spektrum S75. It’s a micro-servo for light duty which probably strips out before it reaches 500mA, but that’s no guarantee of a safe “runs from Arduino” condition. There are many other hobby servos which can happily devour multiple amps if given even a moderate load.

mem, I totally respect that you have run all sorts of these projects safely without harm, I’ve learned a lot about servos from your code in fact. But that’s not the same thing as engineering according to the stated datasheet limits on the components.

In short, it’s my advice that one should not power servos from any part of the Arduino hardware. Control, yes. “Run” or power, no.

Halley;

I agree with your conclusion that one really should not use any power source coming from an Arduino board to power a servo. Not so much from a damage or safety point, but rather servos have motors and motors draw current depending on the mechanical load they see. Usb power and the on-board +5vdc regulator are just not up to the job of supplying the current that servos can require at times. Servo(s) are just going to operate better if powered from an external +5vdc supply, rated at well over an amp per servo.

One statement you made is a little misleading “That means running from VIN isn’t a good idea if using USB as a power source.”

If you are using external power plugged into an Arduino, then there is voltage on the Vin pin and the USB power is switched off to the board. If you are using USB power and not external power, then there is no voltage available on the Vin pin.
So not only is it “running from VIN isn’t a good idea”, it’s not possible as there would be no power available there.

Lefty

lefty, thanks for correcting me on the usb/jack/regulator connections.

I think a number of people happily running projects using a hobby servo powered from the 5v pin may be wondering if they need to rewire their servo.
I really don’t think that is necessary.

I agree with Lefty that the issue does not relate to damage or safety. I believe it’s a question of whether there is sufficient power available to drive your servo.

I remain of the view that although its best to use an external power source to power servos, if your servo works on the Arduino 5v line then you do not need to worry.

I remain of the view that although its best to use an external power source to power servos, if your servo works on the Arduino 5v line then you do not need to worry.

Yes, I don’t disagree with that statement at all.

However we do field questions here a lot of problems with boards resetting and other weird symptoms when using servos that usually trace back to trying to power servo(s) from the Arduino’s +5vdc pin. If it works then fine, but it’s bound to cause difficulties for many who are still just trying to learn the basics of using an Arduino with servos.

Lefty

the issue does not relate to damage or safety

This is a great conversation and I know I’m taking it to the limit. I am sorry if I sound over-zealous, but in some applications, “a servo might not work” is indeed an issue of damage and safety. That’s my point about engineering limits.

If your security camera unexpectedly stops panning, or your Halloween skeleton jaw stops waggling, you just drag it all back into the basement to tinker on it some more.

A model airplane or helicopter may work perfectly on the bench, but not when faced with higher torque under aerodynamic loads, due to limited power available. An airframe with marginal control is dangerous to property, bystanders and the pilot.

Most problems people have with servos are due to power – although top of the list is forgetting to connect the grounds when using external power.

Advising people to power their servos adequately is good advice, as is suggesting the use of an external power source. But I see no technical or practical basis for saying that a servo should never be powered from the 5v rail.