Basic Arduino Interfacing Lesson-1 PDF
Document Details
Uploaded by DelightedMusicalSaw6036
Tags
Summary
This document provides an introduction to basic Arduino interfacing from a lesson perspective. It covers the definition of a microcontroller and the different components of an Arduino UNO. It also looks at the Arduino IDE programming environment. The relevant components are explained to aid readers who have limited prior knowledge of electronics or robotics.
Full Transcript
Basic Arduino Interfacing Lesson - 1 Lesson Objectives: Identify what a Microcontroller is and identify different technologies and devices which microcontroller is present. Identify the different parts and feature of the Arduino Microcontroller Board. Navigate Arduino IDE software feature...
Basic Arduino Interfacing Lesson - 1 Lesson Objectives: Identify what a Microcontroller is and identify different technologies and devices which microcontroller is present. Identify the different parts and feature of the Arduino Microcontroller Board. Navigate Arduino IDE software features and how to use it. Classify different components; either digital or analog that can be used for prototyping What is an Arduino? Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino has different kinds of microcontroller development boards, from Arduino Uno (entry-level) to the latest as of this writing, the Portenta H7 which is capable of High- level programming and AI. What is a Microcontroller? A microcontroller is a small computation engine that “makes a decision” or “monitors a system”. Generally, microcontrollers have analog and digital input/output capabilities. Microcontrollers are everywhere, embedded in different devices such as toys, remote control, microwave ovens, thermostats, and timers. Microcontrollers make objects more interactive. They are often used in applications that have repetitive tasks. Arduino was created at the Ivrea Interaction Design Institute. It is designed as an easy tool for students without background in electronics and programming to do fast prototyping. Over the years Arduino has adapted to new challenges and needs, evolving from the 8-bit boards to products for wearable technology, IoT applications, embedded environments, and 3D printing. What makes Arduino different from Raspberry Pi? Raspberry Pi is a general-purpose single- board computer powered by an operating system (Linux). Unlike Arduino boards, which is a microcontroller motherboard, Raspberry pi can run multiple programs. Raspberry is used to running complicated robots performing multiple programs and intense calculations. Arduino Uno Anatomy Arduino Uno Anatomy 1. Digital Pins – These pins can be used for commands such as digitalWrite(), digitalRead(), and analogWrite() which can be used and will work only on pins with PWM symbols. 2. Pin 13 LED – It is the only actuator built-in to the board. This pin is usually used to start your prototyping journey by using its LED for debugging and as your first blink sketch. 3. Power LED – Signals that your Arduino is receiving power. It is also useful for debugging. Arduino Uno Anatomy 4. ATmega microcontroller – It is the heart of your board. It is a low power controller that delivers high performance from Microchip, a company that manufactures semiconductor products. 5. Analog In/Pins – These pins can be used for commands such as analogRead(). 6. GND & 5V pins – It can read GND and 5V pins and it can also be used to provide +5V power and ground to your circuits. Arduino Uno Anatomy 7. Power Connector – It is used to power your Arduino when it is not plugged into a USB port for power. It can accept voltages between 7- 12V. 8. TX & RX LEDs – These LEDs indicate communication between your Arduino and your computer. Expect them to flicker rapidly during sketch upload as well as during serial communication. Useful for debugging. Arduino Uno Anatomy 9. USB Port – It is used to power your Arduino Uno, upload your sketches to your Genuino, and communicate with your Arduino sketch via Serial.println() and other commands. Bigger prototypes may require an additional power source to power the whole project. 10. Reset Button – It resets the ATmega microcontroller. Arduino IDE Software The Arduino IDE (Integrated Development Environment) software is used to develop computer code and upload it to the Arduino microcontroller. One of the main reasons why Arduino became so popular is because Arduino IDE is very simple to use. It allows beginners to write their code easily. Parts of the Arduino IDE Parts of the Arduino IDE Verify – compiles and checks if your code has error Upload – sends your code to the Arduino microcontroller New Sketch – allows you to create a new file Open – allows you to access previously saved sketch Save – saves the sketch to your computer Programming area – you can type your code here Serial Monitor – used to print received data Debugging console – allows you to test and debug your code Components that can be integrated with Arduino Breadboard It is a type of board that can be used to build electronic circuits. It is like a patch panel that has rows of holes that let you connect wires and components together. There are different versions of breadboard available in the market - it can require soldering or non-soldering type, like the one in the picture as shown. Jumper Wires These are typically used with breadboards and other prototyping tools to make it easier to change a circuit as needed. Capacitors It is a passive electrical component with two terminals. It is used to store and release electrical energy in a circuit. When the circuit's voltage is higher than what is stored in the capacitor, it allows current to flow in, giving the capacitor a charge. When the voltage of the circuit is lower, the stored charge is released. It is often placed across power and ground connections close to a motor or a sensor to give more stability in supplied voltage. Diode The diode ensures that the power only flows in one direction. It is used when there are motors or other high current/voltage load in the circuit. Diodes are polarized, meaning, the directional placement of the Diode determines the direction of the current. Placed one way, it will allow current to pass through and placed the other way, it blocks it. The anode side of the Diode is usually connected to the point of higher energy in the circuit while the cathode side connects to the point of lower energy, or to the ground and is marked with a band on one side of the component's body. Input Components Gas Sensor The MQ4 Methane Gas Sensor Module is a Compressed Natural Gas Sensor (CNG), which is mostly made up of methane (CH4), it is suitable for sensing natural gas concentrations in the air. It can detect natural gas concentrations anywhere between 200 - 10,000 ppm(parts-per-million). This sensor has high sensitivity and fast response time. The module outputs a voltage between 0 to 5V, relative to the gas concentration. IR Receiver Sensor (TSOP) An IR sensor is an electronic device that can be used to detect and measure Infrared radiation in its surrounding environment. The signals detected are converted into electrical signals on its output pin, typically called signal pin. The IR signals are primarily used to transmit commands over the air in short distances. It is used with TV remote controls to transmit commands from the remote control to the TV's receiver. Octocoupler This allows connection to two circuits that are not powered by the same source. A small LED inside illuminates a photoreceptor, which closes an internal switch when illuminated. The LED lights up and the internal switch closes when you apply voltage to the + pin. In the second circuit, the two outputs take the place of a switch. PIR Sensor The Pyroelectric sensor in the module generates energy when exposed to heat. Because a human or animal body emits heat energy in the form of infrared radiation, the sensor will detect movement when it comes within range of the sensor. The sensor is called a Passive Infra-Red sensor. And the term "passive" refers to the fact that the sensor does not use any energy to detect anything; it simply detects the energy emitted by other objects. Photoresistor Photoresistor is also known as a photocell or a light-sensitive resistor. It is a variable resistor whose resistance varies depending on the amount of light falling on its face. Output Components DC Motors DC Motor converts electrical energy into mechanical energy when there is electricity applied to its connectors. The coils of wire inside the motor become magnetized when current flows through it. The magnetic field created attracts and repels magnets, making the shaft inside spin. If the direction of the electricity is reversed, the motor will spin in the opposite direction. H-Bridge H-bridge is a circuit that lets you control the direction of the voltage applied to a load. If used in a motor, it can change the direction of the rotation from clockwise to counterclockwise and vice versa. The H-bridge in the kit is an integrated circuit, but it could also be constructed with several discrete components. LED (Light Emitting Diode) LED is a type of diode that lightens when electricity passes through it. Like all diodes, the electricity in LEDs only flows in one direction. You have probably seen these on a variety of electronic devices as indicators. The longer leg is usually the anode, which connects to power, and the shorter leg is the cathode. RGB LED An RGB LED has four pins: one for each color (Red, Green, and Blue) and one for the common cathode. It contains three different color-emitting diodes that can be blended to produce a wide range of colors. Depending on how bright each diode is, any color is possible. Colors can be created by adjusting the brightness of each of the RGB LED's three LEDs; a PWM signal is used to adjust the brightness of each LED. Vibration Motor Vibration motors are small coreless DC motors that vibrate to notify users that they have received a signal without making a sound. Vibration motors can be found in a wide range of applications, including cell phones, handsets, pagers, and more. LCD (Liquid Crystal Display) An LCD is a type of alphanumeric or graphic display based on liquid crystals. LCDs are available in many sizes, shapes, and styles. Yours has 2 rows with 16 characters each. Piezo A Piezo is an electrical component that can be used to detect vibrations and create noises. End of Lecture