element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Accelerometer Automated Locking system
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 42 replies
  • Subscribers 393 subscribers
  • Views 3632 views
  • Users 0 members are here
Related

Accelerometer Automated Locking system

Former Member
Former Member over 10 years ago

Hello,

 

I am Yuvish Chintaram from Mauritius Island.

 

Recently, I have applied to a university and my acceptance would be considered on a project that would help to contribute to my society.

My other friends are planting mangroves to help protect the marine ecosystem but I am more interested in science  and think to have find an interesting project.

 

A few months ago, an accident occured to a student that fell from a moving bus.(I have send you the link below.)

Surprisingly, two more people fell from a moving bus from the back emergency door after the earlier incident.

A solution was found by the Government that all bus should have an alarm and  that when the door opens an alarm will ring. But this does not solve the problem!

 

Hence, my idea was to incorporate a locking system that is fully autonomous. The system should lock the door while the bus is moving but unlock itself when the bus stops at a bustop.

I was thinking of using an accelerometer that will detect the acceleration of the bus that will relay to a circuit such that at a minimum value the latter will send a signal that will automatically lock or unlock the system.

eg. If(X>200)

      eletric lock is lock  

      else if (X<200)
       electric.lock is unlock

 

I am here to ask you if you could give me some advice and also if my current solution will work.

I would also be pleased to know your ideas about my project.( How would you answer it, etc..)

I would really appreciate if you could reply me as soon as possible.

 

http://news.islandcrisis.net/2015/03/17-year-old-student-keshnee-purmasing-died-after-falling-from-school-bus/

 

Regards

Yuvish Chintaram

  • Sign in to reply
  • Cancel

Top Replies

  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago +1
    Given that once the bus is at desired speed, the acceleration will effectively be zero, the same as if it where not moving so this would not be an ideal sensor to use A GPS measuring speed in any direction…
  • shabaz
    shabaz over 10 years ago in reply to gadget.iom +1
    That's true, but (been a long time since I was on a bus!) there are the 'smash glass' hammers or override buttons with thin glass in front of them. Maybe that is not an option in some countries though…
  • Former Member
    Former Member over 10 years ago in reply to balearicdynamics +1
    Yes okay. so basically I have an: 1. Arduino UNO 2. 3 Axis Gyroscope+Accelerome ter Module for Arduino MPU 6050 3. I have not still buy thew electric lock but what do you think of this: http://www.ebay…
Parents
  • gadget.iom
    gadget.iom over 10 years ago

    I would recommend against the accelerometer approach, the kind of vibrations you are using to detect road surface imperfections during movement could easily be created by a stampede of people trying to get out. Of the suggestions made so far, GPS seems about the best IMHO.

     

    Also think about the duty cycle of your looking mechanism, as it will be releasing and relocating every time the vehicle comes to a standstill.

     

    When considering the locking mechanism look into fail-safe mechanisms. At least the lock will fail into safe condition (where the door opens) should any system damage occur.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to gadget.iom

    But i have never used a GPS before.
    How can you help me

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to balearicdynamics

    Thank you Enrico. I will look into that.
    I am very at ease with arduino. Wont it take too much time now, to understand the pi all that?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to Former Member

    I think it seems more complex but as it is more powerful, I think you have a wider range of possibilities to understand and make a well done project with - definitely - less difficulties.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to balearicdynamics

    Hey Enrico. are you sure nothing can be done with the arduino?
    I have a tight schedule and desperate where I am right now image
    ok..tomorrow i will go on a bus with the accelerometer..
    I will see if the values of X, Y and Z of it are different when the bus is moving and when it stops.
    I will do it till the bus terminal.
    Then I'll let you know.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to Former Member

    This check is anyway a good thing, I think.  Then let me know what components do you already have so I can give you a more appropriate suggestion. I though that you was deciding what to use.

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to balearicdynamics

    Yes okay.
    so basically I have an:
    1. Arduino UNO
    2. 3 Axis Gyroscope+Accelerometer Module for Arduino MPU 6050
    3. I have not still buy thew electric lock but what do you think of this: http://www.ebay.com/itm/121654248932
    4. A relay

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • gadget.iom
    gadget.iom over 10 years ago in reply to Former Member

    Yuvish Chintaram wrote:

     

    3. I have not still buy thew electric lock but what do you think of this: http://www.ebay.com/itm/121654248932

    Bear in mind that it's a fail locked model, so if your system power/arduino fails nobody will be able to open it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to Former Member

    Yeee! You have almost all image

     

    Well so in this case we should try to make the project with these components.

     

    Arduino UNO is ok as you have the gyroscope accelerometer. For now we can wait to see if this can be sufficient or not.

    I suggest that in this phase it is not the worth to buy ANY electric lock system, the most important stage is that you make a working prototype so the relay response is more than sufficient to demonstrate how does it works.

     

    Did you have already connected some of the hardware ? What ? How do you connected the relay?

     

    By the software side what is the sketch you are working on ? Please post the code so we can have an idea. Thanks.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to balearicdynamics

    Hey Enrico, i have still not got the relay but i will get it in the coming days.
    I'll send you the circuit in some minutes. The circuit(I think) i can manage.
    Its the sketch which is the problem image
    But i'll try then you guys correct it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to Former Member

    Ok, I'll check the material as I am back.

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to balearicdynamics

    Ok Enrico.thnx for all by the way

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Former Member
    Former Member over 10 years ago in reply to balearicdynamics

    Ok Enrico.thnx for all by the way

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • Former Member
    Former Member over 10 years ago in reply to Former Member

    image

     

    Please note the big green part represent the lock.
    I am not an expert in elctronics so feel free to correct me

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to Former Member

    Yuvish,

     

    it is my opinion that this circuit - that seems at least well done and set - maybe perfect or crap. It depends on two things: the correct connections between the accelerometer and the other components to the Arduino pins but - first of all - how do you manage with a script the signals, pins and connections - So untile we can't see a line of your code we can't imagine what you are doing with this stuff.

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to balearicdynamics

    Hey Enrico, I did the sketch below with a MMA 7455, its just a rough one. And I am still figuring out how to send a signal to the relay to make the electric lock lock and unlock. Help me if any one know.


    #include <Wire.h> //Include the Wire library

    #include <MMA_7455.h> //Include the MMA_7455 library

     

    /*-----( Declare Constants and Pin Numbers )-----*/

     

    /*-----( Declare objects )-----*/

    MMA_7455 mySensor = MMA_7455(); //Make an instance of MMA_7455

     

    /*-----( Declare Variables )-----*/

    char xVal, yVal, zVal; //Variables for the values from the sensor

     

    void setup() /****** SETUP: RUNS ONCE ******/

    {

      Serial.begin(9600);

      delay(500);

      Serial.println("MMA7455 Accelerometer Test");

      // Set the sensitivity you want to use

      // 2 = 2g, 4 = 4g, 8 = 8g

      mySensor.initSensitivity(2); // Good for "Tilt" measurements

    /*

      Calibrate the Offset. Calibrate, in Flat position, try to

      get: xVal = 0, yVal = 0, zVal = +63 (1 G)

      !!!Activate this after having the first values read out!!!

      Suggestion: Run this with offsets = 0,0,0 and see needed correction

      mySensor.calibrateOffset(0,0,0); //Uncomment for first try: find offsets

      mySensor.calibrateOffset(-5.0, 13.0, -12.0); //Then Uncomment and use this

    */

    }

     

    void loop() /****** LOOP: RUNS CONSTANTLY ******/

    {

      xVal = mySensor.readAxis('x'); //Read out the 'x' Axis

      yVal = mySensor.readAxis('y'); //Read out the 'y' Axis

      zVal = mySensor.readAxis('z'); //Read out the 'z' Axis

      Serial.print("X = ");

      Serial.print(xVal, DEC);

      Serial.print(" Y = ");

      Serial.print(yVal, DEC);

      Serial.print(" Z = ");

      Serial.println(zVal, DEC);

      delay(500);

    /*--( Show tilt [Assumes unit has been calibrated ] )----*/ 

      if (xVal < -20) Serial.println("Tilted LEFT");

      if (xVal > 20) Serial.println("Tilted RIGHT"); 

      if (yVal < -20) Serial.println("Tilted TOWARDS"); 

      if (yVal > 20 ) Serial.println("Tilted AWAY"); 

      if (zVal < -45 ) Serial.println("UPSIDE DOWN!"); 

    }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube