├── .gitignore ├── Docs ├── Android App Details.pdf ├── ArduBotics- Manual.pdf ├── BASICS OF ELECTRONICS & INTRODUCTION ABOUT ARDUINO.pdf └── VC.jpeg ├── Images ├── Arduino Voice control App.jpg ├── Chasis.jpeg ├── Gesture APP.jpg ├── IMG_20160220_150907.jpg ├── L293D Wiring - Copy.jpg ├── L293D Wiring.jpg ├── Motor Clamps.jpeg └── arduino_uno_components.jpg ├── Programs ├── Gesture_Controlled_Robot │ ├── Gesture_Controlled_Robot.ino │ └── readme.md ├── Led-Example │ ├── Led-Example.ino │ └── readme.md ├── Voice_Controlled_Robot │ ├── Voice_Controlled_Robot.ino │ └── readme.md ├── line_follower │ ├── line_follower.ino │ └── readme.md └── obstacle_avoider │ ├── obstacle_avoider.ino │ └── readme.md ├── README.md └── assets ├── 10bitADC.png ├── Breadboard-Pinout.png ├── CLR.png ├── CN-Arduino-uno-fig1.jpg ├── analog.png ├── digital-values.png ├── led-diagram.png ├── ohmslaw.png └── push_button.png /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .DS_Store -------------------------------------------------------------------------------- /Docs/Android App Details.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/Docs/Android App Details.pdf -------------------------------------------------------------------------------- /Docs/ArduBotics- Manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/Docs/ArduBotics- Manual.pdf -------------------------------------------------------------------------------- /Docs/BASICS OF ELECTRONICS & INTRODUCTION ABOUT ARDUINO.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/Docs/BASICS OF ELECTRONICS & INTRODUCTION ABOUT ARDUINO.pdf -------------------------------------------------------------------------------- /Docs/VC.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/Docs/VC.jpeg -------------------------------------------------------------------------------- /Images/Arduino Voice control App.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/Images/Arduino Voice control App.jpg -------------------------------------------------------------------------------- /Images/Chasis.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/Images/Chasis.jpeg -------------------------------------------------------------------------------- /Images/Gesture APP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/Images/Gesture APP.jpg -------------------------------------------------------------------------------- /Images/IMG_20160220_150907.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/Images/IMG_20160220_150907.jpg -------------------------------------------------------------------------------- /Images/L293D Wiring - Copy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/Images/L293D Wiring - Copy.jpg -------------------------------------------------------------------------------- /Images/L293D Wiring.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/Images/L293D Wiring.jpg -------------------------------------------------------------------------------- /Images/Motor Clamps.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/Images/Motor Clamps.jpeg -------------------------------------------------------------------------------- /Images/arduino_uno_components.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/Images/arduino_uno_components.jpg -------------------------------------------------------------------------------- /Programs/Gesture_Controlled_Robot/Gesture_Controlled_Robot.ino: -------------------------------------------------------------------------------- 1 | String voice; 2 | int 3 | M11 = 13; // Connect Motor 1 4 | int M12 = 12; // Connect Motor 1 5 | int M21 = 11; // Connect Motor 2 6 | int M22 = 10; // Connect Motor 2 7 | 8 | //--------------------------Motor Control Functions-------------------------------// 9 | void forward() 10 | { 11 | digitalWrite(M11, HIGH); 12 | digitalWrite(M12, LOW); 13 | digitalWrite(M21, HIGH); 14 | digitalWrite(M22, LOW); 15 | } 16 | 17 | void backward() 18 | { 19 | digitalWrite(M11, LOW); 20 | digitalWrite(M12, HIGH); 21 | digitalWrite(M21, LOW); 22 | digitalWrite(M22, HIGH); 23 | } 24 | 25 | void left() 26 | { 27 | digitalWrite(M11, LOW); 28 | digitalWrite(M12, LOW); 29 | digitalWrite(M21, HIGH); 30 | digitalWrite(M22, LOW); 31 | } 32 | 33 | void right() 34 | { 35 | digitalWrite(M11, HIGH); 36 | digitalWrite(M12, LOW); 37 | digitalWrite(M21, LOW); 38 | digitalWrite(M22, LOW); 39 | } 40 | 41 | void stay() 42 | { 43 | digitalWrite(M11, LOW); 44 | digitalWrite(M12, LOW); 45 | digitalWrite(M21, LOW); 46 | digitalWrite(M22, LOW); 47 | } 48 | 49 | //-----------------------------------------------------------------------// 50 | void setup() 51 | { 52 | Serial.begin(9600); // Start serial communication 53 | pinMode(M11, OUTPUT); // Set motor pins as OUTPUT 54 | pinMode(M12, OUTPUT); 55 | pinMode(M21, OUTPUT); 56 | pinMode(M22, OUTPUT); 57 | } 58 | 59 | //-----------------------------------------------------------------------// 60 | void loop() 61 | { 62 | while (Serial.available()) 63 | { // Check if there is an available byte to read 64 | char c = Serial.read(); // Conduct a serial read 65 | if (c == '#') 66 | { // Exit the loop when the # is detected 67 | break; 68 | } 69 | voice += c; // Append character to voice string 70 | delay(10); // Add a small delay for stability 71 | } 72 | 73 | if (voice.length() > 0) 74 | { 75 | Serial.println(voice); // Print received command for debugging 76 | //-----------------------------------------------------------------------// 77 | // Control the motors based on voice command 78 | if (voice == "*forward") 79 | { 80 | forward(); // Move Robot Forward 81 | } 82 | else if (voice == "*backward") 83 | { 84 | backward(); // Move Robot Backward 85 | } 86 | else if (voice == "*left") 87 | { 88 | left(); // Move Robot Left 89 | } 90 | else if (voice == "*right") 91 | { 92 | right(); // Move Robot Right 93 | } 94 | else if (voice == "*stop") 95 | { 96 | stay(); // Stop Robot 97 | } 98 | //-----------------------------------------------------------------------// 99 | voice = ""; // Reset the voice variable after processing 100 | } 101 | } -------------------------------------------------------------------------------- /Programs/Gesture_Controlled_Robot/readme.md: -------------------------------------------------------------------------------- 1 | # Gesture Controlled Robot 2 | 3 | ```c 4 | String voice; 5 | int 6 | M11 = 13; // Connect Motor 1 7 | int M12 = 12; // Connect Motor 1 8 | int M21 = 11; // Connect Motor 2 9 | int M22 = 10; // Connect Motor 2 10 | 11 | //--------------------------Motor Control Functions-------------------------------// 12 | void forward() 13 | { 14 | digitalWrite(M11, HIGH); 15 | digitalWrite(M12, LOW); 16 | digitalWrite(M21, HIGH); 17 | digitalWrite(M22, LOW); 18 | } 19 | 20 | void backward() 21 | { 22 | digitalWrite(M11, LOW); 23 | digitalWrite(M12, HIGH); 24 | digitalWrite(M21, LOW); 25 | digitalWrite(M22, HIGH); 26 | } 27 | 28 | void left() 29 | { 30 | digitalWrite(M11, LOW); 31 | digitalWrite(M12, LOW); 32 | digitalWrite(M21, HIGH); 33 | digitalWrite(M22, LOW); 34 | } 35 | 36 | void right() 37 | { 38 | digitalWrite(M11, HIGH); 39 | digitalWrite(M12, LOW); 40 | digitalWrite(M21, LOW); 41 | digitalWrite(M22, LOW); 42 | } 43 | 44 | void stay() 45 | { 46 | digitalWrite(M11, LOW); 47 | digitalWrite(M12, LOW); 48 | digitalWrite(M21, LOW); 49 | digitalWrite(M22, LOW); 50 | } 51 | 52 | //-----------------------------------------------------------------------// 53 | void setup() 54 | { 55 | Serial.begin(9600); // Start serial communication 56 | pinMode(M11, OUTPUT); // Set motor pins as OUTPUT 57 | pinMode(M12, OUTPUT); 58 | pinMode(M21, OUTPUT); 59 | pinMode(M22, OUTPUT); 60 | } 61 | 62 | //-----------------------------------------------------------------------// 63 | void loop() 64 | { 65 | while (Serial.available()) 66 | { // Check if there is an available byte to read 67 | char c = Serial.read(); // Conduct a serial read 68 | if (c == '#') 69 | { // Exit the loop when the # is detected 70 | break; 71 | } 72 | voice += c; // Append character to voice string 73 | delay(10); // Add a small delay for stability 74 | } 75 | 76 | if (voice.length() > 0) 77 | { 78 | Serial.println(voice); // Print received command for debugging 79 | //-----------------------------------------------------------------------// 80 | // Control the motors based on voice command 81 | if (voice == "*forward") 82 | { 83 | forward(); // Move Robot Forward 84 | } 85 | else if (voice == "*backward") 86 | { 87 | backward(); // Move Robot Backward 88 | } 89 | else if (voice == "*left") 90 | { 91 | left(); // Move Robot Left 92 | } 93 | else if (voice == "*right") 94 | { 95 | right(); // Move Robot Right 96 | } 97 | else if (voice == "*stop") 98 | { 99 | stay(); // Stop Robot 100 | } 101 | //-----------------------------------------------------------------------// 102 | voice = ""; // Reset the voice variable after processing 103 | } 104 | } 105 | ``` 106 | 107 | --- 108 | -------------------------------------------------------------------------------- /Programs/Led-Example/Led-Example.ino: -------------------------------------------------------------------------------- 1 | void setup() 2 | { 3 | pinMode(13, OUTPUT); // Set pin 13 as an output pin for the LED 4 | } 5 | 6 | void loop() 7 | { 8 | digitalWrite(13, HIGH); // Turn the LED on 9 | delay(1000); // Wait for 1 second 10 | digitalWrite(13, LOW); // Turn the LED off 11 | delay(1000); // Wait for 1 second 12 | } -------------------------------------------------------------------------------- /Programs/Led-Example/readme.md: -------------------------------------------------------------------------------- 1 | # Led Example 2 | 3 | ```c 4 | void setup() 5 | { 6 | pinMode(13, OUTPUT); // Set pin 13 as an output pin for the LED 7 | } 8 | void loop() 9 | { 10 | digitalWrite(13, HIGH); // Turn the LED on 11 | delay(1000); // Wait for 1 second 12 | digitalWrite(13, LOW); // Turn the LED off 13 | delay(1000); // Wait for 1 second 14 | } 15 | ``` 16 | 17 | --- 18 | -------------------------------------------------------------------------------- /Programs/Voice_Controlled_Robot/Voice_Controlled_Robot.ino: -------------------------------------------------------------------------------- 1 | String voice; 2 | int M11 = 13; // Connect Motor 1 3 | int M12 = 12; // Connect Motor 1 4 | int M21 = 11; // Connect Motor 2 5 | int M22 = 10; // Connect Motor 2 6 | 7 | //-------------------------- Motor Control Functions -------------------------------// 8 | void forward() 9 | { 10 | digitalWrite(M11, HIGH); 11 | digitalWrite(M12, LOW); 12 | digitalWrite(M21, HIGH); 13 | digitalWrite(M22, LOW); 14 | } 15 | 16 | void backward() 17 | { 18 | digitalWrite(M11, LOW); 19 | digitalWrite(M12, HIGH); 20 | digitalWrite(M21, LOW); 21 | digitalWrite(M22, HIGH); 22 | } 23 | 24 | void left() 25 | { 26 | digitalWrite(M11, LOW); 27 | digitalWrite(M12, LOW); 28 | digitalWrite(M21, HIGH); 29 | digitalWrite(M22, LOW); 30 | } 31 | 32 | void right() 33 | { 34 | digitalWrite(M11, HIGH); 35 | digitalWrite(M12, LOW); 36 | digitalWrite(M21, LOW); 37 | digitalWrite(M22, LOW); 38 | } 39 | 40 | void stay() 41 | { 42 | digitalWrite(M11, LOW); 43 | digitalWrite(M12, LOW); 44 | digitalWrite(M21, LOW); 45 | digitalWrite(M22, LOW); 46 | } 47 | 48 | //-----------------------------------------------------------------------// 49 | void setup() 50 | { 51 | Serial.begin(9600); 52 | pinMode(M11, OUTPUT); 53 | pinMode(M12, OUTPUT); 54 | pinMode(M21, OUTPUT); 55 | pinMode(M22, OUTPUT); 56 | } 57 | 58 | //-----------------------------------------------------------------------// 59 | void loop() 60 | { 61 | while (Serial.available()) 62 | { // Check if there is an available byte to read 63 | delay(10); // Delay added to make things stable 64 | char c = Serial.read(); // Conduct a serial read 65 | if (c == '#') 66 | { 67 | break; // Exit the loop when the '#' is detected after the word 68 | } 69 | voice += c; // Append the character to the voice command 70 | } 71 | 72 | if (voice.length() > 0) 73 | { 74 | Serial.println(voice); // Print the received voice command 75 | 76 | //-----------------------------------------------------------------------// 77 | // Motor control based on voice commands 78 | if (voice == "forward") 79 | { 80 | forward(); // Move Robot Forward 81 | } 82 | else if (voice == "backward") 83 | { 84 | backward(); // Move Robot Backward 85 | } 86 | else if (voice == "left") 87 | { 88 | left(); // Move Robot Left 89 | } 90 | else if (voice == "right") 91 | { 92 | right(); // Move Robot Right 93 | } 94 | else if (voice == "stop") 95 | { 96 | stay(); // Stop Robot 97 | } 98 | 99 | //-----------------------------------------------------------------------// 100 | voice = ""; // Reset the variable after command execution 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /Programs/Voice_Controlled_Robot/readme.md: -------------------------------------------------------------------------------- 1 | # Voice Controlled Robot 2 | 3 | ```c 4 | String voice; 5 | int M11 = 13; // Connect Motor 1 Blue wire To Pin #13 6 | int M12 = 12; // Connect Motor 1 Violet wire To Pin #12 7 | int M21 = 11; // Connect Motor 2 Blue wire To Pin #11 8 | int M22 = 10; // Connect Motor 2 Violet wire To Pin #10 9 | 10 | //-------------------------- Motor Control Functions -------------------------------// 11 | void forward() { 12 | digitalWrite(M11, HIGH); 13 | digitalWrite(M12, LOW); 14 | digitalWrite(M21, HIGH); 15 | digitalWrite(M22, LOW); 16 | } 17 | 18 | void backward() { 19 | digitalWrite(M11, LOW); 20 | digitalWrite(M12, HIGH); 21 | digitalWrite(M21, LOW); 22 | digitalWrite(M22, HIGH); 23 | } 24 | 25 | void left() { 26 | digitalWrite(M11, LOW); 27 | digitalWrite(M12, LOW); 28 | digitalWrite(M21, HIGH); 29 | digitalWrite(M22, LOW); 30 | } 31 | 32 | void right() { 33 | digitalWrite(M11, HIGH); 34 | digitalWrite(M12, LOW); 35 | digitalWrite(M21, LOW); 36 | digitalWrite(M22, LOW); 37 | } 38 | 39 | void stay() { 40 | digitalWrite(M11, LOW); 41 | digitalWrite(M12, LOW); 42 | digitalWrite(M21, LOW); 43 | digitalWrite(M22, LOW); 44 | } 45 | 46 | //-----------------------------------------------------------------------// 47 | void setup() { 48 | Serial.begin(9600); 49 | pinMode(M11, OUTPUT); 50 | pinMode(M12, OUTPUT); 51 | pinMode(M21, OUTPUT); 52 | pinMode(M22, OUTPUT); 53 | } 54 | 55 | //-----------------------------------------------------------------------// 56 | void loop() { 57 | while (Serial.available()) { // Check if there is an available byte to read 58 | delay(10); // Delay added to make things stable 59 | char c = Serial.read(); // Conduct a serial read 60 | if (c == '#') { 61 | break; // Exit the loop when the '#' is detected after the word 62 | } 63 | voice += c; // Append the character to the voice command 64 | } 65 | 66 | if (voice.length() > 0) { 67 | Serial.println(voice); // Print the received voice command 68 | 69 | //-----------------------------------------------------------------------// 70 | // Motor control based on voice commands 71 | if (voice == "forward") { 72 | forward(); // Move Robot Forward 73 | } else if (voice == "backward") { 74 | backward(); // Move Robot Backward 75 | } else if (voice == "left") { 76 | left(); // Move Robot Left 77 | } else if (voice == "right") { 78 | right(); // Move Robot Right 79 | } else if (voice == "stop") { 80 | stay(); // Stop Robot 81 | } 82 | 83 | //-----------------------------------------------------------------------// 84 | voice = ""; // Reset the variable after command execution 85 | } 86 | } 87 | 88 | ``` 89 | 90 | --- 91 | -------------------------------------------------------------------------------- /Programs/line_follower/line_follower.ino: -------------------------------------------------------------------------------- 1 | void setup() 2 | { 3 | // Set pin modes 4 | pinMode(11, OUTPUT); // Motor control pin 5 | pinMode(8, INPUT); // Sensor/input pin 6 | pinMode(9, INPUT); // Sensor/input pin 7 | pinMode(10, OUTPUT); // Motor control pin 8 | pinMode(12, OUTPUT); // Motor control pin 9 | pinMode(13, OUTPUT); // Motor control pin 10 | } 11 | 12 | void loop() 13 | { 14 | // Check if pin 8 is HIGH (sensor/input triggered) 15 | if (digitalRead(8)) 16 | { 17 | digitalWrite(13, HIGH); // Turn on the output on pin 13 18 | digitalWrite(12, LOW); // Ensure pin 12 is LOW 19 | } 20 | else 21 | { 22 | digitalWrite(13, LOW); // Turn off the output on pin 13 23 | digitalWrite(12, LOW); // Ensure pin 12 remains LOW 24 | } 25 | 26 | // Check if pin 9 is HIGH (sensor/input triggered) 27 | if (digitalRead(9)) 28 | { 29 | digitalWrite(11, HIGH); // Turn on the output on pin 11 30 | digitalWrite(10, LOW); // Ensure pin 10 is LOW 31 | } 32 | else 33 | { 34 | digitalWrite(11, LOW); // Turn off the output on pin 11 35 | digitalWrite(10, LOW); // Ensure pin 10 remains LOW 36 | } 37 | } -------------------------------------------------------------------------------- /Programs/line_follower/readme.md: -------------------------------------------------------------------------------- 1 | # Line Follower 2 | 3 | ```c 4 | void setup() 5 | { 6 | // Set pin modes 7 | pinMode(11, OUTPUT); // Motor control pin 8 | pinMode(8, INPUT); // Sensor/input pin 9 | pinMode(9, INPUT); // Sensor/input pin 10 | pinMode(10, OUTPUT); // Motor control pin 11 | pinMode(12, OUTPUT); // Motor control pin 12 | pinMode(13, OUTPUT); // Motor control pin 13 | } 14 | 15 | void loop() 16 | { 17 | // Check if pin 8 is HIGH (sensor/input triggered) 18 | if (digitalRead(8)) 19 | { 20 | digitalWrite(13, HIGH); // Turn on the output on pin 13 21 | digitalWrite(12, LOW); // Ensure pin 12 is LOW 22 | } 23 | else 24 | { 25 | digitalWrite(13, LOW); // Turn off the output on pin 13 26 | digitalWrite(12, LOW); // Ensure pin 12 remains LOW 27 | } 28 | 29 | // Check if pin 9 is HIGH (sensor/input triggered) 30 | if (digitalRead(9)) 31 | { 32 | digitalWrite(11, HIGH); // Turn on the output on pin 11 33 | digitalWrite(10, LOW); // Ensure pin 10 is LOW 34 | } 35 | else 36 | { 37 | digitalWrite(11, LOW); // Turn off the output on pin 11 38 | digitalWrite(10, LOW); // Ensure pin 10 remains LOW 39 | } 40 | } 41 | ``` 42 | 43 | --- 44 | -------------------------------------------------------------------------------- /Programs/obstacle_avoider/obstacle_avoider.ino: -------------------------------------------------------------------------------- 1 | void setup() { 2 | // Configure pin modes 3 | pinMode(8, INPUT); // Pin 8 set as input 4 | pinMode(9, INPUT); // Pin 9 set as input 5 | pinMode(10, OUTPUT); // Pin 10 set as output 6 | pinMode(11, OUTPUT); // Pin 11 set as output 7 | pinMode(12, OUTPUT); // Pin 12 set as output 8 | pinMode(13, OUTPUT); // Pin 13 set as output 9 | } 10 | 11 | void loop() { 12 | if ((digitalRead(9) == LOW) && (digitalRead(8) == HIGH)) { 13 | digitalWrite(13, HIGH); 14 | digitalWrite(12, LOW); 15 | digitalWrite(11, LOW); 16 | digitalWrite(10, LOW); 17 | } 18 | 19 | else if ((digitalRead(8) == LOW) && (digitalRead(9) == HIGH)) { 20 | digitalWrite(11, HIGH); 21 | digitalWrite(10, LOW); 22 | digitalWrite(13, LOW); 23 | digitalWrite(12, LOW); 24 | } 25 | 26 | else if ((digitalRead(8) == LOW) && (digitalRead(9) == LOW)) { 27 | digitalWrite(13, LOW); 28 | digitalWrite(12, LOW); 29 | digitalWrite(11, LOW); 30 | digitalWrite(10, LOW); 31 | } 32 | 33 | else if ((digitalRead(8) == HIGH) && (digitalRead(9) == HIGH)) { 34 | digitalWrite(13, HIGH); 35 | digitalWrite(12, LOW); 36 | digitalWrite(11, HIGH); 37 | digitalWrite(10, LOW); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Programs/obstacle_avoider/readme.md: -------------------------------------------------------------------------------- 1 | # Obstacle Avoider 2 | 3 | ```c 4 | void setup() { 5 | // Configure pin modes 6 | pinMode(8, INPUT); // Pin 8 set as input 7 | pinMode(9, INPUT); // Pin 9 set as input 8 | pinMode(10, OUTPUT); // Pin 10 set as output 9 | pinMode(11, OUTPUT); // Pin 11 set as output 10 | pinMode(12, OUTPUT); // Pin 12 set as output 11 | pinMode(13, OUTPUT); // Pin 13 set as output 12 | } 13 | 14 | void loop() { 15 | if ((digitalRead(9) == LOW) && (digitalRead(8) == HIGH)) { 16 | digitalWrite(13, HIGH); 17 | digitalWrite(12, LOW); 18 | digitalWrite(11, LOW); 19 | digitalWrite(10, LOW); 20 | } 21 | 22 | else if ((digitalRead(8) == LOW) && (digitalRead(9) == HIGH)) { 23 | digitalWrite(11, HIGH); 24 | digitalWrite(10, LOW); 25 | digitalWrite(13, LOW); 26 | digitalWrite(12, LOW); 27 | } 28 | 29 | else if ((digitalRead(8) == LOW) && (digitalRead(9) == LOW)) { 30 | digitalWrite(13, LOW); 31 | digitalWrite(12, LOW); 32 | digitalWrite(11, LOW); 33 | digitalWrite(10, LOW); 34 | } 35 | 36 | else if ((digitalRead(8) == HIGH) && (digitalRead(9) == HIGH)) { 37 | digitalWrite(13, HIGH); 38 | digitalWrite(12, LOW); 39 | digitalWrite(11, HIGH); 40 | digitalWrite(10, LOW); 41 | } 42 | } 43 | ``` 44 | 45 | --- 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arduino: Foundations 2 | 3 | Welcome to the foundational guide on Arduino. This guide will walk you through the core components and principles of Arduino, giving you both theoretical knowledge and hands-on experience with real-world applications. 4 | 5 | ## What is an Arduino? 6 | 7 | Arduino is an open-source electronics platform based on easy-to-use hardware and software. It consists of both a physical programmable circuit board (often referred to as a microcontroller) and a piece of software, called the IDE (Integrated Development Environment), which is used to write and upload code to the Arduino board. 8 | 9 | Think of Arduino as the brain that controls electronics like LEDs, motors, or sensors. It senses its environment using input devices and responds by controlling output devices. 10 | 11 | **Key Features of Arduino:** 12 | - **Microcontroller**: A small computer that can control electronic devices. 13 | - **Analog and Digital Pins**: Used to connect sensors, LEDs, and other devices. 14 | - **USB Connection**: For powering the board and uploading code. 15 | 16 | ## Arduino UNO 17 | 18 | Components of an Arduino UNO (Most Common Board) 19 | 20 | ![Arduino Diagram](./assets/CN-Arduino-uno-fig1.jpg) 21 | 22 | ### USB Port 23 | 24 | **Function**: Connects Arduino to a computer for power and uploading code. 25 | **Usage**: Use a USB cable to upload your programs, called "sketches," from your computer to the Arduino. 26 | 27 | ### Power Jack (Barrel Connector) 28 | 29 | **Function**: Powers the Arduino when not connected to a computer. 30 | **Input**: Accepts voltages between 9-12 volts from an external power supply. 31 | 32 | ### Reset Button 33 | 34 | **Function**: Resets the board. If your program isn't running as expected, this button restarts it from the beginning. 35 | 36 | ### Digital Pins (0-13) 37 | 38 | **Function**: Pins that can either be set to input or output mode. You can control devices like LEDs, motors, and sensors through these pins. 39 | **Special Pins**: Pins 0 and 1 are used for serial communication (labeled RX/TX for receiving and transmitting data). 40 | 41 | ### Analog Pins (A0-A5) 42 | 43 | **Function**: Used to read analog signals from sensors like temperature sensors, potentiometers, etc. These pins convert the signals into digital values that the microcontroller can interpret. 44 | 45 | 46 | ### Power Pins 47 | 48 | **5V Pin**: Provides a stable 5V output to other components in your circuit. 49 | **3.3V Pin**: Provides 3.3V for components that need lower voltage. 50 | **GND Pin**: Ground pin, common to all circuits. 51 | **Vin Pin**: If you’re supplying external power, this is where you connect your input voltage (up to 12V). 52 | 53 | ### ATmega328 Microcontroller 54 | 55 | **Function**: The brain of the Arduino. It processes input and provides output based on your code. 56 | 57 | ### On-board LEDs 58 | 59 | **Green LED (PWR)**: Indicates that the board is powered on. 60 | **Yellow LED (L)**: Connected to pin 13; often used for basic LED blinking projects. 61 | 62 | ## What's Needed 63 | 64 | -**Hardware:** A circuit board containing a programmable microcontroller with input and output pins 65 | 66 | -**Software:** An IDE (Integrated Development Environment) is used to write and upload code to Arduino. 67 | 68 | ## Breadboard Diagram 69 | 70 | ![Breadboard Pin](./assets/Breadboard-Pinout.png) 71 | 72 | ## Digital Pins 73 | 74 | Values: 0 or 1 (either 0 or 1). 75 | 76 | ## Digital Values 77 | 78 | ![Digital Values](./assets/digital-values.png) 79 | 80 | Example: LED (the light is either on or off). 81 | 82 | **NOTE:** Pin 0 and 1 are communication pins too (marked Tx and Rx). 83 | 84 | **Digital Pins on Arduino can be used as either input or output.** 85 | 86 | ## Analog Signal 87 | 88 | ![Analog Signal](./assets/analog.png) 89 | 90 | Have a continuous range of values, not on or off, with values in between, for example, a temperature sensor. For UNO, A0 to A5 are analog pins. 91 | 92 | ## ADC (Analog to Digital Converter) 93 | 94 | ADC (Analog to Digital Converter) translates an analog signal into a digital value that can be understood by the Arduino's microcontroller. The Arduino software reads the digital value produced by the ADC to determine the original value of the analog signal. Most Arduino boards use 10-bit ADC resolution. 95 | 96 | ![10 Bit ADC](./assets/10bitADC.png) 97 | 98 | Returns an integer value between 0 to 1023, where 0 represents input for 0 volts and 1023 represents input for 5 volts. 99 | 100 | ## DAC (Digital to Analog Converter) 101 | 102 | Translates a digital value into an analog signal used to provide power to analog circuits. 103 | 104 | ## Power Pins 105 | 106 | Usually located on the left side of the Arduino board: 107 | 108 | -**Voltage In:** Labeled Vin or 9V, used when powering Arduino via an external power adapter (as opposed to 5V USB). 109 | 110 | -**5V:** Provides regulated 5V. 111 | 112 | -**3.3V:** Provides 3 volts. 113 | 114 | -**Ground:** Provides common ground to Arduino. 115 | 116 | ## Ohm's Law 117 | 118 | States that the electric current through a conductor between two points is directly proportional to the voltage across the two points. It is described by the equation: 119 | 120 | ![Ohm's Law Equation](./assets/ohmslaw.png) 121 | 122 | where I is the current, V is 123 | 124 | the voltage, and R is the resistance. 125 | 126 | ## Arduino IDE 127 | 128 | Used for uploading code to Arduino. It uses a graphical text editor for writing and editing code. Programs written using Arduino IDE are called sketches. 129 | 130 | ## Default Code 131 | 132 | -`void setup()`: Initializes the input and output pins. 133 | 134 | -`void loop()`: Repeats the function until the Arduino is powered off. 135 | 136 | These functions are essential when working on Arduino. 137 | 138 | ## Basic Commands 139 | 140 | -`pinMode(pin, mode)`: Configures the pin (input or output). Example: `pinMode(2, OUTPUT)`. 141 | 142 | ### Interface Modes 143 | 144 | 1.`INPUT`: Normal input mode to receive a voltage. 145 | 146 | 2.`INPUT_PULLUP`: Input mode that utilizes the Arduino's internal pull-up resistor. 147 | 148 | 3.`OUTPUT`: Normal output mode to send a voltage. 149 | 150 | -`digitalWrite(pin, value)`: Configures the pin (HIGH or LOW). Example: `digitalWrite(2, HIGH)`. 151 | 152 | -`delay(value)`: Adds a delay in milliseconds before going to the next line of code. 153 | 154 | ## Basic Program to Blink LED 155 | 156 | ```C 157 | 158 | int LED = 13; 159 | 160 | 161 | voidsetup () { 162 | 163 | pinMode(LED, OUTPUT); 164 | 165 | } 166 | 167 | 168 | voidloop () { 169 | 170 | digitalWrite(LED, HIGH); 171 | 172 | delay(1000); 173 | 174 | digitalWrite(LED, LOW); 175 | 176 | delay(1000); 177 | 178 | } 179 | 180 | ``` 181 | 182 | ## Serial Monitor 183 | 184 | Built-in Arduino IDE feature helpful for troubleshooting and serial communication. 185 | 186 | ## Serial Communication 187 | 188 | - Digital Pin 0 (RX) 189 | - Digital Pin 1 (TX) 190 | 191 | ## `Serial.begin()` 192 | 193 | `Serial.begin()` function initializes serial communication between the Arduino board and an external device, typically a computer. 194 | 195 | ### Serial Communication 196 | 197 | It is a way for different electronic devices to exchange information over a wireless connection, commonly used for debugging or sending data to a computer. 198 | 199 | ### `Serial.begin(baudRate)` 200 | 201 | -`Serial`: Refers to the serial communication object in the Arduino programming environment. 202 | 203 | -`begin(baudRate)`: Initializes the serial communication. The `baudRate` parameter defines the speed at which data is sent between the Arduino and the connected device. 204 | 205 | ### Example 206 | 207 | ```c 208 | 209 | voidsetup() { 210 | 211 | Serial.begin(9600); // Initialize serial communication at 9600 baud 212 | 213 | // 9600 is the most common one 214 | 215 | } 216 | 217 | 218 | voidloop() { 219 | 220 | // Your main code goes here 221 | 222 | } 223 | 224 | ``` 225 | 226 | ### Purpose 227 | 228 | 1.**Debugging:**`Serial.begin()` is often used for debugging. `Serial.println()` prints messages or variable values to the Serial Monitor, allowing monitoring of the Arduino program's behavior. 229 | 230 | 2.**Data Transfer:** If Arduino needs to communicate with another device, serial communication is a straightforward way to exchange data. 231 | 232 | Remember to have a matching baud rate in the Arduino code and the Serial Monitor settings for proper communication. 233 | 234 | ## Using Serial Monitor with Blink LED 235 | 236 | ```C 237 | int LED = 13; 238 | int counter = 0; 239 | 240 | void setup() { 241 | pinMode(LED, OUTPUT); 242 | Serial.begin(9600); 243 | } 244 | 245 | void loop() { 246 | counter = counter + 1; 247 | Serial.print("Blink Number # "); 248 | Serial.println(counter); 249 | 250 | digitalWrite(LED, HIGH); 251 | delay(1000); 252 | digitalWrite(LED, LOW); 253 | delay(1000); 254 | } 255 | ``` 256 | 257 | ## LED (Light Emitting Diode) 258 | 259 | - Diode that emits light. 260 | 261 | **Diode**: Electrical component that allows current to flow only in one direction. 262 | 263 | **LED**: Has polarity and only lights up if connected properly. 264 | 265 | ![LED Schematic Symbol](./assets/led-diagram.png) 266 | 267 | - Anode -> Positive -> Longer leg 268 | - Cathode -> Negative -> Shorter leg (Case is flat on cathode side) 269 | 270 | ### Current Limiting Resistor 271 | 272 | Used in a circuit to ensure that a maximum current is not exceeded. 273 | 274 | ![Current Limiting Resistor](./assets/CLR.png) 275 | 276 | ## Push Button 277 | 278 | - Electrical component that connects two points in a circuit when pressed. 279 | 280 | ![Push Button](./assets/push_button.png) 281 | 282 | - Current can only flow through this circuit when the button is pressed, connecting the circuit. 283 | - Active-low and active-high refer to the state of a signal or the behavior of a component with respect to its logical levels. 284 | 285 | --- 286 | 287 | **To go deeper into Arduino, 288 | Explore the official site: 289 | [Click Here](https://docs.arduino.cc/learn/)** 290 | 291 | --- 292 | -------------------------------------------------------------------------------- /assets/10bitADC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/assets/10bitADC.png -------------------------------------------------------------------------------- /assets/Breadboard-Pinout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/assets/Breadboard-Pinout.png -------------------------------------------------------------------------------- /assets/CLR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/assets/CLR.png -------------------------------------------------------------------------------- /assets/CN-Arduino-uno-fig1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/assets/CN-Arduino-uno-fig1.jpg -------------------------------------------------------------------------------- /assets/analog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/assets/analog.png -------------------------------------------------------------------------------- /assets/digital-values.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/assets/digital-values.png -------------------------------------------------------------------------------- /assets/led-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/assets/led-diagram.png -------------------------------------------------------------------------------- /assets/ohmslaw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/assets/ohmslaw.png -------------------------------------------------------------------------------- /assets/push_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Archit-Jain-Github/arduinoFoundation/989c8714eeaae2d78dbe6a24ecd22c666e593157/assets/push_button.png --------------------------------------------------------------------------------