Speedometer

Hello guys, I'm new to arduino. Also, I'm from Venezuela, so my english isn't perfect. Well, I have a homework in which I need to measure the speed between two points.

I've been thinking about using two ir sensor, one to start a chronometer and the other one to stop it, with this, I'll have the time.

Now I'm thinking to use the velocity formula V=D/T. Because I've the distance and the time that is measured by the two ir sensors.

Also I need to show the result on a LCD Display.

Thank you very much

juanchg98:
Well, I have a homework in which I need to measure the speed between two points.

I have a funny feeling that your teacher expects YOU to do the homework and not us.

If there is a specific technical issue you need help with I don't mind helping. But I have no intention of doing your homework so you can get an A without any effort.

...R

That is the formula for average speed. It is good.

You will need IR source for the detectors. IR led, red led, sunlight, firelight, all near-IR sources. Near-IR is just below red light, the IR range is very wire but regular IR-detectors are for near-IR and won't see body heat or even close to that.

Arduino has 2 time functions that return unsigned long values for time since the board started.

One is millis(), it returns milliseconds since startup. The other is micros() for microseconds, but only the closest 4 microseconds.

If I want to know elapsed milliseconds.....

unsigned long startMs, endMs, elapsedMs;

........... somewhere during code execution we get start

  startMs = millis();

........... and later we get the end

  endMs = millis();

  elapsedMs = endMs - startMs;  // here is the milliseconds between

It is okay to show you these things but I urge you to work this into your own knowledge to be ready for the next step.
I am very happy to think another engineer or scientist or just person who can DO things is becoming ready.

I can't do your school work but maybe I can help with your understanding of the pieces.

I had a buddy from Venezuela when I was in the Army. That was back in 1978.