Nomothumu 0.9, Time sensor for sport use

A time sensor for sports use

A not yet finished project but just felt like sharing it to the world.

Not very difficult or impressive as a lot of other projects here in the exhibition but it is very usefull (for some). It is my first project as well, so any comments, tips or ideas are more then welcome.


Nomothumu (i could have put -uino at the and like most) is a name that started as a joke. During training the coach always checks our lap times during endurance training or flying laps (inline speed skating in my case) so we always joke he must have a muscle on his thumb by now by clicking the stopwatch that much. So Nomothumu stand for NO MOre THUmb MUscle. And version 0.9 since it is the ninth big software improvement/adjustment and not yet finished (and still on a breadboard) so it didn't deserve a 1.0 yet ;D


The project is an IR beam to trigger the timer and can be used on tracks (since the same beam is used for starting and stopping the timer. The purpose is to offer accurate lap times so their cannot be any debate on the hand clocked times wich quitte often occur :wink:

see picture @ Time sensor | Time Sensor using IR beam and Arduino. Feature… | Flickr

Not everything is on the picture. But the sensor features:

  • an IR beam which triggers the program when the beam is broken (by passing sporter)
  • five 7-segment displays for displaying the elapsed time (time goes from 00.000s up to 99.999 seconds)
  • A reset button. When pressed the timer is stopped and set back to 0
  • A delay button. When pressed the program will ignore when the beam is broken (so if more skaters on the track you can ignore the others)
  • A 'last lap' button. When pressed the time will keep running but the last laptime is diplayed untill the button is released
  • A flipswitch for choosing between single lap mode (start-stop) or multiple lap mode (start-laptime-next laptime-etc)

Multiple LED's for showing the user when the beam is open, when de program is in 'ignore mode' and when the time is running.

See also the short vid @ Time sensor using IR beam and Arduino - YouTube

(vid shows single lap mode, the little black box on the right is the IR source, The IR sensor is in the shoebox (under the black sleeve) next to the yellow LED. Also the pushbuttons are mounted into the shoebox so I could write their function next to it with a pencil and it saves me some wired buttons laying around)


Future work

  • fix my IR source since I dropped it yesterday :-/
  • some software modification. For example the first 2 seconds the running time is not shown since I put the program in 'ignore-mode' for 2 seconds after breaking the beam so a sporter cannot start the time with his left leg and stop it with his right. This ignore mode can be programmed in a better way than using a delay function so then i will be abled to show the time on the display for the first 2 seconds
  • include (2) displays for lapcount (store was out of shift registers)
  • get it off the breadboard and on a plate
  • fit into a neat case instead of a shoebox :smiley:
  • determine the program delay to correct the given laptime
  • store laptimes in a memory
  • perhaps extra time digits for minutes and/or deca-minutes.
  • perhaps wireless handheld for operating the sensor... :-?
    and probably some more ideas that i come across

on request I'll clean up the code and post it here :wink: but it is more a collection of basic code then very impressive programming :stuck_out_tongue: but you've got to start somewhere :slight_smile:

Hope you enjoy

Nice application of Arduino-power :slight_smile:

Thanks for sharing!

I'd be interested in looking at the code if you wouldn't mind posting it. I'm completely new to arduino and i was hoping to do a project with infrared beams.

no problem at all... i'm a bit further at the moment but have the idea that I can crop the code a lot so if anyone knows better way of handling... feel free to comment (especially writing to the display were the same code returns a lot of times but I did not succeed in putting it in a custom function)

a few comments are missing since I'm still working on the code. When you have questions feel free to ask.

but note that the IR beam itself has almost no programming since (in my project) breaking the beam just switches a relais so when you hook it up to 3/5V and to an input pin you just read a High or Low when the beam is broken and the relais is switched...

part 1

/* Nomothumu 0.13
 * Vincent Riemersma 2008
 * 
 * Program for timekeeping using a IR beam and a relais. 
 * Elapsed time is displayed on 7 segment displays.
 *
 */


int ledPin = 13;                 // LED for blinking connected to digital pin 13
int buttonPin = 12;              // Relais connected to digital pin 12 to start/stop the timing
int delayPin = 11;               // LED for delay connected to digital pin 11
int modePin = 10;                // Flipswitch connected to digital pin 10 to switch between single and continious mode
int resetPin = 9;                // Button connected to digital pin 9 to reset timer
int delaybuttonPin = 8;          // Button connected to digital pin 8 to close beam
int lastlapPin = 7;              // Button to show last lap for 2 seconds

                                 // pins to drive the 7 segment displays
int latchPin = 3;                // Pin connected to ST_CP of 74HC595
int clockPin = 5;                //Pin connected to SH_CP of 74HC595
int dataPin = 2;                 //Pin connected to DS of 74HC595


// bytes to store the numbers to be displyed on the 7 segment display without decimal point
byte cijfer[11] = {B11100111, B00100001, B11001011, B01101011, B00101101, B01101110, B11101110, B00100011, B11101111, B01101111, B00000000};
// bytes to store the numbers to be displyed on the 7 segment display including decimal point
byte cijfertwee[10] = {B11110111, B00110001, B11011011, B01111011, B00111101, B01111110, B11111110, B00110011, B11111111, B01111111};

int lastlap;                    // integer to store time of previous lap
int lastlapState;                   // State of the last-lap button
int lapcount = 0;                   // integer to store number of laps
int resetState;                     // state of the reset button
int delaybuttonState;               // state of the delay button
int modeState;                      // flipwitch position for running mode
int value = LOW;                    // previous value of the LED
int buttonState;                    // variable to store button state
int lastButtonState;                // variable to store last button state
int blinking;                       // condition for blinking - timer is timing
long interval = 100;                // blink interval - change to suit
long previousMillis = 0;            // variable to store last time LED was updated
long startTime ;                    // start time for stop watch
long elapsedTime ;                  // elapsed time for stop watch
int fractional;                     // variable used to store fractional part of time

void setup()
{
   Serial.begin(57600);

   pinMode(latchPin, OUTPUT);       
   pinMode(clockPin, OUTPUT);
   pinMode(dataPin, OUTPUT);

   pinMode(ledPin, OUTPUT);           
   pinMode(buttonPin, INPUT);         
   pinMode(delayPin, OUTPUT);         
   pinMode(resetPin, INPUT);          
   pinMode(delaybuttonPin, INPUT);    
   pinMode(modePin, INPUT);           

   digitalWrite(resetPin, LOW);       
   digitalWrite(buttonPin, HIGH);     
   digitalWrite(delaybuttonPin, LOW); 
   digitalWrite(delayPin, LOW);   
                                                                          // at start up set time to 00.
                      digitalWrite(latchPin, LOW);                        // send to 7 segmetn displays
                      shiftOut(dataPin, clockPin, LSBFIRST, B11100111);   // set seconds to 0.
                      shiftOut(dataPin, clockPin, LSBFIRST, B11110111);   // set seconds to 0.
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);          // turn last 3 digits off
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);                      
                      digitalWrite(latchPin, HIGH);                       // stop sending to 7 segment display   
}

void loop()
{
  
  int h,i,j,k,l,m,n, o;                                  // 7 extra integers for time display
   
   buttonState = digitalRead(buttonPin);                 // read the button state and store
   resetState = digitalRead(resetPin);                   // read the button state and store
   delaybuttonState = digitalRead(delaybuttonPin);       // read the button state and store
   modeState = digitalRead(modePin);                     // read the button state and store
   lastlapState = digitalRead(lastlapPin);               // read the button state and store

if (blinking == false && resetState == HIGH)             // if time is not running and reset button is pressed reset lapcount to zero
  {
     lapcount = 0; 
                   
                      digitalWrite(latchPin, LOW);                        // send to 7 segmetn displays
                      shiftOut(dataPin, clockPin, LSBFIRST, B11100111);   // set seconds to 0.
                      shiftOut(dataPin, clockPin, LSBFIRST, B11110111);   // set seconds to 0.
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);          // turn last 3 digits off
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);                      
                      digitalWrite(latchPin, HIGH);                       // stop sending to 7 segment display

      digitalWrite(ledPin, LOW);                                          // Turn blinking LED off (so it won't stay light when button preseed when LED is on)
      digitalWrite(delayPin, HIGH);                                       // Light delay LED for 2 seconds
      delay(20);                                                          // Close beam for 2 seconds
      digitalWrite(delayPin, LOW);                                        // Turn off delay LED
 
}

else if (blinking == true && resetState == HIGH)                               // if time is running and reset button is pressed stop time, keep lapcount
  {
      blinking = false;                                                   // turn off timing while timing
                      
                      digitalWrite(latchPin, LOW);                        // send to 7 segmetn displays
                      shiftOut(dataPin, clockPin, LSBFIRST, B11100111);   // set seconds to 0.
                      shiftOut(dataPin, clockPin, LSBFIRST, B11110111);   // set seconds to 0.
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);          // turn last 3 digits off
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);                      
                      digitalWrite(latchPin, HIGH);                       // stop sending to 7 segment display

      digitalWrite(ledPin, LOW);                                          // Turn blinking LED off (so it won't stay light when button preseed when LED is on)
      digitalWrite(delayPin, HIGH);                                       // Light delay LED for 2 seconds
      delay(2000);                                                        // Close beam for 2 seconds
      digitalWrite(delayPin, LOW);                                        // Turn off delay LED
  }
  
if (lastlapState == true)                                               // if lastlap button is pressed show last lap
{
               if ((int)(lastlap /60000) < 1)                                // if time < 1 minute show as 12.345
                   {    
                          h = (int)((lastlap / 10000L) % 10L);              // get number of deca-seconds (10)
                          i = (int)((lastlap / 1000L) % 10L);               // get number of seconds (1)
                          j = (int)((lastlap / 100L) % 10L);                // get number of deci seconds (0,1)
                          k = (int)((lastlap / 10L) % 10L);                 // get number of centi seconds (0,01)
                          l = (int)(lastlap % 10L);                         // get number of milli seconds (0,001)
         
                      digitalWrite(latchPin, LOW);                              // send to 7 segmetn displays
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[h]);         // write deca seconds to first diplay
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfertwee[i]);     // write seconds + decimal point to seconds display
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[j]);         // write deci seconds to third display
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[k]);         // write centi seconds to fourth display
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[l]);         // write millie seconds to fifth display                        
                      digitalWrite(latchPin, HIGH); 
                   }

part 2

             if ((int)(lastlap /60000) >= 1 && (int)(lastlap /60000) < 10 )     //if time > 1 minute but < 10 minutes show as 1.23.45
                   {
// to do
// time > 1 minute not displayed correctly
// change lastlap from int into long!!! and check result

                         m = (int)(lastlap / 60000);
                         n = (int)((lastlap - (m*60000)) / 10000L);
                         o = (int)(((lastlap - (m*60000)) / 1000L) % 10L);

                      digitalWrite(latchPin, LOW);                                  // enable writing to display
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfertwee[m]);         // 
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[n]);             // 
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfertwee[i]);         //
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[j]);
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[k]);                      
                      digitalWrite(latchPin, HIGH);                             // stop writing to display
          
                   }                  
  // to do
  //      if ((int)(lastlap /60000) >= 10)                                           //if time > 10 minutes show as 12.34.5
  
  
      digitalWrite(ledPin, LOW);                                          // Turn blinking LED off (so it won't stay light when button preseed when LED is on)
      digitalWrite(delayPin, HIGH);                                       // Light delay LED for 2 seconds
      delay(20);                                                        // Close beam for 2 seconds
      digitalWrite(delayPin, LOW);                                        // Turn off delay LED
 
}
  
  else
  
  {
  
  if (blinking == true && delaybuttonState == HIGH)                        // If time is running and delay button is pressed keep in this loop so no breaking of the beam is detected
  {
                      
             if ((int)(elapsedTime /60000) < 1)                              // if time < 1 minute show as 12.345
                   {                          
                      elapsedTime =   millis() - startTime;                  // store elapsed time                 
                      h = (int)((elapsedTime / 10000L) % 10L);               // store first digit of time in seconds      
                      i = (int)((elapsedTime / 1000L) % 10L);                // store second digit of time in seconds      
                          
                      digitalWrite(latchPin, LOW);                          // keep time running on display (only seconds)
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[h]);     // first digit of seconds
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfertwee[i]); // second digit of seconds including decimal point
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);            // turn last 3 digits off
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);                      
                      digitalWrite(latchPin, HIGH);
                   }
             if ((int)(elapsedTime /60000) >= 1 && (int)(elapsedTime /60000) < 10 )  //if time > 1 minute but < 10 minutes show as 1.23.45
                   {
           
           m = (int)(elapsedTime / 60000);
           n = (int)((elapsedTime - (m*60000)) / 10000L);
           o = (int)(((elapsedTime - (m*60000)) / 1000L) % 10L);

                      digitalWrite(latchPin, LOW);                                  // enable writing to display
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfertwee[m]);         // 
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[n]);             // 
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfertwee[i]);         //
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[j]);
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[k]);                      
                      digitalWrite(latchPin, HIGH);                             // stop writing to display
          
                   }  
                   
  // to do
  //      if ((int)(lastlap /60000) >= 10)                                           //if time > 10 minutes show as 12.34.5
                   

    digitalWrite(ledPin, LOW);                                              // turn of blinking LED
    digitalWrite(delayPin, HIGH);                                           // Turn on delay LED
    delay (100);
    digitalWrite(delayPin, LOW);                                            // Turn off delay LED (short delay so when in loop LED looks on)
  }
    
   else if (blinking == false && delaybuttonState == HIGH)              // If time is not running and delay button is pressed keep in this loop so no breaking of the beam is detected
    {                                                               // don't update time
      
    digitalWrite(delayPin, HIGH);                                   // Turn on delay LED
    digitalWrite(ledPin, LOW);                                      // turn off LED when not blinking
    delay (50);                        
    digitalWrite(delayPin, LOW);                                    // Turn off delay LED (short delay so when in loop LED looks on)
    }
    
   else
    {

   if (buttonState == LOW && lastButtonState == HIGH  &&  blinking == false)      // if time is not running and beam is broken
   {     
      startTime = millis();                                   // store the start time
      blinking = true;                                        // turn on blinking while timing
      digitalWrite(delayPin, HIGH);                           // close beam for 2 seconds
      digitalWrite(ledPin, LOW);                              // blinking LED is off during 2 seconds
      delay(2000);                                            
      digitalWrite(delayPin, LOW);                            // turn off delay LED
      lastButtonState = buttonState;                          // store buttonState in lastButtonState, to compare next time

   }

   else if (buttonState == LOW && lastButtonState == HIGH && blinking == true)    // if time is running and beam is broken
     {     
     
     if (modeState == HIGH)                                   // modestate = high  -->> single mode so stop timing after braking the beam
      {
      elapsedTime =   millis() - startTime;                   // store elapsed time
      lastlap = elapsedTime;                                  // store elapsed time for last lap function
      lapcount++;                                             // add one lap to the count
      blinking = false;                                       // turn off blinking, all done timing
      lastButtonState = buttonState;                          // store buttonState in lastButtonState, to compare next time
                                                                                  // serial print for debugging use, leave out in final version
      Serial.print("Ronde ");                                 // serial print for lap (ronde) number
      Serial.print(lapcount);
      Serial.print(": ");
      }
      else if (modeState == LOW)                               // modestate = low  -->> continious mode so stop timing after braking the beam    
      {
      elapsedTime =   millis() - startTime;                   // store elapsed time
      startTime = millis();                                   // store the new start time since we start a new lap
      lastlap = elapsedTime;                                  // store elapsed time for last lap function
      lapcount++;                                             // add one lap to the count
      blinking = true;                                        // keep blinking on because we start a new lap  (not needed since it was alreaady on) laptime stays vivible for 2 seconds beacuase of delay further on
      lastButtonState = buttonState;                          // store buttonState in lastButtonState, to compare next time
      Serial.print("Ronde ");                                 // serial print for lap (ronde) number
      Serial.print(lapcount);
      Serial.print(": ");
      }

      Serial.print( (int)(elapsedTime / 1000L) );           // divide by 1000 to convert to seconds - then cast to an int to print
      Serial.print(".");                                    // print decimal point
      fractional = (int)(elapsedTime % 1000L);              // use modulo operator to get fractional part of time
      if (fractional < 100)                                 // if fractional < 100 the 0 is ignored giving a wrong time, so add the zero
      {
      Serial.print("0");                                    // add zero
      if (fractional < 10)                                  // if fractional > 10 both zero's are ignored so add antoher zero
      {
      Serial.print("0");                                    // add another zero  
      }
      } 
      Serial.println(fractional);                           // print fractional part of time

part 3

h = (int)((elapsedTime / 10000L) % 10L);              // get number of deca-seconds (10)
      i = (int)((elapsedTime / 1000L) % 10L);               // get number of seconds (1)
      j = (int)((elapsedTime / 100L) % 10L);                // get number of deci seconds (0,1)
      k = (int)((elapsedTime / 10L) % 10L);                 // get number of centi seconds (0,01)
      l = (int)(elapsedTime % 10L);                         // get number of milli seconds (0,001)
      
             if ((int)(elapsedTime /60000) < 1)                                // if time < 1 minute show as 12.345
                   {      
      
                      digitalWrite(latchPin, LOW);                              // enable writing to display
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[h]);         // write deca seconds to first diplay
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfertwee[i]);     // write seconds + decimal point to seconds display
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[j]);         // write deci seconds to third display
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[k]);         // write centi seconds to fourth display
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[l]);         // write millie seconds to fifth display              
                      digitalWrite(latchPin, HIGH);                             // stop writing to display
                    }
                    
             if ((int)(elapsedTime /60000) >= 1 && (int)(elapsedTime /60000) < 10 )  //if time > 1 minute but < 10 minutes show as 1.23.45
                   {
           
           m = (int)(elapsedTime / 60000);
           n = (int)((elapsedTime - (m*60000)) / 10000L);
           o = (int)(((elapsedTime - (m*60000)) / 1000L) % 10L);

                      digitalWrite(latchPin, LOW);                                  // enable writing to display
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfertwee[m]);         // 
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[n]);             // 
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfertwee[i]);         //
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[j]);
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[k]);                      
                      digitalWrite(latchPin, HIGH);                             // stop writing to display
          
                   }       
                   
  // to do
  //      if ((int)(lastlap /60000) >= 10)                                           //if time > 10 minutes show as 12.34.5

                   
      digitalWrite(ledPin, LOW);                                 // Turn blinking LED off
      digitalWrite(delayPin, HIGH);                              // Turn delay LED on
      delay(2000);                                               // 2 second delay to close the beam
      digitalWrite(delayPin, LOW);                               // Turn delay LED off
      
   
   }

   else{
      lastButtonState = buttonState;                         // store buttonState in lastButtonState, to compare next time
   }

   // blink routine - blink the LED while timing
   // check to see if it's time to blink the LED; that is, is the difference
   // between the current time and last time we blinked the LED bigger than
   // the interval at which we want to blink the LED.

   if ( (millis() - previousMillis > interval) ) {
     
      if (blinking == true && delaybuttonState != true && lastlapState != true)                     // If time is running start blinking and keep updating display
      {
      elapsedTime =   millis() - startTime;                     // store elapsed time                 

      h = (int)((elapsedTime / 10000L) % 10L);                                  // get number of deca seconds
      i = (int)((elapsedTime / 1000L) % 10L);                                   // get number of seconds    
        
        if ((int)(elapsedTime /60000) < 1)                                      // if time < 1 minute show as 12.345
         {             

                      digitalWrite(latchPin, LOW);                              // enable writing to display
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[h]);         // write deca seconds to first diplay
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfertwee[i]);     // write seconds + decimal point to seconds display
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);                // keep other three displays empty
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);                      
                      digitalWrite(latchPin, HIGH);                             // stop writing to display

         }
         
        if ((int)(elapsedTime /60000) >= 1 && (int)(elapsedTime /60000) < 10 )  //if time > 1 minute but < 10 minutes show as 1.23.45
         {
           
           m = (int)(elapsedTime / 60000);
           n = (int)((elapsedTime - (m*60000)) / 10000L);
           o = (int)(((elapsedTime - (m*60000)) / 1000L) % 10L);

                      digitalWrite(latchPin, LOW);                                  // enable writing to display
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfertwee[m]);         // 
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfer[n]);             // 
                      shiftOut(dataPin, clockPin, LSBFIRST, cijfertwee[i]);         //
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);
                      shiftOut(dataPin, clockPin, LSBFIRST, B0);                      
                      digitalWrite(latchPin, HIGH);                             // stop writing to display
          
         }
         
        digitalWrite(delayPin, LOW);                                            // turn off delay pin (it should be off but just in case
        previousMillis = millis();                                              // remember the last time we blinked the LED

        
         if (value == LOW)                            // if the LED is off turn it on and vice-versa.
            value = HIGH;
         else
            value = LOW;
         digitalWrite(ledPin, value);
      }
      else{
         digitalWrite(ledPin, LOW);                   // turn off LED when not blinking so when it stops blinking in on-state it is turned off
      }
   }
  }
  }
}

/* todo
 * - flipswitch for switching between laptime and total time in continous mode
*/

// end of program

(good to post my code because I think I found the reason of one of my bugs by reading the entire code over)

In very short:

  1. check is reset button is pressed, IF SO, stop time or set display to zero
  2. check if last lap button is pressed, IF SO, show last lap on display, keep time running
  3. check if delay button is closed, IF SO, don't do anything when beam is broken
  4. IF delay NOT pressed, check for braking beam, start/stop time or end a lap and start a new lap instant (according to position of flipswitch)
  5. when time is running, blink LED and keep updating display (only whole seconds)
  6. end program

code still in development same as the hardware since we found out soms functions/buttons were missing or could be adjusted. I use some dutch words in ther (ronde=lap, cijfer=number)(etc) but they are explained in the comments mostly so it should be readable

(hope I copied all the lines ;))

enjoy

thanks for posting, looks good to me.

This looks really great. Thanks for posting the code. Now, any chance of some kind of schematic? If you have anything, that would be very helpful.

Well, sorry, but I don't have any schematics. But if you read the code, you will see there is no complex wiring used at all.

Only the IR beam is not so easy but that was jus a little kit I bought so you can look that one up at:

http://www.produktinfo.conrad.com/datenblaetter/100000-124999/117536-an-01-ml-Infrarot-Lichtschranke_de-en-fr.pdf

The rest is just simple push buttons and flip switches. Wiring up the 7 segement displays is also very simple and there is a good guide on the arduino site (and I hooked up 5 in serie i.s.o. the 2 in the example).

Any questions feel free to ask. But like i mentioned, I don't have a scheme for you but I think the previous information will do.

Greetz

Thanks for the info timekeeper.

I'll study the code for wiring info.

Hey Timekeeper.

Sorry to bother you but I'm having a lot of trouble when I copy your code. I gets lots of strange characters which stop the code from compiling. I've tried searching and deleting them but with no luck.

Any chance of you making a link to a code text file?

Hi - I am new to this so please bear with me - I was searching for some electronic equipment to use to perform a split time function in Curling. (big rocks played on ICE) (olympic sport)

So - I spottted your thread and here we go.

I need to develop a piece of kit that involves a couple of light (ir) beams or similar set up across an Ice sheet (about 4m). The player delivers a stone from one end of the ice and as the stone breaks the first beam a timer starts, then breaking the second beam (some 8M later) - timer stops. The readout is the 'split time' and needs accuracy to 0.01 seconds. - This gives feedback to the player on the 'weight' (or delivery) of the delivered stone.
Your ongoing projecft seems perfect !! - only thing is Im no electronics guy.

Any advice, component lists, drawings etc. - could be a big thing - current devices I have seen are all bespoke and very expensive

Regards

Andy T

check your pm-box

timekeeper- I stumbled across this thread and am very interested in your project. Its just the sort of thing I have been trying to figure out how to put together. I need a simple timekeeper -- that is triggered ON by a beam break, and then triggered back off by breaking the same beam again. And accurate to xx.xxx seconds. I am new to the forum (and arduino) and would like some more information if youre willing to help me. Thanks

Hi Timekeeper, I think this post is from quite a while ago..! Sorry for bothering you after all this time about your stopwatch but I am building a large 7 Seg LED Stopwatch for Irish Road Racing (Motorcycles) and to also use at the Isle of Man TT races next year.
You code for pausing and continuing the lap time is perfect for what I need. I was just wondering if you made any further progress on it?
A close up picture of your arduino board showing inputs and wiring would really help. Any other updates or info would also be welcome.

Many thanks
Warren

How would I change this program to display this to a Adafruit ST7565 LCD screen??

Project is kinda hidden in the basement at the moment. Had some problems with powering (but probably due to my lack of knowledge) and the IR-controler had some difficulties in bright sunlight (=huge IR source). Since the IR-beam was just a kit, it's kinda hard to put a pot meter in it for sensitivity adjustment.

So that's the status at the moment. For my camera I made remote with laser beam and I think it would be easy to fit it into this project.