Wednesday, 18 January 2012

Arduino servos and power burnout...

Wanting to complete my automata-based reading lamp, but having had a lot of servo burnouts, I am trying to prevent the servo getting any power in between position changes. This should greatly reduce the risk of heating.
struggling with the circuit.

If I us digital pin outputs, an output voltage can easily be turned to HIGH (5V) or LOW (0V), but only seems to work with no servos attached. When they are attached the voltage is only 2.5V.

not sure what I'm doing wrong

valPot1 = analogRead(potPin1);            // reads the value of the potentiometer (value between 0 and 1023)
  if ((valPot1 <= midLow)or (valPot1>= midHigh)) {
     digitalWrite (PowerPin,HIGH); //turn on power to servos briefly only at point of writing to allow movement;
     digitalWrite (ledPinJoystick,HIGH);
    // potActive1=true;
    valPot1 = map(valPot1, 150, 900, 0, 179);     // scale it to use it with the servo (value between 0 and 180)
 
    myservo.write(valPot1);                  // sets the servo position according to the scaled value
 
    delay(delay_val);
 digitalWrite (PowerPin,LOW); //turn off power to servos again once moved to reduce heating effect;  
  }
  else {
    digitalWrite (ledPinJoystick,LOW); // signal that value is in mid-range dead-spot - used to turn off LED that indicates joystick activity;
    digitalWrite (PowerPin,LOW); //turn off power to servos when inactive;
  }