This project, how to build an SMS-based metal detector design and construct a metal detector with SMS alert by incorporating a metal detector sensor to detect metallic objects in close proximity. It would instantly send out an SMS to a predefined personnel’s phone number once a metal or electronic device(s) was detected. The design has features like its portable size, and runs on rechargeable batteries. In designing this project, we had to calculate the feasibility of the needed materials’ cost in order to make sure that we were not undertaking an exorbitant project. This SMS-based metal detector project is about metal detector design with SMS notification. Below is a description of the components used for the implementation of the Metal Detector with SMS Alert system design.
In today’s world, ensuring the safety and security of public and private spaces is more important than ever. Whether it’s in airports, malls, schools, or offices, metal detectors play a crucial role in preventing unauthorized items from entering sensitive areas. However, integrating a smart notification system can enhance this even further. This is where an SMS-based metal detector comes in.
Imagine a system that can detect metals on a person and immediately send you an SMS alert to notify you. Such a system can be pivotal in monitoring areas remotely and quickly responding to potential threats. In this tutorial, we’ll walk you through how to build an SMS-based metal detector using Arduino, a GSM module, and other components that will make your metal detection project both effective and scalable.
An SMS-based metal detector is a smart security system designed to detect the presence of metal objects on an individual’s body and send an SMS notification to a specified recipient when metal is detected. The core functionality of the system relies on a metal detection sensor, which senses metal objects and triggers an SMS through the GSM module.
This system can be installed at various checkpoints, providing an alert mechanism for security personnel. Whether it’s detecting concealed weapons or other unauthorized metallic items, this tool can significantly enhance security.
The working principle of this system is simple yet effective. When a metal object comes within the detection range of the sensor, it sends a signal to the Arduino, which is the main controller. The Arduino processes this input and sends a command to the GSM module, which in turn sends an SMS to a pre-configured mobile number, alerting the security personnel.
This makes it particularly useful for real-time monitoring of restricted areas. Additionally, this system can be customized to operate efficiently in different environments, making it a versatile solution for various security applications.
Buy the complete kit for this project on our online store or kindly chat us on WhatsApp
The Power Unit for the design depended mainly on DC supply from rechargeable batteries, each rated 3.7V 1800mAh. And 3 pieces of 3.7V 1800mAh Li-ion batteries gave us the needed Voltage for GSM module. Also, these were rechargeable batteries so we used Lipo battery charging board.
The 3.7V rechargeable battery can output a current of 1.8A for one hour. It is durable and can be charged very quickly. It is also portable and, as such, was ideal for using as a power source for the project design.
Read Also How to Make Money as A student with these 10 Free Money-Making Sites
The above pictured batteries needed a casing, so we used one 3.6V-3.7V Battery Charging Discharging Control Holder Case. Li-ion battery with 1S3P PCM.
This is a plastic DIY Lithium battery box battery holder with pin suitable for 2×18650 (3.7V-7.4V) Lipo battery. The casing is of high quality and can withstand temperatures of about 95°C. It maintains firm hold with the batteries inside it and offers safety from short circuiting and wire burn out. A total of 3 battery were connected in series to give us a 12V approximately 5A output for the GSM module.
The Lipo charging board module uses mature charging chip TP4056, simple peripheral circuits that has good protection performance and high charging accuracy. It comes with full machinery automated processing and has high reliability. Its output charging current can be adjusted by just changing the circuit board fixed resistors, this would in turn change the output current to the 100mA-1000mA. The Input reverse connection has no effect on the chip, but the output (battery end) reverse connection will burn out the chip. When measuring with an Ampere meter, it is best in series connected to the 5V input end. The charging current is best to be 0.37 times of the battery capacity,
It is very convenient for portability an size conservation. Below is a summary of its datasheet.
The voltage regulator IC, L232T is used to provide a regulated 5V DC output. Input voltage fed into the input pin (pin 1) was 2 volts more than the rated output voltage (in our own case 12V) for proper working of Integrated Circuit (IC). For better results, a filter ripple capacitor of 1uF was connected to the output of the IC L323T to eliminate the noise, produced by transient changes in voltage.
Read Also How to Install CCTV Surveillance Cameras with Remote Viewing
This unit is mainly composed of the resistor, the inductor and the capacitor used to for the EMF pulsating device. In our design resistor-inductor-capacitive (RLC) circuit, we made us of a hand-made 150 coil turns of size wire gauge 30 wound about a diameter of 6cm to form the EMF emitting part of our design.
The whole SMS based Metal detector design depends on us building an LC high pass filter with the help of a coil and a capacitor. According to the equation of Mutual inductance;
Where,
L is Inductance in Henry
μo is permeability, its 4π*10-7 for Air
N is number of turns of wire coil
A is inner Core Area (πr2) in m2
L is length of the Coil in meters
Whenever a current passes through a coil, it generates a magnetic field around it. And the change in the magnetic field generates an electric field. Now according to Faraday’s law, because of this Electric field, a voltage develops across the coil which opposes the change in magnetic field and that’s how our coil develops the Inductance, means the generated voltage opposes the increase in the current.
When we place a metal near the coil, the coil changes its inductance. This change in inductance depends upon the metal type. And for a ferromagnetic material like iron, it increases. However, it decreases for non-magnetic materials.
The medium of flow of the magnetic field generated by the inductor is nothing in air. Depending on the core of the coil, the inductance value changes drastically.
The coil wound here is an air cored one, so when we bring a metal piece near the coil, the metal piece acts as a core for the air cored inductor. Hence, the inductance of the coil changes or increases considerably. With this sudden increase in inductance of coil the overall reactance or impedance of the LC circuit changes by a considerable amount when compared without the metal piece.
Polyester capacitors offer good stability and a large range of values at a low cost, and they are used for charging and discharging the inductor in the circuit of How to Build an SMS Based Metal Detector project design.
The 1N4148 is a standard silicon switching signal diode. This diode, 1N4148 can switch within applications of up to about 100 MHz with a reverse-recovery time of no more than 4 ns. It was fabricated in planar technology, and encapsulated in a hermetically sealed leaded glass DO-35 package.
SIM900L GSM/GPRS shield is a GSM modem. It allows what a normal cell phone can do: Make or receive phone calls, connect to internet through GPRS, TCP/IP, and more. It supports quad-band GSM/GPRS network, meaning it works pretty much anywhere in the world. The shield itself was designed to surround the SIM900L chip. We needed this module in this How to Build an SMS Based Metal Detector design so that it can allow us send short massage service (SMS) easily.
The LEDs blinking statuses on the SIM900L board has different interpretation. The LEDs on the board is two, namely:
Depending on which state it’s in, the SIM900 can be a relatively power-hungry device. The maximum current draw of the chip is around 2A during transmission burst. It usually won’t pull that much, but may require around 216mA during phone calls or 80mA during network transmissions.
To use the SIM900L, we hard to turn on the chip. To do this we had to press and hold (for a few seconds) the ON button by the side as shown in the figure above. But we needed to turn on the GSM module every time we power on the design. To do this we had to use the software trigger version of turn on the GSM module. We first connected the D9 of the SIM900L to D9 of the MCU. Next we soldered the SMD jumper as shown in the figure below:
The SIM900 GSM/GPRS shield uses universal asynchronous receiver-transmitter (UART) protocol to communicate with the MCU. The chip supports baud rate from 1200bps to 115200bps with Auto-Baud detection.
Afer ensuring that the jumper cap is placed on the software serial port select, we connected the MCU according to the circuit diagram shown in figure below.
Although the GSM module could also work on 5V DC but we connected the sim900L to an external power of source of not less than 7V 2A supply. The module adjustable voltage regulator makes it possible for it to handle the voltage at this level.
We used a 2G full sized SIM card and inserted it at the back of the module in its SIM socket. We were careful enough to unlock the latch, push the top part of the assembly, and then lift it up. We Placed the SIM card into the bottom part of the socket. Then fold the arm back into the body of the socket, and gently push it forward towards the LOCK position.
Hence, the new circuit diagram would be thus:
We send a pulse from our microcontroller to the RL high pass filter, as such, short spikes will be generated by the coil in every transition. The pulse length of the generated spikes is proportional to the inductance of the coil. So with the help of these spike pulses we can measure the inductance of Coil. But here it is difficult to measure inductance precisely with that spikes because that spikes are of very short duration. We used a capacitor to solve this problem which is charged by the rising pulse or spike. And it required few pulses to charge the capacitor to the point where its voltage can be read by analog pin ADC0. And the microcontroller reads the voltage of this capacitor by using ADC syntax. After reading voltage, capacitor quickly discharged since we made it an output and setting it to LOW. This whole process takes around 200 microseconds to complete. For better result, we repeat measurement and took an average of the results. That’s how we can measure the approximate inductance of Coil. After getting the result we transfer the results to the LED and buzzer to detect the presence of metal.
In our program for how to build an SMS-based metal detector project design, to be uploaded into the MCU, we created a function where we can turn on the sim900L using a software trigger. The syntax for the program was:
Testing Attention (AT) Commands:
For sending AT commands void SIM900power(){
pinMode(9, OUTPUT);
digitalWrite(9,LOW);
delay(1000);
digitalWrite(9,HIGH);
}
For sending AT commands and communicating with the SIM900 shield, we will use the serial monitor. Below codes are the the syntax that will enable the MCU to communicate with the SIM900 shield on serial monitor window.
//since we were using the software serial, we added the library
#include <SoftwareSerial.h>
//Create software serial object to communicate with SIM900
//SIM900 Tx & Rx is connected to MCU #7 & #8
SoftwareSerial mySerial(7, 8);
void setup()
{
//Begin serial communication
Serial.begin(9600);
//Begin serial communication with MCU and SIM900
mySerial.begin(9600);
Serial.println("Initializing...");
delay(1000);
//Handshaking with SIM900
mySerial.println("AT");
updateSerial();
//Signal quality test, value range is 0-31 , 31 is the best
mySerial.println("AT+CSQ");
updateSerial();
//Read SIM information to confirm whether the SIM is plugged
mySerial.println("AT+CCID");
updateSerial();
//Check whether it has registered in the network
mySerial.println("AT+CREG?");
updateSerial();
}
void loop()
{
updateSerial();
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
//Forward what Serial received to Software Serial Port
mySerial.write(Serial.read());
}
while(mySerial.available())
{
//Forward what Software Serial received to Serial Port
Serial.write(mySerial.read());
}
}
AT – It is the most basic AT command. It initializes Auto-baud’er. When this command worked, we saw its characters echo, telling us that it understood us correctly. This paved way for us to use some other commands to query the GSM module and get information like:
AT+CSQ – meaning check signal strength query; it checks the ‘signal strength’ – the first number is dB strength, it should be higher than around 5. For us, being higher is better. This our length and type of antenna and location played a very vital role in that.
AT+CCID – this command gets the SIM card number – it tests that the SIM card is found OK and using it we verified the number written on the card.
AT+CREG? This command checks if the SIM is on a registered network Check that you’re registered on the network. The second number should be 1 or 5. If 1, it showed that our SIM was on a registered home network and 5 indicates roaming network. Any other number than these two numbers showed our SIM was not registered to any network.
The Power Supply for the design consist of two LiPo 4.2V 3800mAH batteries connected in series. In order to recharge these batteries we had to use a single 4.2 1A charger and connected the outputs in parallel the batteries terminals. But the series connection posed a problem so we had to add two switches that would open the series connection when it is time for charging and close it when we are not charging the batteries as shown above.
The microcontroller uses 5V DC supply and the 8.4V formed by the series connection of the two batteries would only fry it. So we used a step-down converter of a 78xx series family viz; LM323T. It regulated the input voltage to a steady 5V output at 2A current for the Vcc of the MCU.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(7, 8);
int Seven = 10;
#define capPin A1
#define buz 11
#define pulsePin A0
#define led 12
#define ledRead 6
#define led2 5
long sumExpect=0; //running sum of 64 sums
long ignor=0; //number of ignored sums
long diff=0; //difference between sum and avgsum
long pTime=0;
long buzPeriod=0;
void setup()
{
mySerial.begin(9600); // Setting the baud rate of GSM Module
Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)
pinMode(Seven, INPUT);
delay(100);
pinMode(pulsePin, OUTPUT);
digitalWrite(pulsePin, LOW);
pinMode(capPin, INPUT);
pinMode(buz, OUTPUT);
pinMode(ledRead, INPUT);
pinMode(led2, OUTPUT);
digitalWrite(buz, LOW);
pinMode(led, OUTPUT);
pinMode(9, OUTPUT);
//this turns on the sim900 automatcally
digitalWrite(9,LOW);
delay(1000);
digitalWrite(9,HIGH);
delay(2000);
digitalWrite(9,LOW);
//wait for 3sec
delay(3000);
}
void SendMessage()
{
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS=\"+2347062174135\"\r"); // Replace this with mobile number
delay(1000);
mySerial.println("A METAL HAS BEEN DETECTED,SEARCH VERY WELL ");// The SMS text we sent out
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
}
void RecieveMessage()
{
mySerial.println("AT+CNMI=2,2,0,0,0"); // AT Command to receive a live SMS
delay(1000);
}
void applyPulses()
{
for (int i=0;i<3;i++)
{
digitalWrite(pulsePin,HIGH); //take 3.5 uS
delayMicroseconds(3);
digitalWrite(pulsePin,LOW); //take 3.5 uS
delayMicroseconds(3);
}
}
void loop(){
int pinSeven = digitalRead(Seven);
if (Serial.available()>0) {
}
if(pinSeven == HIGH){
int minval=1023;
int maxval=0;
long unsigned int sum=0;
for (int i=0; i<256; i++)
{
//reset the capacitor
pinMode(capPin,OUTPUT);
digitalWrite(capPin,LOW);
delayMicroseconds(20);
pinMode(capPin,INPUT);
applyPulses();
//read the charge of capacitor
int val = analogRead(capPin); //takes 13x8=104 microseconds
minval = min(val,minval);
maxval = max(val,maxval);
sum+=val;
long unsigned int cTime=millis();
char buzState=0;
if (cTime<pTime+10)
{
if (diff>0)
buzState=1;
else if(diff<0)
buzState=2;
}
if (cTime>pTime+buzPeriod)
{
if (diff>0)
buzState=1;
else if (diff<0)
buzState=2;
pTime=cTime;
}
if (buzPeriod>300)
buzState=0;
if (buzState==0)
{
digitalWrite(led, LOW);
noTone(buz);
}
else if (buzState==1)
{
tone(buz,2000);
digitalWrite(led, HIGH);
}
else if (buzState==2)
{
tone(buz,500);
digitalWrite(led, HIGH);
}
}
//subtract minimum and maximum value to remove spikes
sum-=minval;
sum-=maxval;
if (sumExpect==0)
sumExpect=sum<<6; //set sumExpect to expected value
long int avgsum=(sumExpect+32)>>6;
diff=sum-avgsum;
if (abs(diff)<avgsum>>10)
{
sumExpect=sumExpect+sum-avgsum;
ignor=0;
}
else
ignor++;
if (ignor>64)
{
sumExpect=sum<<6;
ignor=0;
}
if (diff==0)
buzPeriod=1000000;
else
buzPeriod=avgsum/(2*abs(diff));
}
if((digitalRead(ledRead) ==HIGH) && (pinSeven == HIGH)){
SendMessage();
}
else{
}
if (mySerial.available()>0)
Serial.write(mySerial.read());
}
SMS alerts offer a significant advantage over traditional metal detectors because they provide real-time notifications, even if you’re not physically present. In high-security environments, receiving an SMS immediately after metal detection allows for quicker action and response. For example, in an airport setting, SMS alerts can notify the security team about unauthorized metal objects, reducing the chances of a security breach.
If you want to take this project to the next level, here are some advanced features you can consider:
We have done justice to the design of how to build an SMS-based metal detector project. What do you think? Can you build similar a project design? Let us know in the comment section if you followed this guide to achieve a successful project work. You can contact us and send us pictures and videos of your project design on WhatsApp, Twitter, Telegram, Instagram to and send us pictures or ask questions too.
Can I use this system for detecting other materials besides metal?
How do I troubleshoot when my system doesn’t send SMS alerts?
Can I use a different Arduino board besides Arduino Uno?
How far can the metal detector sense metal objects?
Is it possible to integrate this system with a security camera?
In the ever-evolving landscape of modern agriculture, artificial intelligence (AI) is emerging as a game-changing…
The Internet of Things (IoT) is reshaping the way we live, work, and produce goods.…
Introduction Have you ever wondered how some manufacturing industries consistently deliver high-quality products while minimizing…
In the ever-evolving landscape of modern agriculture, the integration of Internet of Things (IoT) technology…
Introduction Have you ever imagined diagnosing equipment issues without even being on-site? Welcome to the…
In the ever-evolving world of manufacturing, staying competitive means adopting innovative solutions to optimize every…
This website uses cookies.