Good to know, Arduino common problem (updating)
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.
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...
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.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.
Short Circuit by water/ mistaken wiring/ careless operation... should always be avoided .
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!
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.
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.
1. Analog/ Digital Sensor/ module
- Wiring Problem, please make sure you wiring everything right, especially, when you use our gravity sensors/ modules.
-
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.
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)
- 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.
- Attach your arduino card with your PC through an USB cable, please confirm the USB cable is good
- Open the Arduino IDE, choose correct Board and Com port, if choose wrong board/port/ or leave it unchoosen, uploading will fail,
-
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.
- 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? Leff
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
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.
- PWR_IN: This jack can be the power source for the entire board including your Arduino card underneath.
- 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 .
- If you want to use a 3.3V digital sensor, please remove it and use it on Analog pins instead (it works).
- 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 Leff
- Source reading from Arduino: Libraries
Here are some very common reasons on this topic, including some practical suggestions.
- Your library is not included correctly. Restart your Arduino IDE to make sure Arudino IDE can include/detect the new library.
- 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