As an Amazon Associate we earn from qualifying purchases.
An ATM security system protects a cash machine from physical attacks, tampering and theft. Real-world systems combine several layers, such as cameras, alarms, access control and remote alerts. This article explains one of the simplest and most useful layers: a microcontroller-based system that detects when an ATM is tilted or disturbed, sounds a buzzer, sends an SMS to the owner and closes the door with a motor.
The design below is a small educational project. It shows the principle behind a tilt alarm well, but it is not a replacement for the certified security equipment banks use.
What an ATM security system does
Most attacks on a cash machine start with physical force: someone tries to tip it, drag it away or break into it. A good security system tries to do three things:
- Detect the attack as early as possible, for example through movement, tilt or a forced door.
- Deter the attacker with a loud local alarm or a locked door.
- Report the event to the owner or security team so someone can respond quickly.
The project in this article covers all three with only a few parts: a MEMS accelerometer for detection, a buzzer and motor for the local response, and a GSM modem for the remote alert.
How the project works
The accelerometer is mounted inside the ATM. If the machine is tilted or shaken, the sensor output changes. The microcontroller reads that change, sounds the buzzer, and uses the GSM modem to send a text message to the owner. A motor then closes the door.
Security is a basic concern in daily life, and access control is a key link in any security chain. The microcontroller-based digital lock in this project allows only authorized persons into a restricted area, which makes the same approach suitable for corporate offices, ATMs and home security.
The MEMS accelerometer
MEMS stands for micro-electro-mechanical systems. These are miniaturized structures, sensors, actuators and microelectronics built together on a tiny scale. Micro sensors and micro actuators are classed as transducers, which are devices that convert energy from one form to another. In a micro sensor, the device usually converts a measured mechanical signal, such as tilt or acceleration, into an electrical signal.
The output of the MEMS device is analog. The analog values must be converted to digital before the controller can use them, and many microcontrollers have a built-in ADC (analog-to-digital converter) for this. When the accelerometer is disturbed, it signals the controller, which triggers the buzzer.
The microcontroller
The microcontroller is the brain of the system. It processes the sensor information, decides whether an alarm condition exists, drives the buzzer and motor outputs, and passes the alert on to the GSM modem.
The GSM modem
A GSM modem uses a SIM card to send text messages over the mobile network. That makes it useful for a machine that cannot rely on a nearby Wi-Fi network. The controller talks to the modem with standard AT commands over a serial connection. If you want to focus on the messaging part, see our guide to an Arduino security system with SMS alerts.
The buzzer and door motor
The buzzer gives an immediate local warning. The motor closes the door so that the interior stays locked while the alert goes out. A motor should be driven through a suitable driver circuit, not straight from a microcontroller pin.
Circuit
PCB layout
Program
The sketch below is written in Arduino style. It reads two digital inputs on pins 12 and 13, and when either one goes high it sends an SMS, then pulses the outputs on A5 and A4. The serial port runs at 9600 baud to talk to the GSM modem. Replace the placeholder with the phone number that should receive the alert.
int a=0;
void setup()
{
pinMode(12,INPUT);
pinMode(13,INPUT);
pinMode(A5,OUTPUT);
pinMode(A4,OUTPUT);
Serial.begin(9600);
delay(500);
}
void loop()
{
if(((digitalRead(12)==1)||(digitalRead(13)==1))&&a==0)
{
message();
a=1;
digitalWrite(A5,HIGH);
digitalWrite(A4,LOW);
delay(1000);
digitalWrite(A5,LOW);
}
else
{
digitalWrite(A5,LOW);
}
}
void message(void)
{
Serial.print("AT+CMGF=1;");//TEXT MOD
Serial.write(0xd);//ENTER
delay(1000);
Serial.print("AT+CMGS=");
Serial.write(0X22);
Serial.print("YOUR_PHONE_NUMBER");
Serial.write(0X22);
Serial.write(0xd);
delay(1000);
Serial.print("Theft at ATM no.33");
Serial.write(0x1a);
}
How the code behaves
- The variable
aacts as a flag. After the first alert it is set to 1, so only one SMS is sent per power cycle. This stops the modem from being flooded with messages, but it also means the system must be reset before it can alert again. - The
message()function switches the modem to text mode withAT+CMGF, sets the recipient withAT+CMGS, then sends the text. The final byte0x1a(Ctrl+Z) tells the modem to send the message. - The text “Theft at ATM no.33” is an example. Change the machine number to match your own unit.
Ways to improve the design
A tilt alarm is only one layer. If you want to extend the project, these additions make it more dependable:
- Reset logic: clear the flag after a set time or on a reset input so the system can alert again.
- More sensors: an Arduino security system with motion sensors can detect people near the machine, and door switches can detect forced entry.
- Louder deterrent: a siren is more effective than a small buzzer. Our Arduino security system with sirens shows how to add one.
- Visual evidence: an Arduino security system with cameras can capture images when an alarm triggers.
- Backup power: a small battery keeps the alarm and modem running if the mains supply is cut.
If you are new to this kind of build, start with how to build a simple security system with Arduino, then add the GSM and tilt-sensing parts step by step.
Limits to keep in mind
A hobby build like this is good for learning and for small access-control uses. Real ATMs are protected by tested safes, encrypted communication and monitored alarms. Do not fit homemade equipment to a machine that holds real cash without the approval of its owner and operator. Also check local rules before using a motor-driven lock, since a door that closes automatically can be a safety risk if someone is inside.
FAQ
What is an ATM security system?
It is a set of devices and procedures that protect a cash machine from theft, tampering and physical attacks. Typical parts are sensors, alarms, cameras, locks and a way to alert the owner.
How does a tilt sensor help protect an ATM?
An accelerometer notices when the machine is moved, tipped or shaken. That signal lets the controller sound an alarm and send a message before the attacker finishes the job.
Why use a GSM modem instead of Wi-Fi?
A GSM modem sends SMS messages over the mobile network, so it works without a local internet connection. This is useful in locations where Wi-Fi is weak or missing.
Can I use this project for home or office security?
Yes. The same tilt detection, buzzer and SMS alert can protect a safe, a cabinet, a door or any other object you do not want moved.