mrteach
Posts: 181
Joined: Sun May 26, 2013 6:49 am

Egg dropper (calculating shock)

Tue Jun 25, 2013 4:32 am

So I'm a teacher and saw someone create something similar and kind of want to make one myself (but egg like).
So it is basically the old egg drop experiment (trying to design a device to dampen the fall damage to the egg).
The idea I have is to create an device using a rf transmitter (as a memory module seems harder). and a reciever to gather the data when it impacts.

So far I have my prototype board cut to fit into the egg. A mini pro arduino. RF transmitter/reciever. An arduino uno. A Raspberry pi. and a accelerometer on its way.

I got the RF transmitter and receiver working. Currently the design uses a lot more devices then I would want (I would like to remove the uno from the project, but don't know how to receive the rf data from my mini pro [which is using virtual wire])

This is what I am thinking so far:

Code: Select all

Accelerometer -> Mini Pro -> RF transmitter -------  RF receiver -> Uno ---USB---> Raspberry pi [python graph]
I'm working on creating the graph as I wait for the accelerometer to come.

mrteach
Posts: 181
Joined: Sun May 26, 2013 6:49 am

Re: Egg dropper (calculating shock)

Tue Jun 25, 2013 10:54 am

Not sure if this is going to work with my cheap accelerometers... It only goes to 16g...

PiGraham
Posts: 4203
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Egg dropper (calculating shock)

Tue Jun 25, 2013 11:12 am

It would be easier to measure the motion of the egg with optical or ultrasonic sensors. you could use the system with real whole eggs. There are some nice sensors out there, and you could even use a Pi camera.

mrteach
Posts: 181
Joined: Sun May 26, 2013 6:49 am

Re: Egg dropper (calculating shock)

Tue Jun 25, 2013 8:27 pm

PiGraham wrote:It would be easier to measure the motion of the egg with optical or ultrasonic sensors. you could use the system with real whole eggs. There are some nice sensors out there, and you could even use a Pi camera.
What do you mean? If they desgin a structure around teh object that reduces/extends the impact off the egg, I don't think a camera can see how much damage a 'real' egg would have taken.

I am going to take some sample tests dropping eggs at various heights until it cracks and that height i will drop the 'fake' egg and see what gforce impact has at that height. I will use that as a baseline of if it hits this g level then your egg would have cracked.

I'm not measuring the velocity of the egg dropping. Some egg protecting designs act more like a helmet than a parachute. and the drop speed wouldn't be the biggest factor.

danjperron
Posts: 3526
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Egg dropper (calculating shock)

Wed Jun 26, 2013 12:51 am

Is your RF receiver uses serial communication?

If yes why not just use the build in serial from the Raspberry Pi. (GPIO14 & GPIO15).
You will need to disable the debug mode from the /boot/cmdline.txt and the serial console from /etc/inittab.

Daniel

danjperron
Posts: 3526
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Egg dropper (calculating shock)

Wed Jun 26, 2013 1:04 am

I found this post about virtual wire Rpi to Arduino

Looks like that the Uno is not needed. Maybe not . I think it is not fully working...

Maybe it will interest you

http://www.raspberrypi.org/phpBB3/viewt ... 5&p=225941

Daniel

User avatar
aTao
Posts: 1094
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: Egg dropper (calculating shock)

Wed Jun 26, 2013 2:59 am

What about an I2C accelerometer and an I2C radio link. That should cut out a load of mucking about with other controllers.

http://www.adafruit.com/blog/2013/01/25 ... -w-i2cspi/
and..
http://www.robot-electronics.co.uk/htm/cm02tech.htm

These could form the basis for an idea if the modules wont fit in your test rig.
>)))'><'(((<

PiGraham
Posts: 4203
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Egg dropper (calculating shock)

Wed Jun 26, 2013 6:26 am

I get it now, Thu is to design a crash-hat to protect a falling egg that will hit the floor.

the idea is to measure how much the protection reduces the g-shock felt by the egg inside when it hits the floor, to aid deign of better protection.

I originally read it as an egg catcher.

Presumably it is important to keep the instrument mass and volume similar to an egg, which will be a problem for a Pi. A tiny Arduino might be a better fit for this.

PiGraham
Posts: 4203
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Egg dropper (calculating shock)

Wed Jun 26, 2013 7:37 am

This might be a good starting point.
http://www.adafruit.com/blog/2010/09/10 ... r-arduino/
I'm sure you could get it much smaller and run it on button cells.

How about this:
http://www.adafruit.com/products/1247
with this:
http://www.adafruit.com/products/659

Or this
http://www.adafruit.com/products/1315
with this
http://www.adafruit.com/products/1120

mrteach
Posts: 181
Joined: Sun May 26, 2013 6:49 am

Re: Egg dropper (calculating shock)

Wed Jun 26, 2013 11:03 am

PiGraham wrote:I get it now, Thu is to design a crash-hat to protect a falling egg that will hit the floor.

the idea is to measure how much the protection reduces the g-shock felt by the egg inside when it hits the floor, to aid deign of better protection.

I originally read it as an egg catcher.

Presumably it is important to keep the instrument mass and volume similar to an egg, which will be a problem for a Pi. A tiny Arduino might be a better fit for this.
The arduino mini pro I have is fine (I could probably run it with button cells, might use a 9v (but would probably be heavier then an egg), but i think relative impact might still work. The raspberry pi is only used to read the rf data and create a graph from it.

The progress with the virtual wire, I did see it, but have no idea how to use c++ or anything. Kind of learning python a bit,

PiGraham
Posts: 4203
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Egg dropper (calculating shock)

Wed Jun 26, 2013 3:01 pm

Ah, got it. I should read posts more carefully before replying!

Thanks for the mention of virtual wire.

I see there is discussion of using it with Pi on the forum.

http://www.raspberrypi.org/phpBB3/viewt ... 5&p=225941

And follow-up here:

http://www.raspberrypi.org/phpBB3/viewt ... 37&t=24808

There are cheap bluetooth modules around that are supposed automatically pair up and provide a serial link over BT. They may be worth a look.

danjperron
Posts: 3526
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Egg dropper (calculating shock)

Wed Jun 26, 2013 11:53 pm

I think PiGraham has a point,

It will be simpler to use a bluetooth device .

A small cpu will access the I2C accelerometer and send the data to the bluetooth serial converter.

This is a picture of what I think you could use with a small battery of course

Image

This could be quite small if you sandwich the 8 pins cpu between the bluetooth and the accelerometer. And a small 3V battery should work for a couple of hours.

This is the part on the picture,

Accelerometer http://dx.com/p/gy-521-6dof-mpu6050-mod ... ino-148190
Bluetooth device http://dx.com/p/wireless-bluetooth-rs23 ... dule-80711
And of course the PIC cpu . PIC12F1840. ( I did post a method to program the cpu using the RPi with only 5 wires)

On the RPi side, you just need a bluetooth dongle.

I don't know if that accelerometer has enough range for your experiment but this is an other way to acheive what you want.

B.T.W You could use your mini arduino board but use standard serial communication instead.

Daniel

mrteach
Posts: 181
Joined: Sun May 26, 2013 6:49 am

Re: Egg dropper (calculating shock)

Thu Jun 27, 2013 12:20 am

bluetooth... didn't think of that. and a couple of hours sounds good. Just order some battery holders (was going to use a 9v (but those are heavy).

never used a pic before. Can I use arduino code for it?

danjperron
Posts: 3526
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Egg dropper (calculating shock)

Thu Jun 27, 2013 12:28 am

The pic is a small cpu but if you look at microchip website you will find software available for it in 'C'.

You could look at this github I made about using this pic to get buffer analog signal in I2C mode.

https://github.com/danjperron/A2D_PIC_RPI


But you could use your mini arduino if you like. Also take just the cpu of an arduino board. Some arduino board has the cpu on socket. (You will need the oscillator also).

Daniel
Last edited by danjperron on Thu Jun 27, 2013 12:39 am, edited 1 time in total.

danjperron
Posts: 3526
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Egg dropper (calculating shock)

Thu Jun 27, 2013 12:36 am

And for the serial communication you could check this program which control 4 servos, or more, from the build in Rpi serial port.

Check the source code on the first post. "RpiServo.c"

http://www.raspberrypi.org/phpBB3/viewt ... 95#p335295

Daniel

danjperron
Posts: 3526
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Egg dropper (calculating shock)

Mon Jul 15, 2013 2:04 am

Mrteach,

I'm playing with the MPU-6050 accelerometer right now.
I want to interface it using a small cpu and put it on my Raspberry Pi car robot.

Your project is not exactly the same but for me it is a good start to figure out how to implement the device.

This is the first start. I was able to interface the MPU-6050 with the PIC12F1840 cpu.
GCrash_schema.png
Preliminary PIC to MPU-6050
GCrash_schema.png (11.39 KiB) Viewed 10570 times
I create a Github https://github.com/danjperron/GCrash

On my version I will use the gyroscope but right now it is on the accelerometer part. The MPU-6050 has a maximum scale of 16G. Surfing the net, I found that the egg maximum acceleration before breaking it is 14G. But if you tilt the X and Y axes to 45 degree you should be able to increase the scale up to 27G.

This is only preliminary code. I still wonder if I should use RA0 cpu pin for interrupt signal or battery voltage.
Maybe I should increase the Timer interrupt to 500us and check by software the ready signal from the MPU-6050.

I didn't want to use float value, library too big and slow. Everything use integer.

This is a screen dump from "minicom -D /dev/ttyAMA0". The onboard Raspberry Pi serial com.
GCrash V1.0
Test MPU6050 communication
I2C Read Test Passed, MPU6050 Address: 0x68

MPU6050 Setup Complete
Ready
2000 0.20 0.11 -1.09 1.02
3000 0.20 0.12 -1.08 1.01
4000 0.20 0.11 -1.08 1.01
5000 0.20 0.12 -1.09 1.02
6000 0.20 0.11 -1.09 1.01
7000 0.20 0.11 -1.08 1.01
8000 0.19 0.11 -1.09 1.02
9000 0.20 0.12 -1.08 1.01
The datas are Time(ms) Gx Gy Gz Gall

Interfacing the bluetooth device will be simple and two CR-2032 battery should be enough to power it.


Daniel

danjperron
Posts: 3526
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Egg dropper (calculating shock)

Fri Jul 19, 2013 3:04 am

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.

Image

And this is the schema
Image

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

danjperron
Posts: 3526
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Egg dropper (calculating shock)

Fri Jul 19, 2013 11:40 pm

And here is the fully assembled egg accelerometer board

Image

Image


Daniel

Return to “Automation, sensing and robotics”