fig1 illustrates a preferred embodiment of this event detector invention constituting an automatic scorekeeper 1 , especially applicable to the game of basketball ( or throwing balls through a hoop ). in this basketball embodiment , each team ( or player ) selects one basketball having at least one unique characteristic ( such as color ) with respect to other balls available . for example , either light ball 21 or dark ball 19 is selected . light ball 21 may be defined to correspond to a home team , whose point total is displayed on the backboard via a display means , such as 7 - segment leds 3 . alternatively , an electromechanical scoring means such as dials or rotating indicators can be used and controlled to display the score . dark ball 19 may be defined to correspond to a visiting team , whose point total is similarly displayed via leds 5 . each time a ball passes through the hoop , the appropriate team &# 39 ; s or player &# 39 ; s score is increased by two points and a respective buzzer 16 or 18 corresponding to the indicated ( scoring ) team is sounded . respective buzzers 16 and 18 may make different sounds to provide audibly distinctive scoring feedback . alternatively , instead of two buzzers one buzzer or sound producing element can be used and controlled by software to oscillate at different frequencies to produce two different sounds . thus , to play a game , each player or team need only choose a ball and shoot ( after initialization steps have been taken , as discussed further below ). the scoring for the home team as well as that of the opposing visitor team is automatically separated and respectively recorded and displayed by the leds . manual scorekeeping is totally unnecessary . the hoop 15 is mounted on a backboard 22 , which backboard may be attached directly to a wall or mounted on a stand , pole or similar article . to determine which ball has passed through hoop 15 , electrical contact switch 23 is mounted on or near hoop 15 so that it is actuated by a ball passing therethrough ( or , in the case of a proximity switch , nearby ). the output of contact switch 23 is monitored by the electronic circuitry contained within backboard 22 ( or alternatively in hoop 15 ), which circuitry uses the contact switch output to determine the presence of a ball . whenever a ball is detected , led 11 ( mounted on or in hoop 15 ) is energized to thereby illuminate the immediate inner hoop area , including the detected ball passing therethrough . phototransistor 13 then measures the amount of light emitted from led 11 which is reflected by ball 19 or 21 , and thus determines whether the ball is relatively light or dark , since the amount of reflected light varies with the color ( or even tint ) of the ball . in order to increase the reliability of the ball color determination by the phototransistor , a plurality of reflectivity readings are taken as the ball passes through the hoop . the average of all the readings is calculated and is deemed to be the actual ball color for that scoring event . relative to a single or lesser number of samples , this averaging process greatly enhances the reliability of the color ( or other physical characteristic ) determination . the basketball game may also be played in a solitairy mode by moving selector switch 33 from the &# 34 ; dual &# 34 ; play position to the &# 34 ; solitaire &# 34 ; play position . in the solitairy mode , the visitor &# 39 ; s display is used as a seconds countdown timer . depressing reset button 29 resets a built - in timer to 99 seconds and the timer then begins its countdown to 0 . either ball passing through hoop 15 during the 99 second period registers two additional points on the home team display and rings the home team &# 39 ; s buzzer . if desired , either ball passing through the hoop in this solitaire mode could increment the score by one instead of two . when the clock reaches 0 , the visiting team &# 39 ; s buzzer sounds to alert the player that the game is over . the solitary mode thus allows a single player to perfect his game by playing &# 34 ; against the clock &# 34 ;, and displays an automatic measure of his daily progress ( raw point score in the given time period ). fig2 illustrates one electronic circuit embodiment comprising the in - hoop ball sensor in fig1 . normally open electronic contact switch 23 ( ball there ) is closed ( as aforenoted ) whenever a ball passes through hoop 15 . ball there ( 202 ) is a digital program variable ( discussed further below ) which signals that color sampling of the ball must be initiated , and is connected to the input port of a microprocessor . closure of switch 23 also supplies power to led 11 and phototransistor 13 , both of which otherwise remain unpowered in order to conserve power , since the present invention may be battery powered for portability ( or adapted to receive and operate on household current ). once ball there switch 23 is closed , led 11 illuminates the ball in the hoop , and the light reflected from the ball is sensed by phototransistor 13 . variable resistor 206 enables adjustment of phototransistor 13 &# 39 ; s output level so that the amount of light normally reflected from a &# 34 ; light &# 34 ; ball and received on phototransistor 13 will saturate the transistor and drive output 200 ( color ) low . variable resistor 206 is also adjusted so that the amount of light normally reflected from a &# 34 ; dark &# 34 ; ball will not saturate the transistor and hence not drive output 200 ( color ) low . output 200 ( color ), is connected to the microprocessor , thus indicating thereto the color ( i . e ., reflectivity ) of the ball in hoop 15 . fig3 a and b illustrate one preferred embodiment of the scorekeeper &# 39 ; s electronic circuitry , which operates in accordance with the program flow charts shown in fig5 and 6 . the program is stored in rom 301 ( preferably a 2716 ), and is executed by microprocessor 303 ( preferably a z - 80 ). ram 302 ( preferably a 6116 ) stores the program &# 39 ; s dynamic variables . interface of the microprocessor with leds 3 , 5 , phototransistor 13 , led 11 , reset button 29 , and solitaire / dual switch 33 , is accomplished with parallel input / output port 306 using conventional technology . parallel i / o port 306 drives leds 3 and 5 by means of driver 308 , preferably a 74ls49 . each of the seven segments of each led comprising displays 3 and 5 is connected in parallel with each of the seven segments of the other 3 leds , thus necessitating only seven , not 28 , driving lines . individual leds are selected by enabling the common cathode &# 34 ; turn on &# 34 ; line of appropriate led by the standard output leads b4 - b7 of i / o port 306 ). thus , at a given time only one led is driven , yet the frequency of refreshing each driven led is such that no flicker is visible . color signal 200 and ball there signal 202 ( from fig2 ) are provided from the in - hoop sensor 23 to input ports 12 and 10 on parallel i / o port 306 as described above and are interfaced therewith by means of conventional buffers . remaining components and interconnections illustrated in fig3 a and 3b ( such as the 555 timer , resistors , inverting amplifiers , etc . ), although necessary for proper operation of the preferred embodiment , are well understood by one of ordinary skill in the relevant arts and hence do not require further explanation here . fig4 illustrates an alternative embodiment of fig3 a and b wherein the circuitry and electronics thereof is integrated into a custom part thereby reducing the area required to house the electrical components . fig4 illustrates such a custom part 401 ( preferably a cop 410l single - chip microcontroller made by national semiconductor ), as well as the supporting electronics for this custom part . interconnection requirements and the supporting electronics for custom part 401 , in view of the explanation aforegiven for fig3 a and b , and the level of detail shown in fig4 are within the skill of those of ordinary skill in the art ; hence , further discussion is omitted . the electronic circuits of fig3 a and 3b and 4 function in accordance with the flowcharts of fig5 and 6 . as mentioned above , the principal controller may be a z - 80 microprocessor or its equivalent , or a custom part , depending upon the requirements of a given embodiment . fig5 discloses program flow when the scorekeeper is in the dual ( non - solitary or competitive ) mode . in block 501 , the hardware is initialized and the software variables are preset . the variable score ( h ) corresponds to the accumulated score for the home team and is displayed to the players via leds 3 ( fig1 ). this variable , as well as score ( v ) ( the visitor counterpart of score ( h )), is preset to 0 . the variable color , initialized to $ 8 , 000 , will be explained below . the variable score debounce effects a 260 millisecond countdown timer , the purpose of which is to prolong the minimum time within which the scorekeeper will recognize two independent scores . this prolongation ensures that a single scoring event will not be recognized as multiple scoring events , a phenomenon which would otherwise occur due to the ball opening and closing the ball there switch numerous times as it fell through the hoop . in the preferred embodiment , score debounce serves to put the program in a 260 millisecond loop immediately after a score is detected . specifically , once the ball there switch opens after having been depressed by the presence of a ball , color sampling stops , and the 260 millisecond loop begins . if , during the loop , ball there recloses , color sampling is resumed and score debounce is reset to 260 milliseconds ( the presumption here is that the ball has remained in the hoop from the original scoring event ; hence , color sampling should ( and does ) resume where it left off ). eventually , of course , the ball will drop free of the hoop area and the timer loop will run for a full 260 milliseconds . once the full 260 milliseconds expires , the color samples will be tested and the appropriate score will be incremented . a 260 millisecond delay , though sufficiently long to obviate multiple scoring , is sufficiently short to obviate having different scoring events being erroneously treated as a single scoring event . after initializing the variables in block 501 , program flow continues to block 502 where the controller samples the reset button . if the reset button is depressed , flow branches to block 542 where the variables are reset to their initial values ( see block 501 ). then the program continues at block 503 . in block 503 , score debounce is tested to ascertain whether the ball there switch has remained open for 260 continuous milliseconds after the detection of a score . if it has not remained open that long , score debounce will be greater than 0 and the program will therefore branch to block 531 . after delaying in block 531 for a full millisecond , flow will continue to block 530 where score debounce will be decremented , thus recognizing the millisecond delay in block 531 . if score debounce then equals 1 the 260 millisecond ( approximate ) delay has run its course ; thus program flow progresses to block 550 . at this point ( block 550 ), a score is recognized . to accomplish the color determination ( necessary to determine which party scored ), the color variable ( which contains the accumulation of the color samples ) is tested . this process is explained more fully below . if score debounce is not greater than 0 when tested in block 503 , or is not equal to 1 when tested in block 532 , the controller will branch to block 504 and interrogate the ball there switch . as aforenoted , this interrogation is physically performed by having the microprocessor , by standard techniques , sample ball there contact 202 ( fig2 ). if the interrogation yields that the switch is open ( i . e ., no ball is in the hoop ), no action need be taken , and the program branches to block 513 where the display and buzzers are updated . if , on the other hand , ball there switch 23 is closed , a ball &# 39 ; s presence has been detected . if a ball has been detected , color sampling must be initiated ( blocks 508 - 512 ). first , however , the 260 millisecond score debounce timer must be initialized , so that countdown timing may begin when the ball there switch reopens after the ball leaves the hoop . accordingly , in block 505 , the score debounce timer is preset to 260 milliseconds . in block 506 , the program delays for a full 24 milliseconds , thereby allowing the phototransistor transients to subside ( recall , to conserve power , battery power is supplied to the phototransistor only when ball there switch 23 is closed ). ball there switch 23 is sampled after this 24 millisecond delay . if it is no longer closed , the earlier sample ( block 504 ) is treated as noise ( i . e ., an error ). such switch - bouncing noise might typically occur when a ball hits the rim of the hoop , but yet fails to enter the hoop . if ball there switch 23 has remained closed for the full 24 millisecond period , there is no noise , and flow continues to block 508 , where ball color sampling begins . blocks 508 - 512 implement color sampling of the ball while it is in the hoop , so that a score may be attributed to the proper player . to attribute a scoring event to the proper player , a number of color samples are taken during the scoring event . this method reduces errors which would otherwise result if a single sample method were used . the results of these numerous samples are accumulated in the variable color . in the present embodiment , sampling is commenced at the closing of ball there switch 23 ( block 504 = yes ), and sampling continues so long as the switch remains closed . once the switch opens ( upon the ball leaving the hoop ), score debounce counts off 260 milliseconds , after which the accumulated samples ( in color ) are analyzed to determine the mean color sample . if the mean sample indicates the ball was relatively &# 34 ; light &# 34 ; ( according to some preset threshhold ), the ball is deemed to be that of the home team . if , on the contrary , the mean sample indicates the ball was relatively &# 34 ; dark &# 34 ;, the ball is deemed to be that of the visitor . scores are manipulated accordingly . to carry out this color sampling scheme , color is initialized to the value $ 8 , 000 in block 501 , and after every score is reinitialized in block 553 . a single color sample is taken each time the program passes through the series of blocks 504 - 507 ( as described earlier ), which sampling is physically performed by phototransistor / light - emitter means contained in the hoop ( also described above ). if the single sample indicates a &# 34 ; light &# 34 ; ball is in the hoop , color is incremented in block 510 . if the sample indicates a &# 34 ; dark &# 34 ; ball , color is decremented in block 512 . blocks 509 and 511 are intended to obviate overflow ( positive and negative , respectively ) of color by bypassing the increment / decrement blocks ( 510 / 512 ) when the next sample would result in overflow . after each individual color sample , program flow loops back to block 513 . in this block , the program refreshes the display leds and , if appropriate , sounds the proper scoring buzzer . once this is performed , program flow returns to the main loop . if the ball is still in the hoop , the ball &# 39 ; s color will again be sampled when the program reaches block 508 . this process continues until the ball leaves the hoop . when the ball has left the hoop and the score debounce timer has expired , the controller will be at block 550 , where the average ball color will be determined and appropriate scores updated . this operation is easily performed by comparing the contents of the color variable with its initialized value of $ 8 , 000 ( block 550 ). if the net number of &# 34 ; light &# 34 ; samples ( increments ) was greater than the net number of &# 34 ; dark &# 34 ; samples ( decrements ), color will be greater than $ 8 , 000 , and the ball will be deemed &# 34 ; light &# 34 ;. similarly , if the net number of &# 34 ; dark &# 34 ; samples ( decrements ) was greater than the net number of &# 34 ; light &# 34 ; samples ( increments ), color will be lesser than $ 8 , 000 , and the ball will be deemed &# 34 ; dark &# 34 ;. in the event that color is greater than $ 8 , 000 , the score corresponding to the player using the light ball ( score ( h )) will be incremented ( twice ) in block 554 . additionally , a program flag will be set ( block 555 ) in order to ring the home team &# 39 ; s buzzer when the program reaches block 513 . if color was less than $ 8 , 000 similar steps will be taken , though of course substituting the &# 34 ; dark &# 34 ; player &# 39 ; s score and buzzer . once the score and buzzer variables are updated to reflect the most recent score , the color variable is reset to its initial value ($ 8 , 000 ). finally , the controller branches again to block 513 where the leds are changed to reflect the new point total . also , the buzzers are activated , if appropriate . at this point , the last scoring event is completed , and the scorekeeper awaits the next scoring event . the cyclical process described above continues for the duration of the game . the winner , of course , is the player or team who scores the most points within the arbitrarily chosen time frame . fig6 demonstrates program flow when the scorekeeper is operated in the solitary mode . ( switch 33 in the &# 34 ; solitaire &# 34 ; position ). in this mode , any ball passing through hoop 15 adds 2 points to the home team &# 39 ; s score ( leds 3 ), and the visitor &# 39 ; s score ( leds 5 ) is converted from a score display into a countdown clock which displays the time remaining in the game . in playing the game , the lone player attempts to maximize his points within the given time period , and continuously can observe his progress by watching the score and the clock . each time the player passes a ball through the hoop , the home team &# 39 ; s score is increased by two , and the home team buzzer is sounded . further , when time expires the visiting team &# 39 ; s buzzer is sounded , thus indicating the end of the game . when the clock in the solitaire mode expires , further scoring will be disabled . this is shown in fig6 boxes 603 to 653 to 602 to 603 . in block 601 the hardware and software are initialized . counter is a counter in which each unit represents 1 millisecond . after each 1 , 000 unit decrementation of this counter , the scorekeeper clock will be decremented by 1 second and counter will be reset . score debounce serves the same function as it did in the dual mode : ensuring that that ball there contact switch 23 has remained opened for 260 continuous milliseconds after the last scoring event before a ball &# 39 ; s presence in the hoop will be recognized for purposes of a subsequent scoring event . timer represents the number of seconds displayed on the scorekeeper clock ( visitors score ), which indicates the time remaining in the game . score , the lone player &# 39 ; s ( or team &# 39 ; s ) score , is displayed on the home team &# 39 ; s display ( leds 3 ). after power - up and checking to ensure that there is no current reset ( block 602 ), program flow branches to block 603 where timer is checked to ascertain whether there is time remaining in the game . if time has elapsed ( timer = 0 ), the game has been completed , and flow branches to block 653 where the display leds are refreshed . once time has expired , program flow continues in this small loop until reset is depressed and another game is initiated . if timer has not yet reached 0 when interrogated at block 603 , the controller branches to block 604 , where score debounce is tested . if score debounce is greater than 0 , there has been a valid scoring event ; for score debounce attains a non - zero value only by being preset -- subsequent to a scoring event -- in block 606 . the program recognizes such a prior scoring event by branching to block 650 . in block 650 , score debounce is decremented to acknowledge that the ball there switch has remained opened for an additional millisecond after the scoring event ( i . e ., one more program loop has elapsed ). if score debounce is equal to one after this decrement , the ball there switch has been open for the full 260 ( approximate ) millisecond period . if this is the case , score is twice incremented ( in block 652 ), thus finally scoring the event which initiated the 260 millisecond delay process . once score is incremented in block 652 , flow moves to block 653 where the display and buzzers are updated as explained generally in the dual mode game . in the solitary mode , however , each scoring event causes the home team buzzer to sound , and the visiting team &# 39 ; s buzzer is sounded only when the time remaining in the game ( as displayed upon visitor &# 39 ; s score , leds 5 ) reaches 0 . if score debounce is not greater than 0 when tested in block 604 ( i . e ., if no current scoring event has set it to a non - zero value ), or if it is not equal to 1 when tested in block 651 ( i . e ., the 260 millisecond post - scoring event delay has not fully expired ), then program flow will branch to block 605 . in block 605 , the ball there switch is tested . if the test indicates that the ball there switch is closed , a scoring event is recognized , and the controller therefore causes the program to branch to block 606 . in block 606 , score debounce is set to 260 milliseconds . setting score debounce to 260 milliseconds ( from its initial value of 0 ) enables the program subsequently to answer block 604 affirmatively , and thereby ultimately to branch to block 652 . without so setting score debounce to a non - zero number , the test of block 604 always will result in a branching to block 605 , and score will never be incremented . setting score debounce to 260 therefore enables the program later to begin its countdown to zero and actual recognition of the scoring event . once score debounce is set to 260 milliseconds in box 606 , or if the ball there switch is found not to be closed in the block 605 test , the controller branches to block 607 . block 607 is the first of a series of blocks , the design of which is to effect a reasonably accurate timer . block 607 effects a 1 millisecond delay which ensures that the total time required to pass through a single full program loop in the solitary mode is approximately 1 millisecond ( the time required to pass through the other blocks is negligable in comparison ). in block 608 , the controller decrements the 1 millisecond counter to recognize that an additional millisecond of time has elapsed ( an additional program loop has been run ). then ( in block 609 ) said counter is checked to ascertain whether a full second has elapsed and thus whether the 1 second timer must be decremented ( block 611 ). if so , the counter is reset ( block 610 ) and the timer variable is decremented ( block 611 ). if not , flow branches to block 653 where the display is updated and the program continued until time elapses . in the solitary mode , the controller is thus programmed so that after depressing the reset button , a player can shoot &# 34 ; against the clock &# 34 ; while his score and the time remaining in the game are displayed on the automatic scorekeeper . such a game also affords the player a means by which he can guage his daily progress ( the raw score made before counter time - out ). as aforenoted , the invention has been described in detail with respect to an embodiment useful for scorekeeping a basketball game , although the scope of the invention extends to many other games and to non - game environments . ( 1 ) football / baseball tossing game . turn the &# 34 ; hoop &# 34 ; sideways and attempt to throw the ball therethrough . ( dual / solitaire modes ). ( 2 ) soccer game . implant sensors into a soccer goal in lieu of a hoop . ( dual / solitaire modes ). ( 3 ) tennis / soccer / baseball / gun target practice . use solitaire mode to count the score and display the time remaining in the game . of course these games are only exemplary of the many environments ( including non - game environments ) in which this invention may be used , and their enumeration here should not be interpreted as limiting the scope or environment of this invention , which is defined only by the following claims .
an object sensor apparatus detects distinctive characteristics of otherwise physically similar objects . respective indices or counters are incremented in response to the various detections . the event detector may take various forms such as a conveyor belt production monitor , but is especially useful as an electronic scorekeeper for a competitive game which simultaneously keeps score for two or more different players by distinguishing between the different colors of balls or other objects each player uses to play a given game . a solitary mode also keeps score for a single player within a given time period . in this selectable alternative mode , the event detector apparatus records accumulated points and displays the time remaining in a given time period which defines a game time period .