Servo interference with IR

I'm trying to use a servo motor to move a fan on the X axis based on inputs from an IR controller. When hooked up, the IR goes crazy and get's ghost inputs, but only when the servo his hooked up. I'm using a 12vdc power supply through a buck converter (5.1vdc) to run the servo and Arduino board. It has to share the supply. I've hooked the servo to the + output of the buck, and the ground is hooked to the input of the buck. I need find a way to get rid of the noise / ghosts. Servo is running on pin 12 and IR is on pin 2. Thanks.

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project :wink: See About the Installation & Troubleshooting category.

You are not the first to see this. Google "IRremote and servo libraries conflict".

Please post a schematic. Written descriptions are always more ambiguous than a drawing. Hand drawn, photographed and posted is fine. Include all pin names/numbers, components, their part numbers and/or values and power supplies.

1 Like

I will take a SWAG: Try changing the Arduino power input to the 12V and do not have any load on the Arduino 5V. The power supply on the Arduino will help filter noise from the power supply. You an also place some MLCC caps in the 100nF across the power supply to help filter HF noise. Post a schematic, not a frizzy picture, showing all connections including power and ground. Posting links to the technical information on the hardware devices helps, links to azon and similar do not have technical details.


#include <IRLremote.h>
#include <Servo.h>
IRrecv IR(2);
int servoPin=12;
int servoPos=80;
int servoPoxMax=20;
Servo myServo;

void setup() {
Serial.begin(9600);
myServo.attach(servoPin);
//myServo.write (0);
IR.enableIRIn();
}

void loop() {
   //Serial.print ("Servo Position is ");
   //Serial.println (servoPos);
   if (IR.decode()) {
   Serial.println (IR.decodedIRData.decodedRawData);
   if (IR.decodedIRData.decodedRawData == 4127850240){
   // Found Up Button
   if (servoPos <160) {
      servoPos=servoPos+10; 
      }
   Serial.print ("Angling Up from ");Serial.println (servoPos);
   myServo.write(servoPos);
   }
   if (IR.decodedIRData.decodedRawData == 4161273600) {
   // Found Down Button 
   if (servoPos >0){
      myServo.write(servoPos);
      servoPos = servoPos-10;
      }
      Serial.print ("Angling Down from ");Serial.println (servoPos); 
   }
   delay (1500); 
   IR.resume();
    
  }
}

I don't know anything about buck converters; except that they convert :wink:

Is the negative input of the buck converter internally connected to the negative output of the buck converter?

What happens if you connect the negative of the servo to the negative of the buck connverter's output?

Same. I'm only using the Buck as to have only 1 power source. I could have used a 9 or 12, doesn't matter.

I know. But the fixes didn't work.

Fun fact, I switched to a much better all metal geared servo and NO NOISE! Fully operational.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.