User avatar
Kratos
Posts: 395
Joined: Sun Apr 12, 2015 12:41 pm

How to Measure Speed

Sat Sep 19, 2015 12:33 pm

I noticed on the sense-hat page for the swag store (and a few others) it said:
The Sense HAT supports a whole host of projects for the Raspberry Pi, it can measure how fast is the Pi itself travelling (i.e. measure your speed)...
Here's the link: http://swag.raspberrypi.org/collections ... -sense-hat

How do I measure speed? The python code showing this would be very helpful. Thanks a ton!

Otherwise, great hat! Setup took about 3 minutes, and I had a demo program running straightaway.

Kratos
I have posted mostly with a Pi 2 running either Ubuntu MATE, or Raspbian.

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: How to Measure Speed

Sat Sep 19, 2015 8:18 pm

Good question and one best solved by you after a few hints. The Sense Hat can't measure speed directly but can measure acceleration.

V = u + a*t

Speed equals initial speed plus acceleration times time.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

User avatar
Kratos
Posts: 395
Joined: Sun Apr 12, 2015 12:41 pm

Re: How to Measure Speed

Sat Sep 19, 2015 9:48 pm

One more question: how do you measure acceleration?
This is how I've been getting data from the accelerometer:

Code: Select all

from sense_hat import SenseHat
sense = SenseHat()
print(sense.accelerometer) 
but how do I measure acceleration?

Thanks for all the help! :D

Kratos
I have posted mostly with a Pi 2 running either Ubuntu MATE, or Raspbian.

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: How to Measure Speed

Sat Sep 19, 2015 10:08 pm

Code: Select all

from sense_hat import SenseHat

sense = SenseHat()
raw = sense.get_accelerometer_raw()
This will give you the acceleration in G's for all 3 axis. One G is equivalent to 9.81meters per second per second.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

User avatar
Kratos
Posts: 395
Joined: Sun Apr 12, 2015 12:41 pm

Re: How to Measure Speed

Sat Sep 19, 2015 11:26 pm

GREAT! Thanks for all your help!

Kratos
I have posted mostly with a Pi 2 running either Ubuntu MATE, or Raspbian.

Return to “Astro Pi”