SlideShare a Scribd company logo
1 of 5
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

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 actuatorsEueung Mulyana
 
ゆるふわコンピュータ (IPSJ-ONE2017)
ゆるふわコンピュータ (IPSJ-ONE2017)ゆるふわコンピュータ (IPSJ-ONE2017)
ゆるふわコンピュータ (IPSJ-ONE2017)Shinya Takamaeda-Y
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programsGouthaman V
 
Cisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-oneCisco IOS shellcode: All-in-one
Cisco IOS shellcode: All-in-oneDefconRussia
 
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 knowRoberto Agostino Vitillo
 
深入淺出C語言
深入淺出C語言深入淺出C語言
深入淺出C語言Simen Li
 
Dsd lab Practical File
Dsd lab Practical FileDsd lab Practical File
Dsd lab Practical FileSoumya Behera
 
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 programmingThe IOT Academy
 
Exploring the x64
Exploring the x64Exploring the x64
Exploring the x64FFRI, 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 2016Svet Ivantchev
 
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 MySQLSanjay 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 2013Tom 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 DHT11hussain0075468
 
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 recordingYuda 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.pdfSIGMATAX1
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxSANTIAGO PABLO ALBERTO
 
Arduino shield wifi-monitorizarelocuinta
Arduino shield wifi-monitorizarelocuintaArduino shield wifi-monitorizarelocuinta
Arduino shield wifi-monitorizarelocuintaIulius 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 recordingMR Selamet
 
Monitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdMonitoring temperature ruangan dengan display lcd
Monitoring temperature ruangan dengan display lcdsiti_haryani
 
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -Wataru Kani
 
用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 lcdmukhammadimam
 
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 RecordingMR Selamet
 
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
 

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 pattern matching
Php pattern matchingPhp pattern matching
Php pattern matchingJIGAR MAKHIJA
 
Php server variables
Php server variablesPhp server variables
Php server variablesJIGAR 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 ThingsJIGAR 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 workJIGAR MAKHIJA
 
Presentation on iot- Internet of Things
Presentation on iot- Internet of ThingsPresentation on iot- Internet of Things
Presentation on iot- Internet of ThingsJIGAR MAKHIJA
 
Learn Japanese -Basic kanji 120
Learn Japanese -Basic kanji 120Learn Japanese -Basic kanji 120
Learn Japanese -Basic kanji 120JIGAR MAKHIJA
 
View Alignment Techniques
View Alignment TechniquesView Alignment Techniques
View Alignment TechniquesJIGAR 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-letterJIGAR 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

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 

Recently uploaded (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 

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); }