hello, I have a question.
im a new beginner to Arduino and I'm thinking about digital pins
when I saw the Arduino uno, I saw 13 digital pins, but in the videos on YouTube, they only used pins 2 to 12, is there a difference between the digital pins?
and why people don't use pin 0 and 1?
Pins 0 and 1 are used by the on-board USB chip to communicate with the computer. While they can be used, it is not advisable for beginners to do so.
What project are you considering and how many digital pins do you think that you'll need for it?
im using 5 pins for just air quality sensors and the pins are so random because of the wiring on tutorials like one sensor is connected to pin 4 and other one connected to 12 , I want all of them to not be that random I want all of them to go like 2 3 4 5 6 and I wanted to ask can i do this actually? in sites they always suggest to use pins like 2 5 7 and i don't know why
Many pins have different capabilities, some are capable of generating pwm, some are used for I2C, spme for SPI. Reorganizing them to go in order is not always possible.
Here is a chart of the pins and their capabilities:
is there a website to show all the info about the digital pins? like what they do and their capability.
There are many websites. See where google takes you and come back here with your questions
Not 13, but 14, because pins are indexed from zero. From D0 to D13 = 14 pins
Also you can use pins A0-A5 either as analog or as digital, which give you additional 6 pins
thanks a lot, i now know about all the digital pins
thanks, and what does "~" mean in digital pins?
"~" means PWM (Pulse Width Modulation) capability on appropriate pin.
It is written on the board just above Arduino infinity sign. It says "DIGITAL - PWM~". It probably may vary like "DIGITAL (PWM~)" on the picture @er_name_not_found have sent.
so i can use them as my other pins? there are no difference?
Yes, you can.
Each pin has 1 or more functionality. First is I/O and next is, if there is any, let say analog input, like A0. For an example D0 is PD0 I/O or HW serial Rx. It depends on current settings. Arduino uses it as Rx but you can use it as digital I/O. However, Tx and Rx are used for uploading so I am not going to recommending it like @er_name_not_found wrote above.
Pin 13 is connected to the built-in LED.
That is why many people avoid using it, as it may interfere with whatever you connect to it so you have to be very careful about it.
Fig-1 shows that the built-in LED (L) of UNO/NANO is driven by a buffer; hence, any IO devices can be safely connected at DPin-13. It may be noted that the SCK-signal of SPI Port is driven by DPin-13 with the in-situ LED circuit.
Figure-1:
Where are these diagrams from?
It (Fig-1 of post #16) has been prepared based on the official schematic of Arduino UNO (Fig-1). Some schematics show a buffer and 1k series resistor. On my UNO Board, I can see the 8-pin buffer (can't read chip type) near the 16 MHz crystal.
Figure-1:
It is very interesting.
Did you draw this yourself? In what program?
I use Microsoft Visio Application and manually draw the diagrams.
This is only true for the UNO R3, it is not true for the NANO and e.g. not for the UNO R4. You have to check for every board you use. So it's at least a good idea to not use that pin as INPUT.