Building a photoelectric timer-need advice

earthsciteach

Moderator
Moderator
Hey, FT folks. I would like to build a device that uses photoelectric sensors to time a car rolling down a track for my physical science class. Here are the requirements:
1. Photoelectric sensor starts timer when the car passes the sensor.
2. Four additional photoelectric sensors spaced along the track will identify the time it takes the car to reach each sensor.
3. A controller recording the time to each sensor. The times can either be displayed on a digital or LED screen or downloaded to a computer application, such as Excel.

I've done this activity with students manually timing with stopwatches, but they pretty much suck at that. Can anyone help me out and give advice on how to do this?

Thanks!
 

colorex

Rotor Riot!
Mentor
Can be done using Arduino, but I would need a couple of days off work to develop it. I haven't figured out how to use photoelectric sensors, either.
 

earthsciteach

Moderator
Moderator
I just signed up for the Arduino forum and will spend some time familiarizing myself with it. Do you know how to write the code?
The photoelectric sensors simply send a signal when a light beam is tripped. Its very boolean. Trip beam one, clock starts. Trip beam 2 through 4 and it records each of those times. 4 would also shut off the timer.
 

colorex

Rotor Riot!
Mentor
I guess it would be something like:

Set up a loop which takes 2 milliseconds to complete.
Run this loop several times over and over.
The loop contains a listener, so it listens to the sensor once each 2 milliseconds.
Each time it loops it adds 2 to a value stored in memory.

If the sensor reads that the car is passing, it displays the value of the integer in memory over a serial connection (computer screen).

So you get readings like this

0
124
352
510

values which are in milliseconds, to a precision of 2ms. It could probably be reduced to 1ms, but I don't know how long it would take to run the program.

This might sound like complete crap, as someone distracted me as I was writing.
 

earthsciteach

Moderator
Moderator
You are light years ahead of me with this stuff. I'm reading Arduino tutorials. I'd better be careful or I might start building multi-rotors, next.
 

earthsciteach

Moderator
Moderator
These Arduino boards are really impressive. I'm thinking about automating my entire house.
1. Dog activated sliding door so they can let themselves in and out.
2. Circuit kill switch in my kids' room after 10:00 on a weeknight or midnight on weekends.
3. Assignable master temperature sensors in my bedroom, living room and kitchen.
4. Humidity sensors in my potted plants so I know when to water them.
5. Automatic dog food and water bowl filling devices.
6. RF proximity sensors so I know when my dogs break out of the fence.
7. DIY GPS dog collar trackers.
8. Lighting controls via the internet or phone (just so I can mess with the kids when they are home alone).

I was hoping for a list of 10, but got bored with the whole thing at number 8. Of course, I'm kidding. But, all those things are doable via Arduino!
 

Tritium

Amateur Extra Class K5TWM
You are light years ahead of me with this stuff. I'm reading Arduino tutorials. I'd better be careful or I might start building multi-rotors, next.

BWAHAHAHAHA...........................................!

You are LOST to the Dark side completely when you start writing MultiCopter controller code!:p

Thurmond
 

earthsciteach

Moderator
Moderator
I am imune to your evil ways, Thurmond. At this moment I am building a bomb bay door on my HZ SC. The only programming needed was assigning channel 5 to the landing gear switch on my ER9x. One servo, one switch, one door, as many of those little impact poppers as I can cram into the battery compartment.

My interest in the Arduino is purely for scholastic purposes. That's my story and I'm sticking to it!
 

Tritium

Amateur Extra Class K5TWM
I am imune to your evil ways, Thurmond. At this moment I am building a bomb bay door on my HZ SC. The only programming needed was assigning channel 5 to the landing gear switch on my ER9x. One servo, one switch, one door, as many of those little impact poppers as I can cram into the battery compartment.

My interest in the Arduino is purely for scholastic purposes. That's my story and I'm sticking to it!

Teach, that sounds like a famous quote by a president, "I never Inhaled"!:rolleyes:

Does your Science department/lab there have any strip chart recorders? You might do the recording the old way and then let your students calculate the time periods knowing the speed of travel of the strip recorder.

Thurmond
 
Last edited: