Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Hardware Products
- Intel® Makers
- measuring speed

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

gk91

Novice

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-03-2016
12:21 PM

919 Views

measuring speed

Hi....

I want to measure speed of a moving object in real time by using Sharp distance sensor and Intel Galileo gen 1 board with MRAA 0.8.1 library and putty. Can any one has c++ code for this.

Thanks in advance.

1 Solution

Diego_V_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-04-2016
07:47 AM

66 Views

Hello gopal1096,

There aren't codes for this, but I'm sure you could program it by yourself. I'll try to guide you a little bit.

The SHARP distance sensor has an analog output. You can connect it to an analog input of the Galileo board, and read its value. You will need to calibrate the sensor first to know what distance is represented by a particular voltage level in the range of 0-5V. Once you know the distance (for example that 2V represents 20cm) you can measure the time the moving object requires to go from point A to point B.

If point A is 20cm (2V following the example above), and point B is 50cm (let's say an analog value of 3.2V), and it took 0.5s, you can calculate the speed with the following formula: *(pointB - pointA)/time*, which with the example above would be a speed of 60cm/s.

I hope you find the information above useful. I recommend you to check the MRAA documentation to know how to read analog values: https://github.com/intel-iot-devkit/mraa intel-iot-devkit/mraa · GitHub

Regards,

Diego.

Link Copied

1 Reply

Diego_V_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-04-2016
07:47 AM

67 Views

Hello gopal1096,

There aren't codes for this, but I'm sure you could program it by yourself. I'll try to guide you a little bit.

The SHARP distance sensor has an analog output. You can connect it to an analog input of the Galileo board, and read its value. You will need to calibrate the sensor first to know what distance is represented by a particular voltage level in the range of 0-5V. Once you know the distance (for example that 2V represents 20cm) you can measure the time the moving object requires to go from point A to point B.

If point A is 20cm (2V following the example above), and point B is 50cm (let's say an analog value of 3.2V), and it took 0.5s, you can calculate the speed with the following formula: *(pointB - pointA)/time*, which with the example above would be a speed of 60cm/s.

I hope you find the information above useful. I recommend you to check the MRAA documentation to know how to read analog values: https://github.com/intel-iot-devkit/mraa intel-iot-devkit/mraa · GitHub

Regards,

Diego.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.