Servo with Transistor problem.

Hello,

I have a problem here that I've been all day long trying to figure out, and its driving me crazy!

I want to use a NPN transistor as an On/Off switch for a servo. (why? because i made the servo continuous, and the servo still rotates on the "center angle", tho im experimenting this with a regular servo)

Here is my scheme

The problem is that, the servo doesnt move, it makes a little squeeling noise, but does not rotate to any angle.

I really dont know where the problem can be, how can i make it work?

Thank you,
Greetings.

That's a low-gain transistor.
The value of that base resistor is very high, so the base current is very low.
Consequently the collector current you can expect is marginal at best.
Try something much lower, 200?.

Hi carloskr,

Does it still try to move if you stop sending it pulses? You may be able to use an if statement to create a dead zone around 0 / center that doesn't send anything.

Pat.

Thank you for the reaply Sir.

It does not fully resolve the situation.

I tried with a 680? resistor. The servo started to rotate, but insted of rotating to the angles, it started rotating back and forth like crazy.

Then I used a 220? resistor, the result was the same, just the "crazy" rotation was faster.

It doesn't sound like a transistor problem - it sounds like a code problem. How are you controlling the servo? Can we see the code?

Paste it in a reply, select it, and then select the # icon above to put it in a code block.

Also, follow this thread (going on now):
http://forum.arduino.cc/index.php?topic=173380.msg1287859#msg1287859

(why? because i made the servo continuous, and the servo still rotates on the "center angle", tho im experimenting this with a regular servo)

Use writeMicroseconds position commands for finest control. If needed, the servo can be detached/attached to possibly fix pot drift issues.

// zoomkat 10-14-11 serial servo test
// type servo position 500 to 2500 in serial monitor
// type in number <500 to detach servo
// for IDE 0022 and later
// Powering a servo from the arduino usually DOES NOT WORK.

String readString;
#include <Servo.h> 
Servo myservo;  // create servo object to control a servo 

void setup() {
  Serial.begin(9600);
  myservo.writeMicroseconds(1500); //set initial servo position if desired
  myservo.attach(7);  //the pin for the servo control 
  Serial.println("servo-test-22"); // so I can keep track of what is loaded
}

void loop() {
  while (Serial.available()) {
    char c = Serial.read();  //gets one byte from serial buffer
    readString += c; //makes the string readString
    delay(2);  // allow buffer to fill with next character
    }

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured string 
    int n = readString.toInt();
    
    if (n < 500) {
      myservo.detach(); 
    }
    else {
       myservo.attach(7);
       myservo.writeMicroseconds(n); //convert readString to number for servo
    }
    readString=""; //empty for next input
  } 
}

Hello,

The continuos servo is working fine with the detach();

Thank you all for the help, especially zoomkat for the code.

Greetings