How do you choose the correct components?

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Hello guys. I think I have gotten close to my goal but would like some help with it. I used a online circuit simulator program to develop it. I am not sure how accurate it is, or if it would tell me if something is impossible(it does seem to indicate obvious errors). Here is a picture of it.

Screenshot (40).png

In the online simulator, it seemed to work. I could not tell if there was an issue, the simulator seemed to be bogged down with each lane I added.

I am trying to put together a simple circuit for a three lane pinewood derby track finish line. I have found multiple types of circuits that come close to what I am wanting, but nothing exactly. If you guys could tell me that this looks doable, and help me pick out the components that would make it work, I would be very grateful and so would around 60 or so kids that will be racing their cars.

The idea is there is a main power/reset switch, that will be pushed after each race. I can see where this might need to be located in a different position, or even have one for each separate circuit.

The other three switches will be photo transistors(I just used push button switches in the simulator). Triggered by the car passing over the top and blocking out ambient light.

Then each lane will have two LED's. One is for first place, the other is for second place. The third place lane will have no LED lit.

The idea is that once a car triggers the first place LED, then it "locks" out the other lanes first place LED. Then the next car will trigger the second place LED, and lock out the others.

I needed a way to see first and second, and I only could find circuits that showed first place winners. I have seen cars come very close at the finish line and this will save a lot of arguing I hope.

Please, if you guys could, help me out. I am not sure how to spec out what transistors and mosfets I need. And of course, if there is an easier way, please by all means let me know. Thanks a bunch.
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
I'll be honest, I am very new at circuitry. I could write a PLC program(using ladder logic) in a very short time, but when it comes to actual components, I know very little. In fact, I have never messed with a mosfet chip before, just realized it would let me do what I need.

I have worked with some NAND gate logic using CD4093 IC's. I tried using that, but wound up short. One important part of the circuit is that the switch for each lane is a momentary one(as the car passes over the photo-resistor). So the circuit has to latch.

I am all ears if you could give me a direction to look, but to answer the question specifically, I do now know anything about 74 or 4000 series chips.
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Well, guess that just goes to show you how illiterate I am. I guess I have indeed thought of 4000 series chip(CD 4093 - duh.....), but I could not figure out how to make it work.

I figured it would be better if I could, if you see a simple way of doing it please please show me an example, I would be very appreciative.
 

blocco a spirale

Joined Jun 18, 2008
1,546
I don't have a ready-made solution but if you forget the hardware for a moment and first solve the logic (and I think you may have already done that to some extent), it would be relatively easy to implement in hardware using logic gates.

I think timings may be tricky because each lane indicator can both read and set the "1st" and "2nd" lines.

The mosfets appear to give an AND function since they are in series.
 

dl324

Joined Mar 30, 2015
10,003
Using IC's would simplify your wiring. You'll need to add some flip flops to latch the LEDs.

Indicating finish order will be an interesting problem.

I know what you mean about arguing over finish order. My Son was "robbed" of a 1st place finish because another child said he finished first and the person recording results took his word for it. That was the tipping point for my Son and he quit Tiger Cubs with my support. I didn't like what I saw going on on numerous occasions, but waited for my Son to decide it wasn't for him.
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
I don't have a ready-made solution but if you forget the hardware for a moment and first solve the logic (and I think you may have already done that to some extent), it would be relatively easy to implement in hardware using logic gates.

I think timings may be tricky because each lane indicator can both read and set the "1st" and "2nd" lines.

The mosfets appear to give an AND function since they are in series.
Actually, the mosfets give an OR function. Each one, on the first place LED circuit, is fed from the first place LED circuit from the other two lanes. If you do not separate them then weird stuff starts to happen.

But I suppose I can substitute 2 IC's in place of the 15 mosfets. That does help a lot. As long as I choose the right IC. The two inputs to a OR gate are kept separate correct?
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Tried putting in the OR gate. No go.

The mosfets are used as a permissive switch. I am not sure how to make the logic gates do the same thing. Guess I need to play around with it.

As far as the current circuit goes. Aside from changes that could be made to make it simpler, can anyone suggest actual product numbers for the mosfets, transistors, and LED's? I would like this to run on a 12vdc power supply.
 

dl324

Joined Mar 30, 2015
10,003
can anyone suggest actual product numbers for the mosfets, transistors, and LED's?
N channel MOSFET - 2N7000
NPN BJT - 2N3904
PNP BJT - 2N3906
All about a nickel each in qty 100.

LEDs - What color, intensity, size do you want?

But you're going to need flip flops/latches to save finishing order and steering logic to indicate finishing place.

You could use optical sensors, but you'll need circuitry to compensate for ambient light level.
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Thanks. LED's, white would be fine, or I can make red work. They are just indicative and I'll know which one is first and which one is second. Of course, the brighter the better.

As far as flip flops/latches, the circuit seems to latch as it is? At least it does in the simulator. Here is a link(if it works) to the simulator/project. It is on falstad.com.

As far as the optical sensors, I was wanting to just use them in place of the three switches. I figured I might have to use another switching circuit using another transistor, but if I can make it work without that would be great. I have never played around with them before.

http://www.falstad.com/circuit/circuitjs.html?cct=$+1+0.000005+3.59933188356284+62+5+43 R+16+64+16+16+0+0+40+12+0+0+0.5 x+268+24+341+27+0+24+Lane+1 x+920+23+993+26+0+24+Lane+2 x+1466+23+1539+26+0+24+Lane+3 w+240+64+384+64+0 w+384+64+608+64+0 w+912+64+1008+64+0 w+1008+64+1168+64+0 r+176+272+176+224+0+4700 r+176+272+240+272+0+4700 t+240+272+256+272+0+-1+11.884149108697532+-4.837202460805656e-8+100 t+144+288+176+288+0+1+-11.884149114024453+0.11585083783852458+100 r+144+288+112+288+0+100000 w+256+256+256+224+0 w+144+288+144+336+0 w+144+336+192+336+0 r+192+336+256+336+0+100000 w+256+288+256+336+0 162+256+336+256+368+1+2.1024259+1+0+0 r+256+368+256+400+0+470 g+256+400+256+416+0 w+176+304+176+400+0 w+176+400+256+400+0 s+16+64+80+64+0+0+false w+176+224+256+224+0 w+176+224+176+64+0 w+176+64+240+64+0 w+176+64+80+64+0 s+80+64+80+144+0+1+true w+384+224+464+224+0 w+384+400+464+400+0 w+384+304+384+400+0 g+464+400+464+416+0 r+464+368+464+400+0+470 162+464+336+464+368+1+2.1024259+1+0+0 w+464+288+464+336+0 r+400+336+464+336+0+100000 w+352+336+400+336+0 w+352+288+352+336+0 w+464+256+464+224+0 r+352+288+320+288+0+100000 t+352+288+384+288+0+1+-11.88414911392543+0.11585083783843421+100 t+448+272+464+272+0+-1+11.884149108598507+-4.837202460805656e-8+100 r+384+272+448+272+0+4700 r+384+272+384+224+0+4700 w+80+144+288+144+0 w+320+240+320+288+0 f+272+224+320+224+1+1.5 w+272+224+272+336+0 w+272+336+256+336+0 w+288+144+320+144+0 w+320+144+320+208+0 w+848+144+848+208+0 w+816+144+848+144+0 w+800+336+784+336+0 w+800+224+800+336+0 f+800+224+848+224+1+1.5 w+848+240+848+288+0 w+608+144+816+144+0 r+912+272+912+224+0+4700 r+912+272+976+272+0+4700 t+976+272+992+272+0+-1+11.884149108566245+-4.8372022831699724e-8+100 t+880+288+912+288+0+1+-11.884149113893166+0.11585083787070036+100 r+880+288+848+288+0+100000 w+992+256+992+224+0 w+880+288+880+336+0 w+880+336+928+336+0 r+928+336+992+336+0+100000 w+992+288+992+336+0 162+992+336+992+368+1+2.1024259+1+0+0 r+992+368+992+400+0+470 g+992+400+992+416+0 w+912+304+912+400+0 w+912+400+992+400+0 w+912+224+992+224+0 f+624+384+624+288+1+1.5 w+704+224+704+64+0 w+704+224+784+224+0 w+704+400+784+400+0 w+704+304+704+400+0 g+784+400+784+416+0 r+784+368+784+400+0+470 162+784+336+784+368+1+2.1024259+1+0+0 w+784+288+784+336+0 r+720+336+784+336+0+100000 w+672+336+720+336+0 w+672+288+672+336+0 w+784+256+784+224+0 r+672+288+640+288+0+100000 t+672+288+704+288+0+1+-11.88414911399234+0.11585083787063678+100 t+768+272+784+272+0+-1+11.884149108665419+-4.837202460805656e-8+100 r+704+272+768+272+0+4700 r+704+272+704+224+0+4700 w+704+64+608+64+0 w+704+64+912+64+0 w+800+336+832+336+0 w+832+336+832+624+0 w+272+336+304+336+0 w+304+336+304+608+0 w+1392+336+1392+640+0 w+1360+336+1392+336+0 r+1264+272+1264+224+0+4700 r+1264+272+1328+272+0+4700 t+1328+272+1344+272+0+-1+11.88414910869066+-4.8372021055342884e-8+100 t+1232+288+1264+288+0+1+-11.884149114017578+0.11585083784539843+100 r+1232+288+1200+288+0+100000 w+1344+256+1344+224+0 w+1232+288+1232+336+0 w+1232+336+1280+336+0 r+1280+336+1344+336+0+100000 w+1344+288+1344+336+0 162+1344+336+1344+368+1+2.1024259+1+0+0 r+1344+368+1344+400+0+470 g+1344+400+1344+416+0 w+1264+304+1264+400+0 w+1264+400+1344+400+0 w+1264+224+1344+224+0 w+1264+224+1264+64+0 s+1168+64+1168+144+0+1+true f+1184+384+1184+288+1+1.5 w+1472+224+1552+224+0 w+1472+400+1552+400+0 w+1472+304+1472+400+0 g+1552+400+1552+416+0 r+1552+368+1552+400+0+470 162+1552+336+1552+368+1+2.1024259+1+0+0 w+1552+288+1552+336+0 r+1488+336+1552+336+0+100000 w+1440+336+1488+336+0 w+1440+288+1440+336+0 w+1552+256+1552+224+0 r+1440+288+1408+288+0+100000 t+1440+288+1472+288+0+1+-11.884149113918514+0.11585083784535044+100 t+1536+272+1552+272+0+-1+11.884149108591593+-4.8372022831699724e-8+100 r+1472+272+1536+272+0+4700 r+1472+272+1472+224+0+4700 w+1168+144+1376+144+0 w+1408+240+1408+288+0 f+1360+224+1408+224+1+1.5 w+1360+224+1360+336+0 w+1360+336+1344+336+0 w+1376+144+1408+144+0 w+1408+144+1408+208+0 w+1264+64+1168+64+0 w+1264+64+1472+64+0 s+608+64+608+144+0+1+true f+1136+384+1136+288+1+1.5 f+576+384+576+288+1+1.5 w+1168+144+1120+144+0 w+1120+144+1120+288+0 w+1152+288+1168+288+0 w+608+144+560+144+0 w+560+144+560+288+0 w+592+288+608+288+0 w+304+608+576+608+0 w+576+608+576+384+0 w+576+608+1136+608+0 w+1136+608+1136+384+0 w+832+624+48+624+0 w+48+624+48+384+0 w+832+624+1184+624+0 w+1184+624+1184+384+0 w+1392+640+624+640+0 w+624+640+624+384+0 w+624+640+96+640+0 w+96+640+96+384+0 f+1552+160+1472+160+1+1.5 f+1552+96+1472+96+1+1.5 f+992+160+912+160+1+1.5 f+992+96+912+96+1+1.5 w+464+336+528+336+0 w+528+336+528+432+0 w+528+432+1040+432+0 w+1040+432+1040+96+0 w+1040+96+992+96+0 w+1040+432+1616+432+0 w+1616+432+1616+96+0 w+1616+96+1552+96+0 w+992+336+1056+336+0 w+1056+336+1056+480+0 w+1056+480+512+480+0 w+512+480+512+96+0 w+512+96+464+96+0 w+1056+480+1600+480+0 w+1600+480+1600+160+0 w+1600+160+1552+160+0 w+1552+336+1632+336+0 w+1632+336+1632+512+0 w+1024+512+1024+160+0 w+1024+160+992+160+0 w+1024+512+496+512+0 w+496+512+496+176+0 w+496+176+464+176+0 w+384+64+384+80+0 w+384+112+384+160+0 w+384+192+384+224+0 w+912+64+912+80+0 w+912+112+912+144+0 w+912+176+912+224+0 w+1472+64+1472+80+0 w+1472+112+1472+144+0 w+1472+176+1472+224+0 f+464+96+384+96+1+1.5 f+464+176+384+176+1+1.5 w+1024+512+1632+512+0 x+1283+376+1315+379+0+24+1st x+726+373+758+376+0+24+1st x+196+376+228+379+0+24+1st x+1493+375+1533+378+0+24+2nd x+934+373+974+376+0+24+2nd x+406+374+446+377+0+24+2nd f+96+384+96+288+1+1.5 f+48+384+48+288+1+1.5 w+80+288+64+288+0 w+32+288+32+144+0 w+32+144+80+144+0
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
once you go to the link, you have to hold your mouse over one of the switches and press it to close the circuit. Then to reset you either release the main switch, or push reset in the top right hand corner of the simulator.
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
what about using a photocell instead of an ambient light sensor? Would a photocell work in place of the push button switches? May have to play around with resistance values, but I'll have a constant source of light above the track, so the light will remain the same regardless of where its used(it will always be used indoors).
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
I guess to be clear, the mosfets are P channel, not N.

I've played around with it. Still cannot see how to use IC's.
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
I had, and did again last night just in case I missed something. Unless I am missing something, this is a more involved project than I would like to do. I want a simple 1st and 2nd place indication, no need for run times and such. But, I could see making one like that in the future.

I sat back and thought about it all and realized that the requirements are low. So like was already commented, very basic components will work.

If I could wrap my mind around another circuit design I saw that does use IC's, but only shows first place, and add more to also show second place, I'd go that route. I know IC's would make the board much cleaner.
 

bertz

Joined Nov 11, 2013
327
Actually, the cleanest arrangement is to use a microprocessor (Picaxe or Arduino) but so many people get freaked out when you mention programming. I know, I used to be the same way until I discovered how much easier life can be using microcontrollers. In fact the Arduino turned out to be easier to work with since so much of the heavy lifting is already done for you.

What I discovered when I went through this same exercise was that order of finish was actually more complicated than simply recording the elapsed time.

If you insist on using ICs I have attached a flow chart to help you through your thought process. Good luck!
 

Attachments

AnalogKid

Joined Aug 1, 2013
8,305
I have a solution, but it has three 4013 dual flipflops and at least two gate packages. Seems like a lot of parts, so I'll wait to see if something more simple comes along.

ak
 
Top