0% found this document useful (0 votes)
2 views

Explosives Detection using Magnetometer and Arudino

major project

Uploaded by

Aridaman Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Explosives Detection using Magnetometer and Arudino

major project

Uploaded by

Aridaman Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Explosives Detection using

Magnetometer and Arduino

Group - 17 Under the supervision of


Kunwar Aridaman Singh (20215086)
Ashutosh Kumar (20215007) Dr. Manish Tiwari
Harshit Maurya (20215087) ECED MNNIT
ALLAHABAD
Introduction
•Innovative approach to explosive detection using magnetic field sensing

•Utilizes Arduino microcontroller and HMC5883L magnetometer

•Detects magnetic field disturbances caused by materials in explosive devices

•Offers a non-invasive, cost-effective, and portable solution for initial screening

•Aims to enhance security measures in various settings


Ways of Explosion Detection and Advantage of
using Magnetometer
Common Detection Methods:
• Chemical trace detection
• X-ray imaging
• Neutron activation analysis
• Vapor detection (sniffer dogs)
• Metal detectors

Our Approach: Magnetometer-Based Detection


Why Magnetometer?
•Non-invasive
•No radiation exposure
•Cost-effective
•Portable and compact
•Can detect through non-metallic barriers
•Detects magnetic signatures of common explosive components
Working Principle
Key Principle: Exploits the magnetic signatures of materials commonly found in explosive devices to detect
their presence non-invasively.

1. Baseline Calibration:
• Device measures the ambient magnetic field and establishes a baseline for "normal" conditions
2. Continuous Monitoring:
• The HMC5883L magnetometer constantly measures magnetic field strength in the X, Y, and Z axes
3. Magnetic Field Disturbance:
• Ferromagnetic materials in explosive devices distort Earth's magnetic field
• Creates measurable deviations from the baseline
4. Data Processing:
• Arduino compares real-time measurements to the baseline
• Calculates the magnitude of deviation
5. Threshold Detection:
• If deviation exceeds a predefined threshold, it triggers an alert
• Threshold determined through testing and calibration
6. Alert System:
• Significant deviations activate LED and buzzer
Three-Axis
Digital
Compass IC
HMC5883L
The Honeywell HMC5883L is a
surface-mount, multi-chip
module designed for low-field Features- Benefits
magnetic sensing with a digital  Three-Axis Magnetoresistive  Small Size for Highly
interface for applications such Sensors and ASIC in a
as low cost compassing and Integrated Products.
3.0x3.0x0.9mm LCC Surface Mount  Enables 1° to 2° Degree
magnetometry. The HMC5883L
utilizes Honeywell’s Anisotropic Package
 12-Bit ADC Coupled with Low
Compass Heading Accuracy
Magnetoresistive (AMR)  Enables Low-Cost
technology that provides Noise AMR Sensors Achieves 5
advantages over other milli-gauss Resolution in ±8 Gauss Functionality Test after
magnetic sensor technologies. Fields Assembly in Production
These anisotropic, directional  Built-In Self Test  Popular Two-Wire Serial
sensors feature precision in-  Low Voltage Operations (2.16 to Data Interface for
axis sensitivity and linearity. 3.6V) and Low Power Consumption Consumer Electronicc
(100 μA)
Magnetoresistive Effect (Core
Principle)
The HMC5883L uses the magnetoresistive effect to detect magnetic fields. The
magnetoresistive effect refers to the change in the electrical resistance of a material
when exposed to a magnetic field. The sensor has small resistive elements that
change their resistance when the external magnetic field changes.

Anisotropic Magnetoresistive (AMR)


Sensors: The HMC5883L employs AMR
sensors made of ferromagnetic material.
When an external magnetic field interacts
with the sensor’s magnetic domains, the
resistance of the material changes
proportionally to the strength and direction
of the magnetic field.
Workflow-
•Step 1: The HMC5883L's magnetoresistive elements detect the magnetic field on the X, Y, and Z axes.

•Step 2: These changes in the magnetic field are converted into voltage changes due to the

magnetoresistive effect.

•Step 3: The sensor's internal ADC converts the analog voltage changes into digital values (16-bit signed

integers).

•Step 4:Calibration is performed to adjust for any sensor offsets or errors, ensuring accurate magnetic

field readings.

•Step 5: The calculated magnetic field strength is compared with the baseline value to detect changes or

disturbances.

•Step 6: If the change exceeds the threshold, metal or another magnetic disturbance is detected.
Block Diagram
Interfacing HMC5883L with Arduino
Control of this device is carried
out via the I2C bus. This device
will be connected to this bus as a
slave device under the control of
a master device, here, the
Arudino. This allows the sensor
to send its magnetic field data to
the Arduino using just two
communication lines: SCL (Serial
Clock Line) and SDA (Serial Data
Access).
What is I2C Communication?
I2C (Inter-Integrated Circuit) is a simple, two-wire communication protocol that allows multiple devices
(sensors, controllers, etc.) to communicate with a microcontroller like the Arduino. It’s widely used for
interfacing low-speed peripherals such as the HMC5883L magnetometer.

Key Features of I2C:


•Two Wires: Only two communication lines are required:
• SCL (Serial Clock Line): Sends the clock signal to synchronize data transfer between the devices.
• SDA (Serial Data Line): Carries the actual data being transmitted.
•Master-Slave Architecture: The communication happens between a master (Arduino) and slave devices
(HMC5883L):
• The master controls the clock and initiates communication.
• The slave responds by sending or receiving data.
I2C Communication Protocol
Steps of I2C Data Transmission?
Here are the steps of I2C (Inter-Integrated Circuit) data
transmission
•Start Condition: The master device sends a start condition
by pulling the SDA line low while the SCL line is high. This
signals that a transmission is about to begin.
•Addressing the Slave: The master sends the 7-bit address
of the slave device it wants to communicate with, followed by
a read/write bit. The read/write bit indicates whether it wants
to read from or write to the slave.
•Acknowledge Bit (ACK): The addressed slave device
responds by pulling the SDA line low during the next clock
pulse (SCL). This confirms that the slave is ready to
communicate.
•Data Transmission: The master or slave (depending on the
read/write operation) sends data in 8-bit chunks. After each
byte, an ACK is sent to confirm that the data has been
received successfully.
•Stop Condition: When the transmission is complete, the
master sends a stop condition by releasing the SDA line to
high while the SCL line is high. This signals that the
communication session has ended.
Circuit Diagram
The connections are established
as shown in the above figure
using jumper wires and
connectors, The USB to serial
convertor is used to transfer the
code into the arudino.
Connecting the HMC5883L to Arduino
Pin Configuration of the HMC5883L:
•VCC: Power supply (3.3V or 5V)
•GND: Ground
•SDA: Serial Data Line (for communication)
•SCL: Serial Clock Line (for synchronization)

Wiring the HMC5883L to Arduino:


•VCC to 3.3V/5V: Connect the VCC pin of the HMC5883L to the 3.3V or 5V pin on the Arduino. (Most modules are compatible
with both voltages, but 3.3V is often preferred for stability).
•GND to GND: Connect the GND pin of the HMC5883L to the GND pin on the Arduino.
•SDA to A4: Connect the SDA pin of the HMC5883L to the A4 pin on the Arduino for data transmission.
•SCL to A5: Connect the SCL pin of the HMC5883L to the A5 pin on the Arduino for the clock signal.
Arduino Code for Magnetometer Calibration
#include <QMC5883LCompass.h> Importing the Necessary Libraries:
•The Wire library is used for I2C
QMC5883LCompass compass; communication.
int led=10; •The QMC5883L library simplifies
int st_x=0; interaction with the magnetometer.
int st_y=0;
int st_z=0;

void setup() { Serial.begin(9600);


compass.init(); Setting up the arudino:
Serial.println("This will provide calibration settings for .The setup() function initializes the I2C
your QMC5883L chip.When prompted, move the communication and the HMC5883L
magnetometer in all directions until the calibration is sensor
complete.");

Serial.println("Calibration will begin in 5 seconds.");


delay(5000);
Serial.println("CALIBRATING. Keep moving your
sensor..."); compass.calibrate();
Arduino Code for Magnetometer
Calibration
Serial.println(“Calibration Completed");
Serial.println();
Getting different values for
Serial.print("compass.setCalibrationOffsets(");
offsets:
Serial.print(compass.getCalibrationOffset(0));
Serial.print(", ");
The sensor’s, X,Y and Z-axis
Serial.print(compass.getCalibrationOffset(1));
magnetic field values and read
Serial.print(", ");
continuously
Serial.print(compass.getCalibrationOffset(2));
Serial.println(");");
The values and printed on the
Serial.print("compass.setCalibrationScales(");
serial monitor for real-time
Serial.print(compass.getCalibrationScale(0));
feedback.
Serial.print(", ");
Serial.print(compass.getCalibrationScale(1));
Serial.print(", ");
Serial.print(compass.getCalibrationScale(2));
Serial.println(");");
Calibration and Threshold Calculation
Threshold based metal detection-
1. Threshold logic-
Significant deviations from the baseline values (st_x, st_y, st_z) indicate a disturbance in the
magnetic field caused by the presence of a metal object.
A threshold of 200 units is applied to detect such variations.

2. Visual feedback-
If a magnetic field variation is detected:
The LED connected to pin 10 is turned on.
A message, “METAL DETECTED: Significant magnetic field Variation”, is displayed on the
serial monitor
Otherwise the LED remains off.
Reading the Magnetometer Compass Values
Serial.println("Put your sensor on flat surface");
delay(3000); compass.read();
st_x=compass.getX();
st_y=compass.getY();
st_z=compass.getZ();}

void loop() { int x, y, z;


// Read compass values
compass.read();
// Return XYZ readings
x = compass.getX();
y = compass.getY();
z = compass.getZ();
Threshold Comparison and Decision making
Serial.print("X: ");
Serial.print(x); If the values go above a
Serial.print(" Y: "); particular threshold, the
Serial.print(y); metal presence has been
Serial.print(" Z: "); detected.
Serial.print(z);
Serial.println();
if(abs(st_x - x)>=200 || abs(st_y - y)>=200 || abs(st_z - z)>=200){
digitalWrite(10, HIGH);
Serial.println("METAL DETECTED: Significant magnetic field variation!"); }
else{ digitalWrite(10, LOW); }}
The LED blinks when
the metal (lock) is
brought near the
magnetometer
sensor, hence the
presence of the
metal has been
detected.
Potential Applications of
Magnetometer-Based Explosive
Detection
•Airport Security: Enhancing preliminary screening processes

•Postal Services: Aiding in the identification of suspicious packages.

•Event Security: Providing an additional layer of threat detection at large gatherings.

•Law Enforcement: Assisting in covert investigations and surveillance.


THANK YOU!!

You might also like