Common Mistakes while using Arduino

Common-Mistakes-while-using-Arduino

Beginning with the Arduino as a beginner can be difficult for those without any electronic experience. You will run into issues, some of which may have easy fixes but may take you days to figure out. Therefore, I have compiled the following typical Arduino problems along with potential fixes to make things a little bit simpler.

  1. Arduino Board not Recognized
  2. Board not in Sync
  3. Invalid Device Signature Error
  4. Serial Port Already in Use
  5. Unsatisfied Link Error
  6. java.lang.StackOverflowError

1. Arduino Board not Recognized

This refers to a situation where an Arduino board, connected to a computer is not recognized by the computer. When this happens, the board is usually not listed under the port lists of the Arduino IDE and is sometimes labeled USB2.0 under the device manager.

Arduino Board not Recognized

Solution

This happens when you use certain cheap Arduino clones which use the CH340g USB to Serial converter chip instead of the FTDI (FT232RL) and others used by the standard Arduino boards. The drivers for USB to Serial Chips used by the Standard Arduino boards are always packaged along with the Arduino IDE Setup file, so when you install the IDE, the drivers are automatically installed on your PC. To be able to use this CH340g USB to Serial converter based Arduino boards, you will have to download and install the driver for the chip. Installing it is as simple as clicking the install button on the setup interface shown below.

Solution-for-Arduino-Error-Board-not-Recognized

With this done, you should now be able to locate the port to which the board is connected on the Arduino IDE.

2. Board not in Sync

Usually, when this happens, You will not be able to upload code (Although the IDE at times will display “done uploading”) to the Arduino board and the IDE will display the error code; “avrdude: stk500_getsync(): not in sync: resp=0x00”.

Solution

The sync: resp = 0x00 is a generic response that translates to the “Atmega chip is not working” on the Arduino. When this happens, there is a whole bunch of things that could be wrong. Here are some steps that could be taken to clear this error.

  1. Ensure there is nothing connected to digital pins 0 and 1 on the Arduino (including shields and modules like bluetooth).

  2. Ensure the correct com port and board were selected under the tools menu.

  3. Press the reset button on the Arduino couple of times and re-upload the code.

  4. Disconnect and reconnect the Arduino to the PC.

  5. Restart the Arduino IDE.

If any of this does not work, it might be time to try using a different Arduino board with the PC or using the “faulty” Arduino board with another PC. This should help you identify which of them is the origin of the problem. If you discover the problem is with the PC, reinstall the Arduino IDE. However, if the “faulty” Arduino board is the problem source, an ultimate solution will be to flash the board with the Arduino firmware. If none of the above works, it might be time for you to change the Arduino Board.

3. Invalid Device Signature Error

Invalid-Device-Signature-Arduino-Error

This error is displayed when an attempt is made to upload code, to a board, different from the one selected under the tools>board list on the Arduino IDE. This error usually occurs as a result of the device signature on the target board is different from that of the board selected on the IDE.

Solution

The solution to this error is as simple as ensuring the correct board is selected on the Arduino IDE. If this does not work, there might be a need to flash the microcontroller with the latest version of the Arduino bootloader.

4. Serial Port Already in Use

Arduino-Error-Serial-Port-Already-in-Use

This is probably one of the easiest errors to resolve. It usually occurs when you try to upload code to an Arduino while the serial monitor is opened (this is no longer an issue if using recent IDE versions) or when you try to launch the serial monitor when the Arduino is talking to another software or device via the serial port. Essentially, it occurs when you try to use the Arduino serial port for two different things at the same time.

Solution

Just like the IDE suggested, close every other software/tool (including the serial monitor/plotter) that may be using the com port. If you are not sure of the particular software, unplug the Arduino. It should be ready to go by the time you plug it back.

5. Unsatisfied Link Error

This is probably the only rare error that made it onto this list. This occurs when you have an old version of the communication library lying around on your PC, most likely from a previous install.

Solution

To solve this error, search for comm.jar or jcl.jar in /System/Library/Frameworks/JavaVM.framework/ or in directories on your PC’s CLASSPATH or PATH environment variables.

6. java.lang.StackOverflowError

When processing the sketch, the Arduino uses some regular expressions for processing and sometimes gets confused when it encounters certain strings related errors like missing quotes.

Solution

This error is solved by taking a second look at the code, especially the parts where string sequences are used. Ensure the quotes are complete, backslashes are rightly used etc.

There is a limit to the number of errors that one can fit into a single tutorial and for that reason, we will stop here. However, this list contains some of the most common errors beginners face when using the Arduino. Are you battling a particular error, feel free to drop a comment, hopefully, we can work through it together.