i used a online arduino design to create what i had created on the actual board i was having some issues with the photo resistor and the servo. the servo is twitchy so i was wondering if there was interference problems. what i am trying to do is make sound turn on a light that makes a photo resistor react to the light making the servo move but that is not working. we took out the photo resistor and it worked but the servo is twitchy so it wont work for what we are trying to do .we tried just having the music turn the servo but had to many problem and we got the light to reacted to the sound but the resistor doesn’t detect the light to turn the servo. if anyone could help that would be great
That is a general description of what you want to happen, but does not have any details about how you are implementing it, or what the environment you are using it in is like, so it is not possible to make suggestions about what to change to make it work better.
For environment, how much light exists before the sound turns the light on? A light added in a dark room is much easier to detect than in are room that is already bright.
The servo twitching is a common problem (not related to ‘interference’) because the position sensor in the servo is not 100% stable/accurate, causing the servo electronics to ‘hunt’ back and forth trying to keep the position matched to where the control signal says is should be. That (often) tends to be more pronounced at some angles than others. Having the code adjust the position slight can sometimes stabilize the system.
I would suggest breaking your problems up. Assuming the servo is the last link in the chain, start with that. Change the code to drive only the servo, possibly via a value entered via the serial port, and use different position values to see how the servo reacts. If there is a mechanical load on the servo, initially remove it to see if the load is part of the problem (if the servo isn’t strong enough, it may be!) See if you can make a mechanical change so that it takes a larger movement of the servo to do whatever it is you want to do (that will reduce the effect of hunting which is causing the twitching!) It it works with no load on the servo but doesn’t when the load is added back in , then you may need a more powerful servo or something like a gear train to increase torque to the load. Once the servo does what you want, then move back one step to the photo resistor and work on that (probably replacing the servo with a led that lights when the photo resistor triggers and get that working reliably. Then attach it to the servo and make sure the pair of them do what you need.