By Leff
#8624
Many people would encounter some problems along their Arduino journey, here is some good-to-know tips based on my own experience (On Windows only, but most of them can be applied to other platform), not that long but some are what I think worthy of sharing. May it helps.

The title would be named as reason, phenomenon, or even solution. I would feel very grateful if you could point me out my mistake or share more about your precious experiences! ;) (This post is blocked, but any suggestion/experience to share are welcomed to post on this index and attch a related link. And I will update them here. Thanks in advance.)

Common Arduino Operation Notes

There are several very very basic notes related to Arduino/ Electrical operation to avoid destroying your boards, sensors or any other components.

  1. To avoid getting Arduino board bootloader lost, i.e. your Arduino card can not be recognized anymore by your computer :!: If got defective, clike here to fix by urself?

    1. Do not run your project (Arduino) with an insufficient power supply! Arduino would reboot itself repetitively in a high frequency to get the bootloader lost.
      e.g.
      1. When your Arduino was powered by battery(s), you should cut off the power supply to Arduino when the battery voltage is below the minimum power supply requirement.
      2. When using large power consumption module(s) with Arduino, e.g. servo, motor, large display modules... , you'd better supply Arduino with an external power source. Merely with a USB cable is not enough especially when the servo(s) running with a load.
      3. Power source Maximum Current Output should also be considered to content with the current absorption. e.g. The power adapter/ battery can only output 500mA, but your system demands current @1A...

    2. Serial Monitor should be closed firstly before unplugging the USB cable from Arduino card. Or your Arduino card is at the risk losing its bootloader. It is not a must but a suggested operation.

  2. DON'T do wiring while powering on! Although Arduno is LV, but some capacitive components/ modules will cause short-circuit in that case, and your board/ components may highly possible become defective/ burned. :!:

  3. Short Circuit by water/ mistaken wiring/ careless operation... should always be avoided :!: .

  4. All devices can NOT be powered wrong, i.e. Do not wire by 5V-GND, GND-5V, some devices have voltage reverse protection, while some not, so this careless mistake will burn it in a wink! :!: :o

  5. In most cases, all the GNDs (ground) of the power sources/ boards/ sensors/ actuators in the same project should be connected as a Common Ground System to work properly. :!:

  6. Make sure your cable, connection is reliable. Bad cable, loose/ wrong connection would make you feel really confused when something weird happen.

    e.g. many connecters need a screwdriver/ by pressing something to buck-up the cable, when you finished tightening, if the screw is lower than the screw hole surface, that's good, while they are on the same level or the screw is higher than that, that's bad connection. showing in the picture below,

    (266.09 KiB) Downloaded 55866 times


Content of Topic Below

  1. Topic: Power Supply for Arduino card (Motor driver+ servo ...)

  2. Problem: Can't include a library, or Error came up when the library was compiled?

  3. Topic: Some common mistakes causing data reading error (analog, digital, serial etc.)

  4. Issue: Can't upload any program

  5. Question: How to fix Arduino if its bootloader was lost?

  6. Other FAQ
#8667
Question: How to fix Arduino if its bootloader was lost?


NOTE: If your card is a DFRobot BLE series:

  1. If there is an COM port coming up once you connected with your PC (sure, you also have to install its driver, or it would be recognized as an Unknown device or others), and you can connect it wirelessly by the App BlunoBasicDemo, then it proves that the bootloder/ firmware in chip CC2540 is good. But it's the problem with the master chip. You can:

    1. Go below to check the solution for the master chip (most of them are ATmega328P using Arduino Uno)

    2 Also just to make sure everything is ok, you can try to update its firmware. How to update BLE firmware.

  2. If there is no COM port even you've tried everything, (and also sometimes, you may can't find it by a smart phone(BLE supported)), it proves that the bootloader in CC 2540 is lost, and it could be fixed by a CCDebugger, and clike here to know how.


Generally speaking, Arduino cards have two MCUs, one is to generate a COM port on your computer (serial chip, SC), another is to execute code (master chip, MC). And each chip contains a bootloader. You can understand it in this way, every computer has an operation system which allows user to install/run any cool software/games. It's the same thing that the bootloader of Arduino allow you to run a code. So we can get some clue here and figure out some solutions according to different problem. But for sure that we can not do anything here if the chip was burned, that is, it will get very hot once you plug the usb cable. (repalce the burned components...), if the voltage (5V, 3.3V) on the board is normal, only with the problem of uploading sketch or card recognization, you can firstly determine which chip's bootloader was lost, and then find a way below to renew it. Source reading from Arduino: Bootloader Development


How can I know which chip lost its bootloader?

  • If COM port is recognized well on your computer, but always uploading failure, then it's certainly the problem of the MC.

  • If COM port is not recognized well in Device Manager, you can neither find COM port in Arduino IDE, then it's probably the SC problem


How to renew the chip?

  1. The quickest way to fix is to have an Arduino programmer

    Suggest Shopping items from DFRobot, two very creative products:

  2. If you have another good Arduino card, that also works, a little complex but interesting. Using an Arduino as an AVR ISP (In-System Programmer)?
#8668
Problem: Can't include a library, or Error came up when the library was compiled?



Here are some very common reasons on this topic, including some practical suggestions.

  1. Your library is not included correctly. Restart your Arduino IDE to make sure Arudino IDE can include/detect the new library.

  2. Check if the two files(some times, there is only one), that is .cpp and .h files, are in the root of the library folder which was nested/ placed in Arduino library folder

    (14.66 KiB) Downloaded 55905 times

  3. Some libraries are only compatible with designed arduino IDE version ( :| the changing world...), like 1.0, 1.5 or 1.6
#8669
Topic: Power Supply for Arduino card (Motor driver+ servo ...)

There are many ways to supply power to Arduino cards, through USB, power_in jack, and through Vin (What's the difference, you could have a look at When you want to fiddle with the way you supply power, keep in mind that most basic board do something like...)

And if you want to use motor/servo, you might have to add another shield on the Arduino card, that would make you lose your mind how to power all different parts. A good way, and trustworthy, is to check your card/shield's schematic to figure it out. Here is an example of DFRobot expansion shield V7.1


EXAMPLE OF POWERING ISSUE

(73.3 KiB) Downloaded 55903 times


After plug it on your arduino card (Uno, Leonardo, Mega...), actually, if you are familiar with Arduino power method, you can only pay attention to No.2. For No.1 & 3 is the same as Arduino (check the link above), sure you could also use No.1 to supply power to Arduino card.

  1. PWR_IN: This jack can be the power source for the entire board including your Arduino card underneath.

  2. SERVO_PWR: This jack can only give power to the Digital pin, but other pins like 5v, 3.3v, Vin won't get any power from this connector, and the controller underneath can neither get powered. Namely, it won't run any code with only this power source connected. And its maxmum allowable current is 2A.

    Besides, :!: what should be mentioned is once you use the power jack, all the power on digital pins will turn out to be the same as the power source you used on it. In this case,

    • If you want to use a 3.3V digital sensor, please remove it and use it on Analog pins instead (it works).
    • And please make sure the power source on SERVO_PWR is in your servo allowed power-in range .

  3. Vin: It was connected with Arduino_Vin, so it's the same function as Arduino's.


Last but not least, know how much current/ voltage you need for your whole system is crucial, low voltage/current will cause demage to your components or you will get unexpected results. Read more: Absolute Maximum Ratings for Arduino card
#8670
Issue: Can't upload any program

NOTE: Make sure your computer system is not a bespoke/ pirate edition missing some important files, in this case, although there are many posts about how to fix this problem, but after many trails, I found to re-install an authorised system is the quickest way.

  • Surely that if you have two Arduino cards, one could be used very well, another not, then you can be sure that is broken.
  • Some Anti-virus softwares would treat Arduino badly :( , so Arduino can't upload program or in a really slow speed.


The correct steps to upload a sketch are: (Every step would contain a possible reason that you may be stuck at)

  1. Install Arduino IDE by an installer file (recommend)/ if your Arduino IDE is from a zip file, then you need to install driver manually for every Arduino board, or you won't find an available COM port in step3 :!: If you are warned of the driver signature missing, please check here to disable driver signature detection.

  2. Attach your arduino card with your PC through an USB cable, please confirm the USB cable is good

  3. Open the Arduino IDE, choose correct Board and Com port, if choose wrong board/port/ or leave it unchoosen, uploading will fail,

  4. :!: Unplug the wires on Digital Pin0&1 if there are on cards like UNO/Mega/Bluno... their serial port share the same pinports with USB port. Leonardo use D0&1 as serial1, so it won't happen to Leonardo.

    :!: If it is a controller with BLE/BT2.0 built-in, please disconnect the Bluetooth link with other bluetooth devices if you find its Link/Pair LED is ON.

  5. Click to upload. If still failed, it is highly possible the arduino card's bootloader was lost. please go to How to fix missing bootloader Arduino card? to find a solution. How bootloader works? From Arduino®


Sure if you want to upload a code through an external programmer, it also works Burning sketches to the Arduino board with an external programmer, if you bought a FTDI device/ USB serial adapter, here is a simple guide for you, How to use a USB adapter to program an Arduino card without serial chip?
#8785
Topic: Some common mistakes causing data reading error (analog, digital, serial etc.)


1. Analog/ Digital Sensor/ module

  • Wiring Problem, please make sure you wiring everything right, especially, when you use our gravity sensors/ modules.

    (279.89 KiB) Downloaded 89858 times


2. Serial Reading/writing

  • The baud rate should be the same as in the code, or the data will came up unreadable. e.g.

    If the code goes like this:
    Code: Select all
    void setup() {
      Serial.begin(115200);
      pinMode(13, OUTPUT);
    }

    Then the serial monitor setting should be the same correspondingly to what in the code ("115200")
    (2.6 KiB) Downloaded 89858 times

  • Serial communication goes like: Tx-Rx, Rx-Tx (device A- device B), sometimes, people would probably connect serial devices as Tx(Rx)-Tx(Rx) which is wrong that makes you could not read/write anything with another serial device.


3. Other possible reasons

  • For DFRobot Romeoboard (or similar one), A0

    If you use the Romeo within your project, you might notice there are some buttons on the board. Those buttons are all connected with A0 port, and there is also a switch to turn on/off the buttons-A0 connection. So If you attach an Analog sensor to A0, make sure to turn the switch OFF to disconnect the buttons.

    (361 KiB) Downloaded 4663 times


  • Code Doesn't Match with Wiring

    That's easy to understand and also easy to be omitted. e.g. If you write in your code to read analog pin 0, but your sensor was connected analog pin 1 or somewhere else instead of A0. Sure you might get into trouble. ;)