I have worked on several Arduino projects that wound up giving up on because my board would start going crazy due to a component in the circuit or the environment (in a car for example). I am bumping into the same issue again with my current project and would like a little guidance on how to navigate these types of issues.
I have been dabbling with filter capacitors and in this case using a LVR to power (isolate?) my Arduino has helped a good bit. What I really don't understand is the appropriate way to determine/measure this noise/interference and then implement a targeted solution. Is this the work of an oscilloscope?
I am primarily trying to understand how to properly identify these types of issues in general, but in this case the project is a device that lets you drive a motor (with an integrated gray code type absolute encoder) to a certain position with a button. I have been prototyping and have the Arduino reading the gray code, but when I power the PWM motor controller off the same 12v supply as I have feeding Vin, the Arduino's reading of the encoder signal jumps all over, even when the motor is not being run.
Any advice on how to track down what type of noise I have and clean it up would be much appreciated. If there are any good books or resources on these aspects of circuit design, those would be very helpful to. I am a mechanical engineer and have very limited knowledge of electronics beyond what I have learned tinkering now and then.
Note this is more of an art than a science, and so much depends on the environment you are in. Also note it is better to cure any interference at source than try and cure any effects the interference is having.
You definitely will need a scope to start and a spectrum analyzer will be needed to determine at what frequency the noise is at. Solving these problems is an art and layout is critical, that is why we ask for pictures and an annotated schematic. The same circuit in a different layout will behave differently. I also recommend tey note any wires over 10"/25 cm as they are great antennas for both transmitting and receiving. It is also best if you have a Shielded Room to perform the tests in.
Thanks to all three of you, I appreciate the tutorial on decoupling, that is very helpful and the kind of information I am generally trying to learn.
To both gil and jim, that makes a lot of sense that you need to see what I am working with. This was a mess of a breadboard prototype and I had initially wired in all of the components that are needed for the final product. When my troubles started I unplugged what wasn't needed so far but left it a mess. To get photos I cleaned up and fully removed everything that was not in use at this stage, my biggest issues seem to have gone away, even after removing both of my novice attempts at cleaning up the power. So I may just have been fighting the consequences of not working cleanly and managing my layout.
I don't have much time to dig deeper tonight, sick kiddos.. thank you all for the insights and help. I will keep working at this, and keeping things very tidy and organized!