Possible Servo Issues

Hi,
This is a question about servos but if anybody should have any relevant comments that aren't related to servos, I would be interested.

System Outline
Very briefly, I have an Uno board that uses sensors to track the movement of an object. These are very basic reed switches which are connected to GND and an analog pin set to digital pull-up mode (active low) - there are 5 of these.
There are also 2 servos (both SG-90) set to move at certain triggers about 90 degrees with a very small load. At no point should both of these move together - the operation is correct in this sense.
There is also an additional motor which is driven by an external power source. When this motor is driven is controlled from the Uno using a relay to set the power source as ON or OFF - just a simple switch.

The Problem
The incorrect behaviour is that sometimes these sensors appear to just be triggering as and when they want to. Obviously I have checked the power on both sides of the switches and at the point I measure them the voltages are correct for all switches (V=0 on 1 side and V->5 on the other side). I have also checked for shorts but found none.

I recently found that the servos are both being driven from the 5V pin rather than an external power source. I thought I had changed this and will probably do so anyway because I am aware that running servos from an arduino can cause problems.
Being unaware of what any specific issues might be, I just want to ask if running Servos off the 5V pin could cause incorrect behaviour from the delay function or incorrect reading of digital inputs?

Thanks in advance

P.S. I haven't included code, sketches or schematics because I don't think it is relevant to the questions, however, I can add these if necessary.
Also, it isn't a constant problem. At times, like as I write this, the system works perfectly, however, the issues still exist.

Never power a servo from the 5v pin on an Arduino.

Do you have input pull-ups (we can’t see) ?


Always:
Show us a good schematic of your circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components. Posting images:
https://forum.arduino.cc/index.php?topic=519037.0

Always:
Use CTRL T to format your code.
Attach your ‘complete’ sketch between code tags
[code]Paste your sketch here[/code]

I think it's always a good idea to give as much info as possible, one the times where more is more :wink: so it may be worth your while posting code and schematics.

Stella123:
System Outline
Very briefly, I have an Uno board that uses sensors to track the movement of an object. These are very basic reed switches which are connected to GND and an analog pin set to digital pull-up mode (active low) - there are 5 of these.
There are also 2 servos (both SG-90) set to move at certain triggers about 90 degrees with a very small load. At no point should both of these move together - the operation is correct in this sense.

It will be a great deal easier for people to visualise your project and offer useful advice if you tell us what the project is rather than just describing some of the components.

If I said it had a wheel and a dial with a needle that rotates I doubt if you would imagine that I was referring to a car.

...R

Stella123:
P.S. I haven't included code, sketches or schematics because I don't think it is relevant to the questions, however, I can add these if necessary.

Code and circuit are always relevant, its the crucial details that make all the difference between
wild guessing and informed advice.