Introduction: GrayBOX - Accident Detection and Theft Protection System

GrayBOX is a device which protects you and your vehicle*.

This device will be mounted on your vehicle* and will perform some tasks automatically to save you and your vehicle*.

GrayBOX contains a SIM card so you can communicate with it via text message(SMS only, no watsapp ;-)).

Tasks performed by this device are :

  1. Accident detection : If you are in a road accident while driving your vehicle* then GrayBOX will automatically send help message to predefined numbers(as many numbers you store in the GrayBOX) with your GPS location.
  2. Theft protection : When you are going to a place where rate of vehicle theft is high, then at such location you can keep GrayBOX in alert mode by sending it "ALERT" command** via text message. In alert mode, if your vehicle* is moved then GrayBOX will send you help message. To cancel the alert mode, just send "RELAX" command**.
  3. Stopping theft execution : If by any chance thief stole your vehicle* then also you can stop him/her. To do so, send a command** "STOP" and GrayBOX will disconnect the power supplied to the spark plug of the engine and vehicle* will stop. To again engage the spark plug send "RUN" command**.
  4. Location acquisition : you can also track your vehicle* by sending "?" (question mark) command** to the GrayBOX and in return it will reply you with its GPS location.
  5. Communication with user : GrayBOX also communicate with owner of the vehicle*.

*This project is made keeping two wheelers in mind, but with little changes in code it can also be applied to four wheelers.

**Commands should be in the form of *command#.

Ex. - *ALERT#, *STOP# etc.

NOTE - This project is completely working but not yet tested in the field.

.....More videos coming soon.....

Step 1: Tools and Materials

Picture of Tools and Materials


  1. Microcontroller board (Arduino compatible) or Arduino UNO.
  2. GSM module
  3. GPS module
  4. Accelerometer sensor
  5. SIM card (Activated and with some balance)
  6. Relay switch
  7. LCD
  8. Fasteners
  9. connecting wires
  10. Battery (12v)


  1. Soldering iron (If making custom microcontroller board and relay switch module)
  2. FTDI board (If making custom microcontroller board)
  3. Screw driver
  4. wire stripper
  5. Multimeter
  6. Glue gun
  7. Power supply
  8. A computer

Link from where I bought my components -

Step 2: Making Custom Microcontroller Board

Picture of Making Custom Microcontroller Board

Note - If you are using Arduino board or any other Arduino compatible board then jump to step 4.

  1. Components required
    • Atmega328 with Arduino bootloader
    • 28 pin IC base for Atmega328
    • IN4007 diode
    • 470uf capacitor
    • 10uf capacitor
    • 7805 voltage regulator
    • 22pf paper capacitor (Quantity - 2)
    • 16 MHz Crystal oscillator
    • 100nf capacitor
    • 1k resistor (Quantity - 2)
    • 10k resistor
    • LED
    • Berg strip
    • Jumper wires
  2. Download the schematic and PCB file and make PCB.
  3. Drill with 1 mm drill bit for soldering components at their respective places.
  4. Solder each component carefully.

If everything goes as planned then your microcontroller board is ready.

NOTE - Use expressPCB to open .pcb file

Step 3: Connect GSM, GPS Module, Accelerometer Sensor and LCD to Microcontroller Board

Picture of Connect GSM, GPS Module, Accelerometer Sensor and LCD to Microcontroller Board

Connect GSM, GPS module and Accelerometer sensor as shown in images. If you are using Arduino board then connect as following.

Accelerometer sensor:

  • x-pin to A5
  • y-pin to A4
  • z-pin to A3
  • vcc to +5v/3v3
  • GND to GND

GPS Module :

I connected GPS module's serial pins (Tx and Rx) to software serial pins of the microcontroller board. So you can change it in the code according to your need.

  • Tx-pin to 5
  • Rx-pin to 6
  • vcc to +5v/3v3
  • GND to GND

GSM Module :

  • Rx-pin to Tx
  • Tx-pin to Rx
  • Vinterface-pin to +5v
  • Vin-pin to +5v
  • GND to GND


LCD is only for our convenience, otherwise not needed.

  • rs-pin to 2
  • rw-pin to 3
  • enable-pin to 4
  • D4-pin to 10
  • D5-pin to 11
  • D6-pin to 12
  • D7-pin to 13

Step 4: Final Assembly and Programming

Picture of Final Assembly and Programming
  • Assemble the different modules as I did for making GrayBOX compact.
  • Insert SIM card in GSM module.
  • Connect FTDI to the microcontroller board (only if using custom microcontroller board, otherwise directly upload the code to arduino board) and upload the given code.

In case of suggestion or doubt feel free to contact. You are always welcome :-)

Email ID-


BhoomikaS2 (author)2017-08-25

Hi.. Nice concept... i am working on Adxl345 and had some doubts so was searching about it and thus landed on your proj page. I would like to know which accelerometer have you used here? Adxl335 or Adxl345 or Adxl377 or ...?

PrabhulH1 (author)2016-11-12

i want the program

sw4p (author)PrabhulH12016-11-14

It's already uploaded. Download Greybox_final.ino, that's the code you need.

BatchuR (author)sw4p2017-08-24

can u send the program of this project to my mail. my mail is

AntonyM20 (author)2017-04-09

Can you please send me the relay circuit for this progm?

JacobN34 (author)2017-04-09

Can you show me the relay circuit?

vignesh sekar (author)2017-02-07

what is new in this

sw4p (author)vignesh sekar2017-02-08

What kind of "new" you expect?

sw4p (author)2016-12-01

Thank you sam2017 for your suggestion.

MartinM202 (author)2016-06-07

Amazing, I like it. Excellent job there.

sw4p (author)MartinM2022016-07-04


Winston 8 (author)2016-05-02

Hello,will you ever upgrade the project for example adding a lcd screen?

Abhijith giridhar (author)2016-03-08

Do you have any working video that explains how GRAYBOX works.the included video just specifies the different parts required to assemble it.

sw4p (author)Abhijith giridhar2016-03-14

Yes I do...I have a video which completely explains the working of GrayBOX. I am going to post it soon.

mgray26 (author)2016-02-22

I have an idea for this. Instead of cutting the power instantly after the "Stop" command, you could have it wait for the vehicle to stop and have it (somehow, if it's an automatic) put it into park, cut the engine, and put the hazards on to warn others. :)

sw4p (author)mgray262016-02-23

if I wait for thief to stop the vehicle then it will be hard to catch him...

Raphango (author)sw4p2016-02-23

But if there's some kind of error/glitch/mishap the owner could be the victim. =T

sw4p (author)Raphango2016-02-24

What kind of glitch??

the only thing its doing is cutting the power supply to the spark plug of the engine, which happens to most of the vehicle when carbon is accumulated in the spark plug.

Raphango (author)2016-02-23

Great job!

PaivaN (author)2016-02-16

Another question ... These codes do I have to send him , like " Alert" , "Relax" , "Stop" ... I have to send my mobile phone for GSM chip? concerned the number of emergency that GSM will send the message ... will him that appears in the code beginning at char field * m_num_help [ ] = { " +5588998514526 "} ; ( I put the girlfriend's number) and this field m_num_my char [ ] = { " +917415045365 "} ;, is the SIM card number which is in gsm ? It is correct the way I did ? You have to change yet another field with this number ? oh, and please take a picture with the LCD turned on so that we can understand the connection. Thank you!!!!

sw4p (author)PaivaN2016-02-17

I am going to add more videos which will show the functioning of GrayBOX. In that video LCD is connected to see the results.

sw4p (author)PaivaN2016-02-17

GrayBOX will always contact to your number(m_num_my[]) except the case of accident...And you need to send command in the form of *ALERT# or *alert# (Either small or capital letter, not the combination of both and also notice "*" and "#").

you don't need to store the number of SIM card which is implanted in GrayBOX.

sw4p (author)PaivaN2016-02-17

In m_num_my[] you need to write your own number. In m_num_help[] you need to write your girlfriend's number...So in case of accident the GrayBOX will send help msg to your girlfriend.

PaivaN (author)2016-02-16

Hello, how are you?! Well, first , congratulations on the magnificent project. My question is: I want to implement the project on the LCD , My display is 16 columns by 2 lines . can that be? I noticed that only has 4 wires for LCD connection. You need I2C module, or I can connect without the I2C module? Thank you very much in advance!

sw4p (author)PaivaN2016-02-17

In step 2 there is an image showing where to connect LCD.

sw4p (author)PaivaN2016-02-17

You can connect LCD without I2C too. In step 3 I already mentioned how to connect LCD to the microcontroller board. I didn't have enough space on the upper side of the board so I connected the LCD module to the bottom side of the project.

Thank you paivaN.

TruderK (author)2016-02-14

nice work swapnil ,its a fantabulus idea to make this device. i wish you all the best and i hope that is only start ...

sw4p (author)TruderK2016-02-14

Thank you TruderK..

seamster (author)2016-02-09

This is a fantastic idea! Very nicely presented too.

sw4p (author)seamster2016-02-10

Thank you Seamster..

Lmhshop (author)sw4p2016-02-10

Hi, are you thinking of selling these and if so can you 1 make it smaller 2 let us know a cost

sw4p (author)Lmhshop2016-02-13

This project cost me around 10000 rupee(around 146$).

sw4p (author)Lmhshop2016-02-10

yes I wanted to make it smaller but I couldn't find GSM module smaller than this one..

destructable567 (author)2016-02-11

I have not fully had a chance to check this out, but will when I have more time.

On first reflection, it looks awesome though.

I did the note the comment regards cutting the power to a moving vehicle. Personally anyone who steals a car deserves what they get! But in the eyes of common sense, the poor innocent citizen who ploughs into them doesn't!

Therefore I wonder if you can time the engine to only cut-out when the vehicle is already stationary? This would mean GPS, or linking to the take off on the Odometer, but it could be one solution to making a fantastic project perfect?

sw4p (author)destructable5672016-02-13

thanks destructable567 for your suggestion...Its a good solution..i will definitely do that..

Samuel_Alexander (author)2016-02-13

Great project and well presented! You earned my vote;)

I will probably make something similar to this.

sw4p (author)Samuel_Alexander2016-02-13

Thanks are awesome

Omnivent (author)2016-02-10

Nice build, but you may wanna look into your local laws, before remotely cutting power to a moving vehicle - it's highly illegal (for safety reasons) in several places.

sw4p (author)Omnivent2016-02-10

thank you omnivent for your suggestion... I will look into that

diy_bloke (author)2016-02-10

well done

sw4p (author)diy_bloke2016-02-10

Thank you...

NoPinky (author)2016-02-10

I have the exact idea for quite some time but didn't come around to do it yet. So if I have the time, I will use your work as a starting point. Thanks!

One thing I noticed looking over your parts: it may be better to replace the common relay with a solidstate relay or FETs. In an environment with lots of vibration and shocks, those normal relays may be not reliable. They may "flicker" when being bumped and I can imagine this could cause problems with the ignition system/spark plugs, This issue cameup when I was researching to build a firework ignition controller on a budget.

sw4p (author)NoPinky2016-02-10

Thanks for your suggestion...I will use that in place of relay. I was also thinking about using thyristor.

RandhirP (author)2016-02-10

It's a milestone project towards safety........... well constructed AWA compact too

sw4p (author)RandhirP2016-02-10

Thanks Brother...

onion2 (author)2016-02-10

niiice, it can work for other things :p

sw4p (author)onion22016-02-10

sure....just a bit of creativity..and a little tweak..

Eric Brouwer (author)2016-02-09

very intetesting project.

sw4p (author)Eric Brouwer2016-02-10

Thank you Eric...

About This Instructable



Bio: HI, I am a Mechatronics engineer, currently doing Masters in Robotics engineering...But most of all I am a MAKER.
More by sw4p:Tinku: a Personal RobotHack Fingerprint Scanner Using "GLUE"Cardboard Piano
Add instructable to: