Module 8

Cards (33)

  • Arduino is an open-source prototype platform that combines user-friendly hardware and software. It consists of a circuit board, known as a microcontroller, which can be programmed, and a ready-made software called Arduino IDE (Integrated Development Environment), used to write and upload computer code to the board.
  • Arduino offers a standardized form factor that simplifies the functions of the microcontroller into a more accessible package.
  • Arduino Board can be powered by using the USB cable from your computer. All you need to do is connect the USB cable to the USB connection
  • Arduino boards can be powered directly from the AC mains power supply by connecting it to the Barrel Jack
  • You can reset your Arduino board, i.e., start your program from the beginning. You can reset the UNO board in two ways. First, by using the reset button on the board. Second, you can connect an external reset button to the Arduino pin labelled RESET
  • In Arduino Uno, there are six analog pins, labeled A0 to A5. These pins are used for analog input and can measure voltage levels between 0 and 5 volts. Unlike digital pins that can only detect two states (HIGH or LOW), analog pins allow you to read continuous analog values, making them useful for interfacing with analog sensors or other analog devices.
  • This LED should light up when you plug your Arduino into a power source to indicate that your board is powered up correctly. If this light does not turn on, then there is something wrong with the connection.
  • The Arduino UNO board has 14 digital pins (of which 6 provide PWM (Pulse Width Modulation) output. These pins can be configured to work as input digital pins to read logic values (0 or 1) or as digital output pins to drive different modules like LEDs, relays, etc. The pins labeled “~” can be used to generate PWM.
  • Installation
    Step 1: You can get different versions of Arduino IDE from the download page on the Arduino Official website. You must select your software, which is compatible with your operating system (Windows, macOS, or Linux).
  • Installation
    Step 2: Before explaining how we can upload our program to the board, we must demonstrate the function of each symbol appearing in the Arduino IDE toolbar.
  • Verify: used to check if there is any compilation error
    Upload: used to upload a program to the arduino board
    Select board: used to select the board and port
    Serial monitor: used to receive serial data from the board and send the serial data to the board
  • Installation
    Step 3: To test if your installation is functioning properly, connect your Arduino board to your computer and upload a sample file by going to File - Examples - 01. Basics - Blink. Upload the program to your board. If you encountered an error, check if the board and port selected is working. The board should be Arduino Uno and the port is usually COM3 or COM4.
  • Arduino programs can be divided into three main parts: Structure, Values (variables and constants), and Functions. In this lesson, let us try to unlock the program using the Blink sample program of Arduino IDE.
  • Structure has 2 main functions:
    1. Setup() function
    2. Loop() function
  • The setup() function is called when a program starts. It is used to initialize variables, pin modes, start using libraries, and so on. The setup function runs only once after each power-up or reset of the Arduino board. In most of the programs you create, the pinMode() function is used in this function. pinMode() allows you to set the mode of each pin as either INPUT or OUTPUT.
  • After creating the setup() function, which initializes and sets the initial values, the loop() function does exactly what its name suggests. It runs repetitively, allowing your program to change and respond continuously. Use this function to actively control the Arduino board. In most of the programs you create, the digitalWrite() and delay() functions are used in this function.
  • Functions allow the structuring of programs into segments of code that perform specific tasks. They are typically used when the same action needs to be performed multiple times in a program.
  • Functions help keep the programmer organized, aiding in conceptualizing the program. By codifying one action in one place, functions only need to be thought about and debugged once. This reduces the chances of errors when modifying code
  • Functions make the overall sketch smaller and more compact by reusing sections of code multiple times.
  • They facilitate code reuse in other programs by making it modular, and using functions often improves code readability
  • Arduino libraries are collections of pre-written code that simplify complex tasks and provide additional functionalities for Arduino projects. Rather than starting from scratch, we can leverage these libraries to save time and streamline our programming efforts.
  • 4 Purposes of Libraries:
    1. Code Reusability
    2. Function Expansion
    3. Abstraction of Complexity
    4. Community Collaboration
  • Code Reusability: Libraries allow us to reuse existing code, enabling a more efficient development process. This reduces redundancy and helps maintain clean, organized code
  • Function Expansion: By incorporating libraries, we can easily integrate advanced functions and features into our projects without having to write extensive code. This opens up a world of possibilities for creativity and innovation.
  • Abstraction of Complexity: Libraries abstract the complexity of certain tasks, providing a simplified interface. This is especially beneficial for beginners, making it easier to implement intricate functionalities.
  • Community Collaboration: Arduino libraries are often developed and shared by the community. This collaborative effort fosters knowledge exchange, allowing us to benefit from the collective expertise of the Arduino community.
  • LCDs are ideal for displaying characters, with common LCDs capable of showing 16 characters per row across 2 rows.
  • After downloading, open your Arduino IDE and follow the instructions in the image on the left:
    1. Click on "Add .ZIP Library..."
    2. Choose the downloaded library.
    3. For better organization, consider moving the downloaded library into your Arduino/Libraries folder. If there isn't a folder yet, create one.
    4. Now, you can use the library
  • Sample Projects in Arduino
    1. Monitor ECG and Respiration using your Arduino
    2. Crying Baby detector
    3. Third Eye for the Blind
    4. Arduino Breathalyzer
  • The ECG respiration shield elevates a medical device to another level. The new device is portable, less complex, and an efficient ECG monitoring system. This project serves as a demonstration of how to utilize the ECG shield in conjunction with Arduino
  • The Crying Baby Detector project is inspired by the concept of a Baby Monitor, but with a few notable differences. The idea behind this project is to take certain actions when the baby starts crying. For instance, it automatically plays soothing music to help the baby fall back asleep. Additionally, it utilizes white noise, which refers to soft, comforting sounds or music that help calm the baby and facilitate sleep.
  • Third Eye, an innovative device, aims to assist blind individuals in navigating their surroundings with enhanced speed and confidence. By utilizing ultrasonic waves, the device can detect nearby obstacles and provide notifications through buzzer sounds or vibrations. The device can be easily worn as a band or incorporated into clothing.
  • The Arduino Breathalyzer is a device used to estimate blood alcohol content (BAC) based on a breath sample. In simple terms, it is a tool to determine if a person is intoxicated. As the title suggests, this particular breathalyzer is powered by Arduino. It utilizes the MQ-3 alcohol sensor from SparkFun.