This is my first attempt at an Arduino-controlled robot and I'm still on the lower foothills of the learning curve when it comes to electronics, so please be gentle
My robot currently has a servo (Modelcraft RS-2) used to turn a 'head' holding a couple of sensors (those sensors aren't important - they're working fine).
I also have an IR sensor switch from DFRobot (
http://www.dfrobot.com/index.php?route=product/product&path=36&product_id=114) which works fine by itself (using it via an interrupt on the Arduino). The problem is that whenever the servo operates, it triggers the IR sensor. I suspect the servo is causing enough of a power drain to cause the sensor connection to go low.
The problem arises when I use a 9V battery or USB to power the Arduino (motors are powered separately) but disappears when I use a more powerful LiPo cell, which is why I'm thinking it's a power drain problem.
I'm using a pull-up resistor (10K) on the sensor and a decoupling capacitor (2.2uF) across the servo. Doesn't seem to help. I'm thinking 'diode' but am too rapidly running out of talent.
Any pointers? I'm happy to experiment but benefit from being nudged in the right direction.