Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MMA8451 Accelerometer algorithm for accident detection

Status
Not open for further replies.

pawan kumar

Member level 4
Member level 4
Joined
Jan 31, 2012
Messages
73
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Location
Chennai
Activity points
1,894
Greetings,

I have interfaced MMA8451 I2C based accelerometer with microcontroller. I can continuously receive some X,Y,Z values and display them in the hyperterminal. In my project, I have to detect an

accident and raise an interrupt to the controller using this chip. Any ideas would be a great help to me.

Thanks in advance,

Pawan
 

What is your definition or specification for an accident?
 

Hi klystron,

I want the mechanism through which the airbag of a car gets activated. In this event, I mean that severe an accident.

Pawan
 

Specify the acceleration ( negative) level, direction, the jerk, the required reaction time to deploy the bag and how will you filter false sources like somebody bumping the console, closing the bonnet ... Specifications are measurable. Without detail specifications you do not understand the problem and your solution will most likely fail
 
Hi klystron,

My complete project is integrating LPC2148 with GSM and GPS module to track the location and send a msg in case the user needs to track the vehicle. It also reports in case there has been an accident.I purchased an accelerometer to serve this purpose. I have just a week left for the final submission. In case I did not do anything with the accelerometer, I plan to use a switch interrupt. In short, I demonstrate it with a toy car. So, pls suggest me a solution which rises an interrupt when the car hits the wall.

Thanks,

Pawan
 

Thanks klystron,

I could observe from the article that when an accident occurs, there is a sudden change in g from 0-.1g to upto 15g within a short interval of .02s . I need to program the accelerometer such that it alerts the interrupt whenever a threshold is reached.

Pawan
 

Hi Pawan,I've decided to use the same accelerometer for tilt sensing application.Could you please post the schematic of the connection in the following thread or mail them at abk.edu@gmail.com....my mail id.

I am confused about connection of mma8451qt vddio pin with my 5V controller.Since it runs on 5V and its logic output levels are 5V,could you help me out with this?

- - - Updated - - -

Hi Pawan,I've decided to use the same accelerometer for tilt sensing application.Could you please post the schematic of the connection in the following thread or mail them at abk.edu@gmail.com....my mail id.

I am confused about connection of mma8451qt vddio pin with my 5V controller.Since it runs on 5V and its logic output levels are 5V,could you help me out with this?
 

Hi DatsAbk ,

You can neglect the VDDIO pin. I had used only the VDD(pin-14) , Gnd(pin 12,10 ), SDA(pin 6),SCL(pin4) [both pulled up to 3.3v] ,SA0(pin 7) and INT1(pin11) for the interface. I had purchased the IC with an in built voltage regulator and pins expanded from nex robotics ( **broken link removed** )
Hope this helps.

Pawan
 
Thanks bro....Will need help ahead in case the same doesn't work.

Could you Private message me ur mail address
 

Hey Pawan.. at d moment I'm tryin to interface my MEMS MMA8451 with LPC2148.. I just want it to detect a demo accident and indicated by turnin an led ON.. But I've never worked with I2C before so could u pls help me by mailin me d code for the above task? My review is on d 24th..

Thanks in advance:)
 

@ pawan kumar, Well according to me you do not need to have 3 axis accelerometer for this project.
Just use a single axis (less sensitive accelerometer will also suit to your project, in short sensitivity should not be an issue)
then put the accelerometer perpendicular to the earth.
set the threshold value for a noticeable jerk.
and do the program for it.

but as you've buy the 3 axis accelerometer then you can take a benefit of all of 3 axis.
set their threshold in a best possible way according to the orientation of placement.

- - - Updated - - -

@twisted transistor,
check the link, https://www.nex-robotics.com/produc...tal-accelerometer-with-voltage-regulator.html
scroll down & you will find the tutorial of it with LPC2148
 
Last edited:

@twisted transistor,

as Jigar 4 Electronics says, I followed the same code samples from nex robotics.

I configured all three axes to a small threshold level . It raises an interrupt when the threshold exceeds.

You may download the full source code of my project HERE

Regards,

Pawan
 
ok.. Thanks alot.. :) both of u.. Pawan & Jigar:)
But pawan ur code is soo big.. Is it possible for u to only send me d portion reqd only for d mems? like without d gsm portion n all.. I would like it to be a single prog.. I know its asking too much.. can u help me?
 

Hi Pawan, in your code i.e. "i2c.c", there are a lot of registers used like I2C0CONSET, I2C0CONCLR, etc. I have been checkin online for the description of these registers but could not find it anywhere. Could u pls tell me wer I can find the configuration of these registers?

Thanks in advance :)
 

@pawan kumar, Which frequency have you used ? 100kHz or 2.25MHz ?? I am using the same sensor from nex... I am not able to have proper reading.
the same code is working perfectly with my other sensor which is also uses I2C intefacing.
I am using ARM Cortex - M4F based LM4F120H5QR controller.

when I've scan the I2C bus it gives the acknowledgement at every addresses!!! I mean starting from 0x00 to 0x7E ...
I think the sensor has damaged.

Can you please share your experience?
 

@Jigar 4 Electronics :

I had used the standard clock rate (100Khz). You say that the same code works for another sensor. Is it the same component? also, try interfacing the (damaged) sensor with another mcu too. That would eliminate your variable of doubt on damage in sensor.

Regards,

Pawan
 

Thanks for your response Pawan,

Can you tell me about pull up resistor value?
Have you used the breakout board as it is or have you changed the value of pull up resistor?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top