Midterm Reviewer In Robotics II PDF

Summary

This document reviews digital and analog signals, sensors, actuators, and temperature sensors. It explains the use of voltage output sensors, accelerometers, gyroscopes, and gas sensors, along with different types of temperature sensors. Various code examples are included.

Full Transcript

MIDTERM REVIEWER IN ACTUAL Gas Sensor Pins ROBOTICS II 1ST PIN:Analog Out 2ND Digital Out PIN:...

MIDTERM REVIEWER IN ACTUAL Gas Sensor Pins ROBOTICS II 1ST PIN:Analog Out 2ND Digital Out PIN: Negative of the breadboard (GND) LESSON 1: DIGITAL & ANALOG SIGNAL 3RD Positive of the breadboard (VCC/5v) PIN: Digital Signal 4TH Serial.begin() - a type of signal that uses clear, separate - line of code is used to PIN: establish communication - values like 0 and.1 between an Arduino board and a computer, enabling - are effective at avoiding noise-related data transfer and serial communication. errors. - Default Baud Rate: 9600 it ensures clear on/off commands. Program Code of Gas Sensor: Analog Signal const int gasSensor = A0; - type of signals are used in devices that need to measure or represent void setup() { continuously varying signals. Serial.begin(9600); LESSON 2: VOLTAGE-OUTPUT SENSOR pinMode(gasSensorPin, INPUT); } Sensor - devices that can sense or identify and void loop() { react to certain types of electrical or optical int gasSensorValue = analogRead(gasSensor); signals. Serial.print("Gas Value: "); Serial.println(gasSensorValue); Actuators delay(1000); - devices which perform an “Output” } and are used to control some functiondevice, for example movement or external sound. LESSON 3: TEMPERATURE SENSOR Voltage-Output Sensor Temperature Sensor - type of sensor that measures a specific - is an electronic device that measures the physical property, like temperature, light, or and gas concentration, and converts that temperature of its environment converts the input data into electronic data. measurement into a corresponding voltage signal. Types of Temperature Sensors Accelerometer Sensor 1. TMP36 - is a device that measures acceleration - making it useful for both indoor and forces such as gravity, motion , and. It’s outdoor temperature measurements vibration. often used in environmental monitoring and Gyroscope Sensor HVAC systems. - is a device that measures the rate of 2. DS18B20 rotation or angular velocity around one or - Great for digital projects needing multiple more axes. sensors. 3. NTC Thermistor Gas Sensor - Ideal for detecting temperature changes. - a device that detects the presence or concentration of specific gases in the air. Commonly used in wearable health devices and digital thermometers to measure body temperature. 4. DHT11/DHT22 Program Code of LM35 - Provide both temperature and humidity data. void setup() { - They’re used in weather stations, analogReference(INTERNAL); Serial.begin(57600); greenhouse monitoring, and other projects } where you need to monitor environmental conditions. void loop() { 5. PT100 float temp = analogRead(0); - High accuracy for industrial use. temp = temp*0.1074; - Monitoring the temperature of Serial.print("Temp Value: "); machineries Serial.println(temp); overheating. of industrial factories to avoid delay(1000); 6. Thermocouples } - Measure extreme temperatures in tough environments. analogReference() - this function sets the reference voltage for LM35 Temperature Sensor the analog-to-digital converter (ADC), - Simple, easy-to-use sensors for basic which is responsible for converting theanalog temperature measurements. Also it voltage (from the LM35 sensor) to a digital measures and detects the temperature value. - around it. Baud Rate for LM35 Temperature Sensor: 57600 Linear Monolithic". LMo stands for- " means that the relationship Linear between the input (temperature) and Code to convert ADC to Degree Celcius output (voltage) is direct and - temp = temp * 0.1074; proportional, making it easy to predict and calculate. o Monolithic - it contains all the LESSON 4: RGB LED necessary components to measure temperature and produce an output RGB LED voltage, all in one small chip. You - it consists of three tiny light-emitting diodes— don’t need to connect it to lots of other red, green , and blue—housed together. parts to make it work. - It can be used to measure temperature Placement of the 3 Diodes anywhere between -55°C to 150°C. - the close placement of the diodes/LEDs allow them to mix seamlessly, appearing as a single color to our eyes. LM35 PINS 1ST PIN:Positive of the breadboard (VCC/5v) 2ND Pulse-Width Modulation (PWM) Analog Out - is an Arduino technique / component that PIN: Negative of the breadboard (GND) 3RD controls the brightness of the red, green, PIN: and blue diodes. Use of the function analogWrite() in RGB LED - analogWrite() allows you to output a range of values in PWM which corresponds to different levels of brightness. You can mix different intensities of red, green, and blue to produce a wide range of colors. - We do not use digitalWrite() in RGB LED LESSON 6: POTENTIOMETER because if you use this function, it can only turn a LED fully ON (HIGH) or OFF (LOW). Potentiometer This means you cannot control the - is a physically adjustable variable resistor brightness, as the LED is either lit or not. with three terminals. - The two end terminals are connected to the LESSON 5: PHOTORESISTOR ends of a fixed resistor. The left end terminal is the NEGATIVE terminal, while Photoresistor the right end terminal is the POSSITIVE - also known as a photocell or light- terminal. dependent resistor (LDR), is a resistor that - While the middle terminal, also known as allows one to interact with the external the wiper, moves over the resistive element environment using light intensity. or terminals. - The placement of the wiper determines the How does a Photoresistor work? output voltage of the potentiometer. It - INTENSE Light == HIGH Electric Current == mainly functions as a variable voltage LOW Resistance. (when the environment divider. gets lighter, its resistance decreases) Voltage Divider - a circuit which makes a large voltage into a - LESS INTENSE Light == LOW Electric smaller one by using a pair of resistors. Current == HIGH Resistance. (when the - Adjusting the wiper of a potentiometer environment gets dark, its resistance affect the output voltage, because it increases) adjusts the ratio of resistance across the terminals. Two Types of Resistor 1. Intrinsic Resistor How does a Potentiometer work? - this type can absorb, detect, and most - It works by varying the position of the sensitive to regular light we see every day wiper. (like sunlight or a light bulb, light that is - If you turn the wiper the left, the visible to our naked eye). the current/voltage decreases as resistance increases. 2. Extrinsic Resistor - If you turn the wiper the right, the the - With this type, the gate only opens when a current/voltage increases as different type of light, called infrared (which resistance decreases. is invisible to the naked eye but can be felt as heat), shines on them. - This makes them useful for things like night- vision cameras or remote controls that use infrared light. Use of the function analogRead() in Photoresistor - If the analogRead() returns a low value, it means the photoresistor is exposed to darkness, leading to a higher resistance and a lower analog reading. - If the analogRead() returns a high value, it means the photoresistor is exposed to intense light, leading to a lower resistance and a higher analog reading. LESSON 7: LIQUID CRYSTAL DISPLAY (LCD) I2C 16X2 LCD PROGRAM Electronic Visual Display 16 COLUMNS - also known as a screen , is a display device that displays images, texts, or videos that are being transmitted electronically to create a permanent record. 2 ROWS Types of Display 1. Electroluminescent Display - a type of flat panel display that uses electroluminescent materials to emit light when subjected to an electric current. Use of lcd.setCursor 2. LED Display - a type of display that uses tiny light-emitting The lcd.setCursor(column, row) function in diodes (LEDs) to produce images, text, or Arduino is used to position the cursor on an LCD video. Each LED in the display acts as a display. It sets the location where the next text or pixel. character will appear. - LEDhigh-visibility a display is bestOUTDOOR if you need a display for installation, LCD SAMPLE PROGRAM: considering factors like brightness and durability. #include 3. LCD Display #include - It consumes very little power , making it ideal for use in all kinds of electronic devices LiquidCrystal_I2C lcd(0x27, 16, 2); that rely on batteries for power. - The display is still good even for a brighter void setup() { INDOOR ambiance. lcd.init(); 4. Quantum Dot Display - The light is provided earlier in this type of lcd.backlight(); display, resulting in more effective displays , improve color accuracy lcd.setCursor(0, 0); and lcd.print("GOODLUCK ON YOUR"); brightness. 5. Flexible Display - This type of display is to create foldable lcd.setCursor(0, 1); phones , e-readers, curved televisions, and lcd.print("EXAM, NAKSHOES!"); other products. delay(1000); } I2C 16X2 LCD PINS 1. GND - Ground pin to be connected to the ground void loop() of the Arduino. { } 2. VCC - Power supply pin to be connected to the 5V of the Arduino. 3. SDA - The Serial Data pin that is used to transmit and receive data. I 4. SCL - The Serial Clock pin that is used as a timing signal. OUTPUT OF THE PROGRAM lcd.setCursor(0, 0); // 1st column, 1st row lcd.print("GOODLUCK ON YOUR"); lcd.setCursor(0, 1); 1st column, 2nd row lcd.print("EXAM, NAKSHOES!"); delay(1000); Wishing you all the best on your midterm examination, my dear nakshoes! Remember that you are capable of more than you know. Trust yourself and your abilities. You will shine! Papasa with flying colors! Yes na yes for you! - Meme Klyde LET’S TRY TO CHANGE THE SECOND NUMBER TO CHANGE THE ROWS lcd.setCursor(0, 1); // 1st column, 2nd row lcd.print("GOODLUCK ON YOUR"); lcd.setCursor(0, 0); // 1st column, 1st row lcd.print("EXAM, NAKSHOES!"); delay(1000);

Use Quizgecko on...
Browser
Browser