Toy race car winner detector?

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
Hi,

I want to build a simple, low component count detector to identify the winner of a 'hotwheels' toy car race.

The design would be simple - an optical detector over a mirror on each track will signal when the reflection is broken, and the detectors will connect to a latching IC which will hold the output pin for the first broken relection high, driving an LED.

Should be simple, but I don't know how to find the best IC for this. Must have a minimum of two - ideally 4+ gates. and a reset. But how do I specify that to a component database? If anyone has any suggestions I would be very grateful to hear from them...
 

DickCappels

Joined Aug 21, 2008
10,661
You can start by specifying the behavior or the circuit. Do you want to indicate only which car passed over the detector first?

How does the state of the phototransistor in the optical detector relate to the presence of the car?
 

Ya’akov

Joined Jan 27, 2019
10,234
I am certain you aren’t considering an MCU as a solution for this problem, but you want:

  1. Simple
  2. Low component count

which is precisely a description of a solution based on an 8-pin MCU like an ATTiny85. Not only does it have a low component count, almost certainly lower than any solution not based on an MCU, but it allows revisions and added functionality by simply writing some code.

A quick review of the current state of circuits designed to solve this problem shows they are all based on MCUs, usually naïvely on an “Arduino” much larger than is required, but still on an MCU.

Were I building such a thing today I would certainly be using an MCU. I would use the ATTiny85 because I have standardized on the ATTiny series for such applications, but frankly I would seriously consider something like a Seeed XIAO or similar tiny, self contained, wireless equipped development board so it would be possible to add new features that included communicating with an app or remote display, and sending lap and finish times to a central location.

You certainly wouldn‘t have to implement such features initially, but you would be in a position to do it easily.

So, I know it’s not what you had in mind, but it does fit the requirements as stated and I believe it does so better than options that depend on hardware to deal with the logic involved.

Whatever you choose, good luck with your project.
 

sghioto

Joined Dec 31, 2017
8,634
One analog solution using a 555.
A Low output from the optical sensor will trigger and latch the 555 output high.
Output from the latched 555 will inhibit all optical sensors locking out the other circuits.
1692288746866.png
 

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
Thanks for all the responses! They are all most useful, and I am grateful for the time you took.

I see the point you are making - electronics has moved on a lot since my day, when discrete components and knowing where your electrons were going was teh norm! No wonder I couldn't find what I was looking for...

The only downside I can see for me is the programming- something I am not used to at all. I will have to learn a whole new skill...
 

sghioto

Joined Dec 31, 2017
8,634
Circuit with optical detector. When the car blocks the light source the LDR resistance increases and trips the 555 latch.
The emitter of Q1 goes High and inhibits all other circuits from tripping.
Verified operation on the breadboard with proper light source and shielding.
1692294429943.png
 

Ya’akov

Joined Jan 27, 2019
10,234
Thanks for all the responses! They are all most useful, and I am grateful for the time you took.

I see the point you are making - electronics has moved on a lot since my day, when discrete components and knowing where your electrons were going was teh norm! No wonder I couldn't find what I was looking for...

The only downside I can see for me is the programming- something I am not used to at all. I will have to learn a whole new skill...
Fortunately, using the Arduino IDE and the extensive help available in the form of tutorials, references, and how-tos make it a lot easier than it might seem at first. It is a new skill, but as you’ve already experienced, the hardest part is at the start and as you accumulate knowledge it gets easier and easier.

You don’t have to become an expert to do some great stuff with modern MCUs and the Arduino IDE—and the advantages of MCUs are eno
 

AnalogKid

Joined Aug 1, 2013
12,126
I want to build a simple, low component count detector to identify the winner of a 'hotwheels' toy car race.
What you are describing is called a "game show circuit", which is itself a modification of a "radio button" circuit. Coming out of the GE College Bowl, it is a circuit that latches an indicator on, and locks out all other inputs, when a switch is pressed after a Reset, There are dozens of schematics for this on the innergoogle, and many threads on this and other forums.

The sensor mechanism is a constant across all designs, including ones using uC. Constant light source, optical shield around each detector, power source and output conditioning. After that it is a tradeoff between wiring time and coding / debugging time.

Note that both hardware and software have inherent latencies. Whatever approach you use, there will be a possibility of a tie. Both circuitry and code can be optimized to reduce the time between first-sensor-detection and the lockout of all other inputs, but that time cannot be zero. This gets into counting up gate delays and transistor bandwidths, versus counting instructions, how many clock cycles per instruction, and clock speed. Life is choice.

As an example of the concept, here is a radio button circuit from another thread. For your application, it needs an additional reset button, a tune-up for faster latching speed, and lockout feedback.

Here is the thread:
https://forum.allaboutcircuits.com/...omatic-alternate-toggle-latching-outs.158962/

ak

RadioButtons-8-1-c.gif
 
Last edited:

Thread Starter

Dodgy Geezer

Joined Nov 30, 2009
181
Wow! So many links! Thanks again...

I find the difficulty is in using the right words to indicate what you want. So many things exist already under a name that I donn't know about. The only words I could think of were 'latching' and 'finish' - neither of which drew me into the circuitry that you are displaying here....
 

strantor

Joined Oct 3, 2010
6,875
Using a Picaxe 14M2 micro. Complete circuit and program.
View attachment 300730
I know nothing about picaxe. Does it check the pin state at each IF statement or does it check all pin states once per scan and then run the code? In the case of the former (this probably an infinitesimal quibble if it is even valid) it seems like there is a chance that the incorrect winner could be declared. For example car #3 blocks the light as the code is just starting to evaluate "if pin4 = 0 then" and in the time it takes for the code to finish and start over at "if pin1 = 0 then", car 2 passes the light and then at "if pin2 = 0 then" car #2 is declared the winner even though car 3 was first.

You would probably need a high speed camera to catch it so probably wouldn't matter but it's just more of a curiosity on my part.
 

sghioto

Joined Dec 31, 2017
8,634
Correct. It's reading or scanning the inputs from 1 to 4. Possible car 1 could cross the line before say car3 depending on which line of code the program was at but it would be within micro seconds.
 
Last edited:
Top