> From: "W. Lee Vick, Jr." > > PIC.gurus, > > I also have a little LED project and was looking for some help with > it. I'd like to build a box which determines the order of finish of a pine > box derby (small wooden cars about 7" by 3" which run down a slotted track) > race. Ideally there will be one micro controlling things, 6 sensors (one for > each lane in the race), and 6 7-segment LED's which will show the position > in which the cars finished, and a button for resetting the system for the > next race. Thanks to info on the 595 I've figured out how to use it for > displaying the race results (or whatever else I want to display). My > questions are about the micro,the sensors, and the LED's: > > 1. Can anyone recommend a good IR TX/RX pair which is small, cheap, > and will work over distances of about 3". Also, how do I wire this thing up? > Do I just treat it as a normally open switch? Since you work for TI (I assume Texas Instruments) they make optoelectronic devices like this - you should take advantage of your employer's resources. My employer makes tape drives. These contain such sensors for determining whether the tape is loaded. Unfortunately, I have no idea who actually makes the sensors. > > 2. Any recommendations for 7-segment LED's? Ideally they'd have > current limiting resistors built in (to save wiring - I'm just an engineer > so my wire-wrapping skills are very suspect), be cheap (a recurring theme - > hey, this is for the Cub Scouts and they're not rich), and be as big as > possible (and no, I don't want to pay $5-10US each for 3" high versions). A bit optimistic price-wise unless you can find some surplus. HP make LED displays. I got HDSP3400's which are reasonably cheap, a few cm high and good efficiency. Current limiting resistors not built-in so you should use resistor packs if wiring is a problem. Forget wire wrapping! Making a PCB is so easy these days. But first, prototype the circuit on a breadboard. > > 3. I figure I need about 14 I/O pins, maybe an INT, and a timer or > two. Which PIC should I use? Well you don't need a timer if you are only interested in the _order_ of events, unless you need an overall timeout in case one of the cars goes "off the rails". You don't even need interrupts because the PIC is fast enough to do everything by polling. You just set up one humungous program loop which updates and multiplexes the display, queries the start button and reads the sensors as appropriate. The number of I/O pins is a bit of a killer otherwise you could use an 18-pin device. You will have to go for a 28-pinner such as 16C73. Because of the simple application (not timing or interrupt critical) it would be easy for you to completely test the software operation using MPSIM. This would almost guarantee that you would only have to burn the EPROM once. > > I thank you, and if I can get all this working then the little Cub > Scouts thank you. > > Cheers, > > Lee. > > ************************************************************************ > * Lee Vick * I had a nightmare that I was in an elevator * > * leevick@ti.com * with Kenny G and Michael Bolton, a gun, and * > * +1 713-274-2241 * just one bullet... So I shot myself. * > ************************************************************************ > * Standard disclaimer: TI as an organization is much too smart to * > * to agree with anything I have to say. * > ************************************************************************ > I would have lined them up and plugged both of 'em at once. Regards, SJH Canberra, Australia