Jump to content

Detecting a falling object in C

LuisHappy

Hello I was wondering how one would be able to create a code that would detect how far it fell and be able to tell the distance of the fall and how long it took to fall that amount.

Link to comment
Share on other sites

Link to post
Share on other sites

What object? In which environment? You really have to be A LOT more specific about your project.

just using an accelerometer, and it will be drop from the top of a building .

Link to comment
Share on other sites

Link to post
Share on other sites

just using an accelerometer, and it will be drop from the top of a building .

 

I guess you could calculate that using a couple of constants (gravity and drag) and time from release to impact.

Link to comment
Share on other sites

Link to post
Share on other sites

I did a similar project except I had a comp sci guy as my partner that did the coding.

 

I'm guessing you're trying to limit human error (reaction time of when the object is actually falling and when it hit the ground). Our distance wasn't an entire building (only a couple feet) so my partner coded a simple program to register binary activation of a key switch. We had two keyboards one up top and one at the bottom. We pressed our object up against a key on the keyboard and once the object left the key, the program initiated the timer, and we had another keyboard at the bottom so when the object hit a key, the program stopped the timer. 

 

Not sure if this helps but i thought I would share anyway.

Link to comment
Share on other sites

Link to post
Share on other sites

The gravitational acceleration should be the same though. (9.8~=10)

You only really need to know either the distance or the time. If you know one you can easily find the other.

Things get a little more complicated if you include friction . It will just mean that you'll have a lower acceleration than 9.8m/s2 most of the time.

i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×