There is nothing more frustrating than spending many hours on a circuit and when you power it up......it doesn't work. After de-bugging more than three thousand circuits, I have come up with a check list of the most common problems with experimental circuits.
This is the order in which I most often try to debug a circuit:
1. Bad Connection Or No Connection
A-You left out a wire or connection. It is easy to leave out a connection. Double check all connections, and then triple check.
B-There is a short. After soldering a circuit, I use a magnifying glass to check for solder joints or frayed wire ends that could be shorting.
I once glued up a circuit with conductive glue
(pic 2) and checked the circuit a dozen times and it still wouldn't work. So I finally pulled out an ohmmeter and checked for shorts. It turned out a thin smear of black conductive glue was shorting out one of the program pins to ground. The black glue on the black Picaxe IC was all but invisible.
A bad solder joint can occur, but it is rare. Impatience--not heating up the joint enough as you solder, can create a high resistance connection. Make sure your solder joints end up clean and shiny. Unless it is a power connection, the additional resistance will usually not be a problem.
2. Wrong Connection
You are usually looking at the top of the circuit board and soldering the bottom of the circuit board using a top view schematic. It is easy to get visually turned around. When there is a wrong connection, this can require a new visualization of the situation. To avoid the same perceptual errors, I often turn the schematic and the circuit board upside down from the way I was looking at it and then check again to see that all the connections are valid. Perceiving from a different point of view can reveal flaws.
3. Noise In The Circuit Or Near It
A-Avoid running inputs next to outputs. Pulsating outputs such as PWM can transfer through induction to inputs and create an erratic circuit. Amplifiers and micro controllers are especially sensitive.
A really long input wire can act as an antenna and pick up noise. In that case you can use a grounded, shielded cable.
When I was working on the sparky robot (pic 3), I got the circuit working well when it was separate from the main body. As soon as I mounted it with the body, it started to work totally inconsistently. It turned out the varying magnetic field from the motors was occasionally resetting the micro controller. I tried a grounded metal plate above the motors, but it had no effect. I ended raising the micro controller an inch away so that it was unaffected by the noise from the motors.
Working on the ant robot
(Pic 4), I connected an infrared detector to the micro controller and it worked perfectly on the breadboard. Once I connected it on the ant robot with everything on board, it went crazy. It turned out the sharp infrared detector was creating noise that incapacitated the Picaxe micro controller. A 20 uf decoupling capacitor across the power line, near the infrared detector, solved the problem.
B-When you can, it is a good idea to have two power supplies that share a common ground. One for the control circuit and another one for the motors, servos, or other noisy loads. When I built the cubic inch robot
(pic 5 ) I was able to run everything off one battery in a very tightly wired circuit, but I was lucky to get a way with it.
C- With logic circuits and micro controllers, leaving a floating input can render your circuit useless. Inputs should be grounded or connected to V+ through a 4.7 to 10K ohm resistor. Otherwise the input can act as an antenna and pick up spurious signals from house hold AC or other sources.
4. Bad Power Supply
Make sure your power supply is providing power to the right places and is not being over strained. If the power supply is inadequate to the task, it can drop in voltage and reset micro controllers or make other components erratic. Batteries, under no load, can be measured and have the proper voltage, but when connected to the circuit, the voltage can drop enough to make the circuit useless. Measure battery voltage under the actual circuit load.
A badly filtered power supply can also create noise and cause problems with sensitive circuits. A large value capacitor 20- 200 uf near the power supply can reduce the voltage ripple.
If the circuit is on and a transistor, resistor, or IC is too hot to touch and you cannot keep your finger on it for several seconds, something is wrong. Such components can normally operate somewhat warm--but not hot. You need a higher wattage resistor or you are overloading your transistor or IC with too much current.
6. Wrong Design Assumptions
With experimental circuits we make a lot of assumptions. Sometime we can get away with it sometimes not.
I have often underestimated the current that small servos and motors require resulting in power supplies overheating or shutting down.
If size is not an issue, allow more room than you think you need to fit the main components. Packing too tight can make soldering difficult and slow and increase the chance of noise problems between components. Pic 1 was hard to solder because I was trying to fit a remote control on a ring.
It is tempting to design as if the circuit is going to work first time every time. That is rarely the case. A better way is to design with the assumption you will have to debug. Design in connection points such as pins, sockets, or temporary wires that give you access to measure current and voltage on the actual circuit.
7. Bad Components
With today's high quality mass produced electronic components, new components that don't work are extremely rare. However it is fairly easy to overheat a component while soldering and damage it. Transistors, diodes, ICs, and to a lesser degree, resistors and capacitors are susceptible to overheating while soldering.
I once connected a three way AC circuit for a house light. It consistently tripped the breaker and after an hour of checking and double checking and triple checking the connections, I had no clue. Eventually, I pulled out the meter and determined that the brand new three way switch had an internal short.
Circuits, like life, don't always turn out the way we expected. The ability to see clearly where we went wrong and correct for it, is an art form that requires patience and honesty.
Here's a few other tips and tricks that some might find useful:
Advanced soldering: http://www.instructables.com/id/Advanced-Soldering-Fast-and-Easy-Soldering-of-Sur/
Making fast printed circuit boards: http://www.instructables.com/id/Picaxe-Projects-1-Making-Fast-Printed-Circuit-Mo/
Making curved circuit boards: http://www.instructables.com/id/Curved-Circuit-Art-Make-A-Double-Helix-LED-Lanter/
Make conductive rubber: http://www.instructables.com/id/Conductive-Rubber-Make-Touch-Sensitive-Robot-Skin/
Etching conductive fabric circuits: http://www.instructables.com/id/Conductive-Fabric-Make-Flexible-Circuits-Using-An/