Proposed hardware troubleshooting FAQ tutorial type thread

This thread will list, in no particular order, common hardware related problems that can cause your project to not work or work intermittently.  It's not claimed as complete because there are many things which can cause failure or less-than-perfect operation.

=====================================================

I added a poll to be able to assess whether this thread is of any real use. Please select one option.

Did this thread help you solve a problem?
  • Yes, I found an answer here
  • No, I still have the problem
  • I didn't have a problem, just looking
0 voters

==========================================================

Other issues I think could be addressed/added:

  1. Vcc between Arduino and peripheral device don’t match
  2. 5-volt logic to/from 3.3-volt logic signals without level shifting
  3. powering Arduino through USB/Vin
  4. External Arduino power supply voltage too high (overheating)
  5. One or more inputs or outputs connected to UNO pins 0 and 1. These are generally reserved for serial link to computer for uploading sketches.

If you've got something fleshed out for one of the above add it to the thread if so inclined.

Suggestions, comments, critiques, additions welcome.
============================================================

edit: I thought it would be good to have an index of sorts, so people don't have to scroll looking for their problem

post #1. I've wired up my breadboard exactly as it should be and checked it multiple times and it still doesn't work right.

post #2. I've wired everything up as instructed but the sketch won't respond to my pushbutton.

post #3. The sketch uploads without error and runs but when the motor / relay / solenoid / LED string turns on the program resets or goes crazy.

post #4. My project works but sometimes I get spurious / garbage inputs from the ( insert digital IC chip name here ).

post #5. I've added a separate adequate power supply for my motor / solenoid / relay but I still get erratic behavior in the Arduino.

post #6. Everything works but sometimes the code doesn't respond to the pushbutton or responds when it's not supposed to.

post #8. Everything is wired correctly and the sketch uploads without error but the motors only run a short time then it all slows down or stops - or processor resets.

/===========================================

Here goes:

I've wired up my breadboard exactly as it should be and checked it multiple times and it still doesn't work right.

Look at your breadboard closely and see two colored lines for positive and negative voltage on either side.

breadboard small.PNG

If your breadboard has broken lines like those in the image you might need to connect them with wires as shown at the bottom of the image. What happens in this case is part of the circuit has no power and therefore can't respond to commands and can't send sensible signals to the controller.

The same idea applies if part of the project uses external components or modules - there must be at least a ground connection between the two devices.

See this thread by Perry Bebbington.

Another wiring related problem can be the common commercially available breadboard jumper wires.  These things can fail.  If your problem is intermittent or consistent unwanted behavior check your jumpers with an ohmmeter.  Clip the meter leads to either end of the jumper.  If you have continuity, good.  Continue the test by bending the jumper wire along its length and flexing the connection to the pin which inserts into the breadboard.  Pull gently on the connections to make sure they're fastened securely internally.

1 Like

I've wired everything up as instructed but the sketch won't respond to my pushbutton.

Sometimes the small tactile switches that come with kits for breadboard use are hard to insert far enough that they contact the breadboard internal contact fingers. If you're using this type of switch make sure it's pressed in sufficient to make contact.

A related issue arises from the physical construction of these small switches. If the sketch isn't responding to the switch it may be because the switch is wired incorrectly.

tactile switch.PNG

The cure for this is to connect to diagonally opposite corners of the switch. Then you're guaranteed to not have a short circuit connection.

1 Like

The sketch uploads without error and runs but when the motor / relay / solenoid / LED string turns on the program resets or goes crazy.

The ATMEGA328P microcontroller, and microcontrollers in general, do not supply the massive amounts of current needed for these types of loads.  They are controllers. The regulator on the Arduino board provides power for the processor and a few light loads like LEDs and a liquid crystal display.  The Arduino output pins have an absolute maximum current rating of 40mA with 20mA being the usual accepted maximum.  In addition, the ATMEGA328P has a maximum current for the entire chip of 200mA.  Inductive loads and things like LED arrays can require tens or hundreds of times that amount. From the datasheet:

If you're driving such loads you need a separate power supply capable of providing the needed current while the Arduino supplies the control signals. The drawing below illustrates this idea.

My project works but sometimes I get spurious / garbage inputs from the ( insert digital IC chip name here ).

Each and every digital IC in your project needs to have at least one .1µF ceramic decoupling capacitor connected between Vcc (the power supply) and circuit ground.


 
See this tutorial on decoupling:

1 Like

I've added a separate adequate power supply for my motor / solenoid / relay but I still get erratic behavior in the Arduino.

These are examples of inductive loads, which, basically, are just coils of wire.  Without getting too sicencey, when you switch off an inductive load you get inductive kickback and this can cause severe, as in component-damaging, problems.

A nice explanation and what to do about it:
https://inductive-kickback.com/2019/04/inductive-kickback-made-simple-to-grasp-easy-to-handle/

1 Like

Everything works but sometimes the code doesn't respond to the pushbutton or responds when it's not supposed to.

The Arduino input pin must see a change from one state to the other only when the button is pressed.  If you have your switch merely connected from the input pin to ground and have used pinMode(3, INPUT) the input will 'float' when the switch is open and any passing electric field, say from your fingers or adjacent wiring, may cause the input to spuriously change state. The same idea applies if the switch is connected to Vcc and the input - when the switch is open noise can be introduced.  The processor is fast enough and sensitive enough to recognize these changes and will act as programmed.

Here's a sampling of pushbutton connection options:


 

In the drawing R1 and R4 provide this positive connection to Vcc or ground.  S3 does have a pullup resistor but it's internal to the processor itself.  You can take advantage of this free resistor by using INPUT_PULLUP in the pinMode statement and connecting the switch as shown for S3.

pinMode(3, INPUT_PULLUP);

For some background here's an excerpt from the ATmage328P datasheet

13.2.6 Unconnected Pins
If some pins are unused, it is recommended to ensure that these pins have a defined level. Even though most of the digital inputs are disabled in the deep sleep modes as described above, floating inputs should be avoided to reduce current consumption in all other modes where the digital inputs are enabled (reset, active mode and idle mode).

The simplest method to ensure a defined level of an unused pin, is to enable the internal pull-up. In this case, the pull-up will be disabled during reset. If low power consumption during reset is important, it is recommended to use an external pull-up or pull-down. Connecting unused pins directly to VCC or GND is not recommended, since this may cause excessive currents if the pin is accidentally configured as an output.

Note, you will still probably need to debounce the switch but that issue is discussed elsewhere on the forum.

It is now in the tutorials section at:-
De-coupling tutorial

Everything is wired correctly and the sketch uploads without error but the motors only run a short time then it all slows down or stops - or processor resets.

Many people unknowingly try to power a project with a 9V PP3 type battery not realizing this type is for very low current draw applications, ie, smoke detectors and multimeters. Refer to the below linked thread for an example of this.

Here's the author's image of the circuit.

image

That's just too much load for that type of battery.

And here's a thread with a link to technical data describing the issue.

Bottom line: forget powering your project with a 9V PP3 battery - use multiple AAA or similar with more current capacity.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.