SlideShare a Scribd company logo
Library Requirements:
 Adafruit_BMP280_Library
 Adafruit-GFX-Library
 Adafruit_SSD1306
 MFRC522
 Adafruit_MPU6050.h
1. Soil moisture threshold check to actuate the relay
Code:
sensorValue = analogRead(sensorPin);
Set threshold to 400
If the sensor value is > the threshold
Trigger relay
To trigger relay
if (sensorValue > threshold limit) {
digitalWrite(A2, HIGH);
}
else {
digitalWrite(A2, LOW);
}
delay(1000);
}
Pin Connection
3V --> VCC
GND --> GND
A0 --> A0
2. Read Temperature & pressure using BMP sensor.
Note that, you can change the I2C address without modifying the library, just
type: bmp.begin(0x77);
Code:
#include <Adafruit_BMP280.h>
Adafruit_BMP280 bmp; // I2C Interface
void setup() {
Serial.begin(9600);
Serial.println(F("BMP280 test"));
bmp.begin();
}
void loop() {
Serial.print(F("Temperature = "));
Serial.print(bmp.readTemperature());
Serial.println(" *C");
Serial.print(F("Pressure = "));
Serial.print(bmp.readPressure()/100); //displaying the Pressure
in hPa, you can change the unit
Serial.println(" hPa");
Serial.print(F("Approx altitude = "));
Serial.print(bmp.readAltitude(1019.66));
//The "1019.66" is the pressure(hPa) at sea
level in day in your region
Serial.println(" m");
//If you don't know it, modify it until you
get your current altitude
Serial.println();
delay(2000);
}
3. Using RFID to display welcome message on Serial
OLED Display - Arduino
Vcc - 3.3V
GND - GND
SCL - Analog Pin 5
SDA - Analog Pin 4
Code:
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
MFRC522 rfid(SS_PIN, RST_PIN); // Instance of the class
MFRC522::MIFARE_Key key;
// Init array that will store new NUID
byte nuidPICC[4];
void setup() {
Serial.begin(9600);
SPI.begin(); // Init SPI bus
rfid.PCD_Init(); // Init MFRC522
for (byte i = 0; i < 6; i++) {
key.keyByte[i] = 0xFF;
}
RFID Reader - Arduino
RST ▶ Digital Pin 9
IRQ ▶ Unconnected
MISO ▶ Digital Pin 12
MOSI ▶ Digital Pin 11
SCK ▶ Digital Pin 13
SDA ▶ Digital Pin 10
}
void loop() {
// Reset the loop if no new card present on the sensor/reader.
This saves the entire process when idle.
if ( ! rfid.PICC_IsNewCardPresent())
return;
// Verify if the NUID has been readed
if ( ! rfid.PICC_ReadCardSerial())
return;
Serial.print(F("PICC type: "));
MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak);
Serial.println(rfid.PICC_GetTypeName(piccType));
if (rfid.uid.uidByte[0] != nuidPICC[0] ||
rfid.uid.uidByte[1] != nuidPICC[1] ||
rfid.uid.uidByte[2] != nuidPICC[2] ||
rfid.uid.uidByte[3] != nuidPICC[3] ) {
Serial.println(F("A new card has been detected."));
// Store NUID into nuidPICC array
for (byte i = 0; i < 4; i++) {
nuidPICC[i] = rfid.uid.uidByte[i];
}
Serial.println(F("The NUID tag is:"));
Serial.print(F("In hex: "));
printHex(rfid.uid.uidByte, rfid.uid.size);
Serial.println();
Serial.print(F("In dec: "));
printDec(rfid.uid.uidByte, rfid.uid.size);
Serial.println();
}
else Serial.println(F("Card read previously."));
// Halt PICC
rfid.PICC_HaltA();
// Stop encryption on PCD
rfid.PCD_StopCrypto1();
}
/**
* Helper routine to dump a byte array as hex values to Serial.
*/
void printHex(byte *buffer, byte bufferSize) {
for (byte i = 0; i < bufferSize; i++) {
Serial.print(buffer[i] < 0x10 ? " 0" : " ");
Serial.print(buffer[i], HEX);
}
}
/**
* Helper routine to dump a byte array as dec values to Serial.
*/
void printDec(byte *buffer, byte bufferSize) {
for (byte i = 0; i < bufferSize; i++) {
Serial.print(buffer[i] < 0x10 ? " 0" : " ");
Serial.print(buffer[i], DEC);
}
}
4. Ultrasonic sensor to find the distance & height
int trigPin = 6; // HC-SR04 trigger pin
int echoPin = 7; // HC-SR04 echo pin
float duration, distance;
void setup()
{
Serial.begin(9600);
pinMode(trigPin, OUTPUT); // define trigger pin as output
}
void loop()
{
digitalWrite(echoPin, LOW); // set the echo pin LOW
digitalWrite(trigPin, LOW); // set the trigger pin LOW
delayMicroseconds(2);
digitalWrite(trigPin, HIGH); // set the trigger pin HIGH for 10μs
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH); // measure the echo time (μs)
distance = (duration/2.0)*0.0343; // convert echo time to
distance (cm)
if(distance>400 || distance<2)
Serial.println("0");
else
{
Serial.print("90, ");
Serial.print(distance, 1);
Serial.println(" ,cm");
}
delay(1000);
}
5. Accelerometer to find out the vibrations and see the plottings
// Basic demo for accelerometer readings from Adafruit MPU6050
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
Adafruit_MPU6050 mpu;
void setup(void) {
Serial.begin(115200);
mpu.begin();
mpu.setAccelerometerRange(MPU6050_RANGE_16_G);
mpu.setGyroRange(MPU6050_RANGE_250_DEG);
mpu.setFilterBandwidth(MPU6050_BAND_21_HZ);
Serial.println("");
delay(100);
}
void loop() {
/* Get new sensor events with the readings */
sensors_event_t a, g, temp;
mpu.getEvent(&a, &g, &temp);
/* Print out the values */
Serial.print(a.acceleration.x);
Serial.print(",");
Serial.print(a.acceleration.y);
Serial.print(",");
Serial.print(a.acceleration.z);
Serial.print(", ");
Serial.print(g.gyro.x);
Serial.print(",");
Serial.print(g.gyro.y);
Serial.print(",");
Serial.print(g.gyro.z);
Serial.println("");
delay(10);
}

More Related Content

What's hot

iCloud keychain
iCloud keychainiCloud keychain
iCloud keychain
Alexey Troshichev
 
Switch & LED using TMS320C6745 DSP
Switch & LED using TMS320C6745 DSPSwitch & LED using TMS320C6745 DSP
Switch & LED using TMS320C6745 DSP
Pantech ProLabs India Pvt Ltd
 
Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+
Eueung Mulyana
 
selected input/output - sensors and actuators
selected input/output - sensors and actuatorsselected input/output - sensors and actuators
selected input/output - sensors and actuators
Eueung Mulyana
 
ゆるふわコンピュータ (IPSJ-ONE2017)
ゆるふわコンピュータ (IPSJ-ONE2017)ゆるふわコンピュータ (IPSJ-ONE2017)
ゆるふわコンピュータ (IPSJ-ONE2017)
Shinya Takamaeda-Y
 
Led blinking using TMS320C6745
Led blinking using TMS320C6745Led blinking using TMS320C6745
Led blinking using TMS320C6745
Pantech ProLabs India Pvt Ltd
 
Computron príručka
Computron príručkaComputron príručka
Computron príručka
Michaela Bačíková
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programs
Gouthaman V
 
Cisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-oneCisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-one
DefconRussia
 
Vectorization on x86: all you need to know
Vectorization on x86: all you need to knowVectorization on x86: all you need to know
Vectorization on x86: all you need to know
Roberto Agostino Vitillo
 
Classical cryptography
Classical cryptographyClassical cryptography
Classical cryptography
Aravindharamanan S
 
Classical cryptography1
Classical cryptography1Classical cryptography1
Classical cryptography1
Aravindharamanan S
 
Seven segment display
Seven segment displaySeven segment display
Seven segment display
Murali Sahukari
 
Q 1
Q 1Q 1
深入淺出C語言
深入淺出C語言深入淺出C語言
深入淺出C語言
Simen Li
 
Dsd lab Practical File
Dsd lab Practical FileDsd lab Practical File
Dsd lab Practical File
Soumya Behera
 
Codes
CodesCodes
Interfacing UART with tms320C6745
Interfacing UART with tms320C6745Interfacing UART with tms320C6745
Interfacing UART with tms320C6745
Pantech ProLabs India Pvt Ltd
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programming
The IOT Academy
 
Exploring the x64
Exploring the x64Exploring the x64
Exploring the x64
FFRI, Inc.
 

What's hot (20)

iCloud keychain
iCloud keychainiCloud keychain
iCloud keychain
 
Switch & LED using TMS320C6745 DSP
Switch & LED using TMS320C6745 DSPSwitch & LED using TMS320C6745 DSP
Switch & LED using TMS320C6745 DSP
 
Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+
 
selected input/output - sensors and actuators
selected input/output - sensors and actuatorsselected input/output - sensors and actuators
selected input/output - sensors and actuators
 
ゆるふわコンピュータ (IPSJ-ONE2017)
ゆるふわコンピュータ (IPSJ-ONE2017)ゆるふわコンピュータ (IPSJ-ONE2017)
ゆるふわコンピュータ (IPSJ-ONE2017)
 
Led blinking using TMS320C6745
Led blinking using TMS320C6745Led blinking using TMS320C6745
Led blinking using TMS320C6745
 
Computron príručka
Computron príručkaComputron príručka
Computron príručka
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programs
 
Cisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-oneCisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-one
 
Vectorization on x86: all you need to know
Vectorization on x86: all you need to knowVectorization on x86: all you need to know
Vectorization on x86: all you need to know
 
Classical cryptography
Classical cryptographyClassical cryptography
Classical cryptography
 
Classical cryptography1
Classical cryptography1Classical cryptography1
Classical cryptography1
 
Seven segment display
Seven segment displaySeven segment display
Seven segment display
 
Q 1
Q 1Q 1
Q 1
 
深入淺出C語言
深入淺出C語言深入淺出C語言
深入淺出C語言
 
Dsd lab Practical File
Dsd lab Practical FileDsd lab Practical File
Dsd lab Practical File
 
Codes
CodesCodes
Codes
 
Interfacing UART with tms320C6745
Interfacing UART with tms320C6745Interfacing UART with tms320C6745
Interfacing UART with tms320C6745
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programming
 
Exploring the x64
Exploring the x64Exploring the x64
Exploring the x64
 

Similar to Solution doc

Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016
Svet Ivantchev
 
UDP.yash
UDP.yashUDP.yash
UDP.yash
Yashpatel821746
 
Attendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQLAttendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQL
Sanjay Kumar
 
Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013
Tom Paulus
 
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
hussain0075468
 
An Example MIPS
An Example  MIPSAn Example  MIPS
An Example MIPS
Sandra Long
 
Monitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMonitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recording
Yuda Wardiana
 
What will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdfWhat will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdf
SIGMATAX1
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
SANTIAGO PABLO ALBERTO
 
Arduino shield wifi-monitorizarelocuinta
Arduino shield wifi-monitorizarelocuintaArduino shield wifi-monitorizarelocuinta
Arduino shield wifi-monitorizarelocuinta
Iulius Bors
 
Monitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMonitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recording
MR Selamet
 
Monitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdMonitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcd
siti_haryani
 
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
Wataru Kani
 
Arduino Programming
Arduino ProgrammingArduino Programming
Arduino Programming
Dr Karthikeyan Periasamy
 
用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver
艾鍗科技
 
Monitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdMonitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcd
mukhammadimam
 
Monitoring Temperature Room With Display LCD and Data Recording
Monitoring Temperature Room With Display LCD and Data RecordingMonitoring Temperature Room With Display LCD and Data Recording
Monitoring Temperature Room With Display LCD and Data Recording
MR Selamet
 
FINISHED_CODE
FINISHED_CODEFINISHED_CODE
FINISHED_CODE
Jeremy Forczyk
 
Spectre(v1%2 fv2%2fv4) v.s. meltdown(v3)
Spectre(v1%2 fv2%2fv4) v.s. meltdown(v3)Spectre(v1%2 fv2%2fv4) v.s. meltdown(v3)
Spectre(v1%2 fv2%2fv4) v.s. meltdown(v3)
Gavin Guo
 
Arduino
ArduinoArduino

Similar to Solution doc (20)

Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016
 
UDP.yash
UDP.yashUDP.yash
UDP.yash
 
Attendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQLAttendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQL
 
Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013Getting Started With Raspberry Pi - UCSD 2013
Getting Started With Raspberry Pi - UCSD 2013
 
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
 
An Example MIPS
An Example  MIPSAn Example  MIPS
An Example MIPS
 
Monitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMonitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recording
 
What will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdfWhat will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdf
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
 
Arduino shield wifi-monitorizarelocuinta
Arduino shield wifi-monitorizarelocuintaArduino shield wifi-monitorizarelocuinta
Arduino shield wifi-monitorizarelocuinta
 
Monitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMonitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recording
 
Monitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdMonitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcd
 
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
 
Arduino Programming
Arduino ProgrammingArduino Programming
Arduino Programming
 
用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver
 
Monitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdMonitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcd
 
Monitoring Temperature Room With Display LCD and Data Recording
Monitoring Temperature Room With Display LCD and Data RecordingMonitoring Temperature Room With Display LCD and Data Recording
Monitoring Temperature Room With Display LCD and Data Recording
 
FINISHED_CODE
FINISHED_CODEFINISHED_CODE
FINISHED_CODE
 
Spectre(v1%2 fv2%2fv4) v.s. meltdown(v3)
Spectre(v1%2 fv2%2fv4) v.s. meltdown(v3)Spectre(v1%2 fv2%2fv4) v.s. meltdown(v3)
Spectre(v1%2 fv2%2fv4) v.s. meltdown(v3)
 
Arduino
ArduinoArduino
Arduino
 

More from JIGAR MAKHIJA

Php gd library
Php gd libraryPhp gd library
Php gd library
JIGAR MAKHIJA
 
Php pattern matching
Php pattern matchingPhp pattern matching
Php pattern matching
JIGAR MAKHIJA
 
Php cookies
Php cookiesPhp cookies
Php cookies
JIGAR MAKHIJA
 
Php functions
Php functionsPhp functions
Php functions
JIGAR MAKHIJA
 
Php sessions
Php sessionsPhp sessions
Php sessions
JIGAR MAKHIJA
 
Php server variables
Php server variablesPhp server variables
Php server variables
JIGAR MAKHIJA
 
Db function
Db functionDb function
Db function
JIGAR MAKHIJA
 
C++ version 1
C++  version 1C++  version 1
C++ version 1
JIGAR MAKHIJA
 
C++ Version 2
C++  Version 2C++  Version 2
C++ Version 2
JIGAR MAKHIJA
 
SAP Ui5 content
SAP Ui5 contentSAP Ui5 content
SAP Ui5 content
JIGAR MAKHIJA
 
Overview on Application protocols in Internet of Things
Overview on Application protocols in Internet of ThingsOverview on Application protocols in Internet of Things
Overview on Application protocols in Internet of Things
JIGAR MAKHIJA
 
125 green iot
125 green iot125 green iot
125 green iot
JIGAR MAKHIJA
 
Msp430 g2 with ble(Bluetooth Low Energy)
Msp430 g2 with ble(Bluetooth Low Energy)Msp430 g2 with ble(Bluetooth Low Energy)
Msp430 g2 with ble(Bluetooth Low Energy)
JIGAR MAKHIJA
 
Embedded system lab work
Embedded system lab workEmbedded system lab work
Embedded system lab work
JIGAR MAKHIJA
 
Presentation on iot- Internet of Things
Presentation on iot- Internet of ThingsPresentation on iot- Internet of Things
Presentation on iot- Internet of Things
JIGAR MAKHIJA
 
Oracle
OracleOracle
Learn Japanese -Basic kanji 120
Learn Japanese -Basic kanji 120Learn Japanese -Basic kanji 120
Learn Japanese -Basic kanji 120
JIGAR MAKHIJA
 
View Alignment Techniques
View Alignment TechniquesView Alignment Techniques
View Alignment Techniques
JIGAR MAKHIJA
 
Letters (complaints & invitations)
Letters (complaints & invitations)Letters (complaints & invitations)
Letters (complaints & invitations)
JIGAR MAKHIJA
 
Letter Writing invitation-letter
Letter Writing invitation-letterLetter Writing invitation-letter
Letter Writing invitation-letter
JIGAR MAKHIJA
 

More from JIGAR MAKHIJA (20)

Php gd library
Php gd libraryPhp gd library
Php gd library
 
Php pattern matching
Php pattern matchingPhp pattern matching
Php pattern matching
 
Php cookies
Php cookiesPhp cookies
Php cookies
 
Php functions
Php functionsPhp functions
Php functions
 
Php sessions
Php sessionsPhp sessions
Php sessions
 
Php server variables
Php server variablesPhp server variables
Php server variables
 
Db function
Db functionDb function
Db function
 
C++ version 1
C++  version 1C++  version 1
C++ version 1
 
C++ Version 2
C++  Version 2C++  Version 2
C++ Version 2
 
SAP Ui5 content
SAP Ui5 contentSAP Ui5 content
SAP Ui5 content
 
Overview on Application protocols in Internet of Things
Overview on Application protocols in Internet of ThingsOverview on Application protocols in Internet of Things
Overview on Application protocols in Internet of Things
 
125 green iot
125 green iot125 green iot
125 green iot
 
Msp430 g2 with ble(Bluetooth Low Energy)
Msp430 g2 with ble(Bluetooth Low Energy)Msp430 g2 with ble(Bluetooth Low Energy)
Msp430 g2 with ble(Bluetooth Low Energy)
 
Embedded system lab work
Embedded system lab workEmbedded system lab work
Embedded system lab work
 
Presentation on iot- Internet of Things
Presentation on iot- Internet of ThingsPresentation on iot- Internet of Things
Presentation on iot- Internet of Things
 
Oracle
OracleOracle
Oracle
 
Learn Japanese -Basic kanji 120
Learn Japanese -Basic kanji 120Learn Japanese -Basic kanji 120
Learn Japanese -Basic kanji 120
 
View Alignment Techniques
View Alignment TechniquesView Alignment Techniques
View Alignment Techniques
 
Letters (complaints & invitations)
Letters (complaints & invitations)Letters (complaints & invitations)
Letters (complaints & invitations)
 
Letter Writing invitation-letter
Letter Writing invitation-letterLetter Writing invitation-letter
Letter Writing invitation-letter
 

Recently uploaded

Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 

Recently uploaded (20)

Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 

Solution doc

  • 1. Library Requirements:  Adafruit_BMP280_Library  Adafruit-GFX-Library  Adafruit_SSD1306  MFRC522  Adafruit_MPU6050.h 1. Soil moisture threshold check to actuate the relay Code: sensorValue = analogRead(sensorPin); Set threshold to 400 If the sensor value is > the threshold Trigger relay To trigger relay if (sensorValue > threshold limit) { digitalWrite(A2, HIGH); } else { digitalWrite(A2, LOW); } delay(1000); } Pin Connection 3V --> VCC GND --> GND A0 --> A0 2. Read Temperature & pressure using BMP sensor. Note that, you can change the I2C address without modifying the library, just type: bmp.begin(0x77); Code: #include <Adafruit_BMP280.h> Adafruit_BMP280 bmp; // I2C Interface void setup() { Serial.begin(9600); Serial.println(F("BMP280 test")); bmp.begin(); } void loop() {
  • 2. Serial.print(F("Temperature = ")); Serial.print(bmp.readTemperature()); Serial.println(" *C"); Serial.print(F("Pressure = ")); Serial.print(bmp.readPressure()/100); //displaying the Pressure in hPa, you can change the unit Serial.println(" hPa"); Serial.print(F("Approx altitude = ")); Serial.print(bmp.readAltitude(1019.66)); //The "1019.66" is the pressure(hPa) at sea level in day in your region Serial.println(" m"); //If you don't know it, modify it until you get your current altitude Serial.println(); delay(2000); } 3. Using RFID to display welcome message on Serial OLED Display - Arduino Vcc - 3.3V GND - GND SCL - Analog Pin 5 SDA - Analog Pin 4 Code: #include <SPI.h> #include <MFRC522.h> #define SS_PIN 10 #define RST_PIN 9 MFRC522 rfid(SS_PIN, RST_PIN); // Instance of the class MFRC522::MIFARE_Key key; // Init array that will store new NUID byte nuidPICC[4]; void setup() { Serial.begin(9600); SPI.begin(); // Init SPI bus rfid.PCD_Init(); // Init MFRC522 for (byte i = 0; i < 6; i++) { key.keyByte[i] = 0xFF; } RFID Reader - Arduino RST ▶ Digital Pin 9 IRQ ▶ Unconnected MISO ▶ Digital Pin 12 MOSI ▶ Digital Pin 11 SCK ▶ Digital Pin 13 SDA ▶ Digital Pin 10
  • 3. } void loop() { // Reset the loop if no new card present on the sensor/reader. This saves the entire process when idle. if ( ! rfid.PICC_IsNewCardPresent()) return; // Verify if the NUID has been readed if ( ! rfid.PICC_ReadCardSerial()) return; Serial.print(F("PICC type: ")); MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak); Serial.println(rfid.PICC_GetTypeName(piccType)); if (rfid.uid.uidByte[0] != nuidPICC[0] || rfid.uid.uidByte[1] != nuidPICC[1] || rfid.uid.uidByte[2] != nuidPICC[2] || rfid.uid.uidByte[3] != nuidPICC[3] ) { Serial.println(F("A new card has been detected.")); // Store NUID into nuidPICC array for (byte i = 0; i < 4; i++) { nuidPICC[i] = rfid.uid.uidByte[i]; } Serial.println(F("The NUID tag is:")); Serial.print(F("In hex: ")); printHex(rfid.uid.uidByte, rfid.uid.size); Serial.println(); Serial.print(F("In dec: ")); printDec(rfid.uid.uidByte, rfid.uid.size); Serial.println(); } else Serial.println(F("Card read previously.")); // Halt PICC rfid.PICC_HaltA(); // Stop encryption on PCD rfid.PCD_StopCrypto1(); } /** * Helper routine to dump a byte array as hex values to Serial. */ void printHex(byte *buffer, byte bufferSize) { for (byte i = 0; i < bufferSize; i++) { Serial.print(buffer[i] < 0x10 ? " 0" : " "); Serial.print(buffer[i], HEX); } }
  • 4. /** * Helper routine to dump a byte array as dec values to Serial. */ void printDec(byte *buffer, byte bufferSize) { for (byte i = 0; i < bufferSize; i++) { Serial.print(buffer[i] < 0x10 ? " 0" : " "); Serial.print(buffer[i], DEC); } } 4. Ultrasonic sensor to find the distance & height int trigPin = 6; // HC-SR04 trigger pin int echoPin = 7; // HC-SR04 echo pin float duration, distance; void setup() { Serial.begin(9600); pinMode(trigPin, OUTPUT); // define trigger pin as output } void loop() { digitalWrite(echoPin, LOW); // set the echo pin LOW digitalWrite(trigPin, LOW); // set the trigger pin LOW delayMicroseconds(2); digitalWrite(trigPin, HIGH); // set the trigger pin HIGH for 10μs delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); // measure the echo time (μs) distance = (duration/2.0)*0.0343; // convert echo time to distance (cm) if(distance>400 || distance<2) Serial.println("0"); else { Serial.print("90, "); Serial.print(distance, 1); Serial.println(" ,cm"); } delay(1000); } 5. Accelerometer to find out the vibrations and see the plottings // Basic demo for accelerometer readings from Adafruit MPU6050 #include <Adafruit_MPU6050.h> #include <Adafruit_Sensor.h> #include <Wire.h> Adafruit_MPU6050 mpu;
  • 5. void setup(void) { Serial.begin(115200); mpu.begin(); mpu.setAccelerometerRange(MPU6050_RANGE_16_G); mpu.setGyroRange(MPU6050_RANGE_250_DEG); mpu.setFilterBandwidth(MPU6050_BAND_21_HZ); Serial.println(""); delay(100); } void loop() { /* Get new sensor events with the readings */ sensors_event_t a, g, temp; mpu.getEvent(&a, &g, &temp); /* Print out the values */ Serial.print(a.acceleration.x); Serial.print(","); Serial.print(a.acceleration.y); Serial.print(","); Serial.print(a.acceleration.z); Serial.print(", "); Serial.print(g.gyro.x); Serial.print(","); Serial.print(g.gyro.y); Serial.print(","); Serial.print(g.gyro.z); Serial.println(""); delay(10); }