Pages: [1]   Go Down
Author Topic: How to calculate distance using arduino  (Read 272 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using GSM module with arduino and also drive motors of robot. so I want to calculate how much distance covered by robot linearly and print that distance in message which will send through GSM module.

i tried this formula in void loop
pathcovered = 2*3.14*radius*rps of motor
but its not working. plz help me.

 
Logged

Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Post your whole code, and also explain in what way it's not working, not just that "its not working"....
Logged

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

London
Offline Offline
Newbie
*
Karma: 1
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need some kind of position sensor in at least one wheel so you can count the number of revolutions the wheel has completed. You plug THAT number into the 2*Pi*r formula to get distance.
Logged

texas
Offline Offline
God Member
*****
Karma: 27
Posts: 862
old, but not dead
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using GSM module with arduino and also drive motors of robot. so I want to calculate how much distance covered by robot linearly and print that distance in message which will send through GSM module.

i tried this formula in void loop
pathcovered = 2*3.14*radius*rps of motor
but its not working. plz help me.

 
Assuming that "rps" = revolutions per second
That should give you your rate (speed).  Distance = Rate * Time
You need to multiply by the number of seconds to get distance traveled at that rate.
Logged

Experience, it's what you get when you were expecting something else.

Pages: [1]   Go Up
Jump to: