Ok I got it working
The only thing left will be to insert the parts into the plastic egg and do the software on the Raspberry Pi to display the result. But I won't do it.
This is a simple accelerator using bluetooth.
And this is the schema
The github has been updated
https://github.com/danjperron/GCrash
And this is the result via minicom on /dev/rfcomm0
GCrash V1.0
VDD = 2.71V
Test MPU6050 communication
I2C Read Test Passed, MPU6050 Address: 0x68
READY System is waiting for free fall
0000016DFC1EFDEB Free fall occurs just transfert data in hex at 500 Samples/sec
0001016DFC1EFDEB
00020144FC56FE3A
….
0004012FFC77FE46
00060132FC95FE2D
*****
Maximum Peak Time(ms)=50 Gx=1.70 Gy=-8.75 Gz=-1.21 G=9.00
*****
DONE
The Accelerometer data is send in hexadecimal for performance issue.
Interfacing the bluetooth device is quite easy.
The only thing is to change the baud rate to 115200 but the internal serial port from the Raspberry Pi will do the trick.
Once you change the baud rate, the pin number and the device name using the AT command, you won't need to do it again since they are flash into the device.
The system delivers 500 samples/sec. It is limited by the serial port. If you want 1000 samples/sec, you will need to increase the baud rate or cut on the sampling resolution. But I think it is fast enough.
The RA0 pin on the cpu is available so you could change the software and put a led which could be turn on if the threshold has been reached. There is not too much room on the code but a small add-on is possible.
If you need more information just ask me. Maybe if I have time I will do a video of it.
Now I will work on the gyroscope part but this time is for my robot.
Daniel