This is caused by a generic connection error between your computer and the Arduino, and can result from many different specific problems.
Here are some easy things that can often fix this error:
- Disconnect and reconnect the USB cable.
- Use a different USB cable.
- Press the reset button on the board.
- Restart the Arduino IDE.
- Make sure you select the right board in
Tools ► Board ►, e.g. If you are using the Duemilanove 328, select that instead of Duemilanove 128. The board should say what version it is on the microchip. - Make sure you selected the right port in
Tools ► Serial Port ►. One way to figure out which port it is on is by following these steps:
- Disconnect the USB cable.
- Go to
Tools ► Serial Port ►and see which ports are listed (e.g. COM4 COM5 COM14). - Reconnect the USB cable.
- Go back to
Tools ► Serial Port ►, and see which port appeared that wasn't there before.
- In extreme cases, you may need to burn the bootloader.
- Make sure digital pins 0 and 1 do not have any parts connected, including any shields.
If none of those work, you will want to try to isolate the issue by replacing things: try a different computer on the same arduino, try a different arduino on the same computer, and try using a different USB cable.
If the issue is with the computer:
- Double-check all computer-related issues in the "easy fixes" list above.
- Reinstall the IDE.
- Reinstall the drivers.
If the issue is with the Arduino:
- Double-check all board-related issues in the "easy fixes" list above.
- Make sure the microcontroller is seated correctly.
- You may need to burn the bootloader.
- Replace the microcontroller if you have another one handy nearby.
- You may have bricked your Arduino. Sorry :(