Shop OBEX P1 Docs P2 Docs Learn Events
Pinewood Derby Race Timer Progress and Questions. — Parallax Forums

Pinewood Derby Race Timer Progress and Questions.

Martin_HMartin_H Posts: 4,051
edited 2011-02-02 20:53 in General Discussion
I finished my hot wheels sized pine wood derby race timer prototype. It works pretty well and using the reduced scale track I was able to prototype the electronics and write the control software. Now I need to scale it up to a full sized track and I thought I would ask a few questions of people who might know the answers.

I am going to need to make the sensor wires and gate control wires longer. But how long can the wires be and still be reliable? I'm afraid if I make them too long I'll get glitches from my sensor which will lead to spurious race results or inability to lift the gate. Will heavier gauge wire make them more reliable?

I used CDS cells hooked up to an A/D converter for the finish line sensors. In the code I calibrate the sensors at race start and watch for a significant drop in illumination as a car goes over the sensor. This seems to work well enough, but most people seem to use photo transistors instead of cds cells. Is this because photo-transistors only have two states and eliminate the need for the A/D converter, or do transistors switch faster?

I'm using a servo to control the start gate and I'm hoping to use this on the full size gate as well. The servo was fast enough for the prototype, but it might be slower with a larger gate. Time will tell.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-12-20 18:51
    You could make the gate spring loaded and then use the servo to release it.
  • ercoerco Posts: 20,260
    edited 2010-12-21 09:46
    Don't need no 'lectronics for Hot Wheels sized cars! This simple mechanical finish line is some of my finest work in 27 years... shows which lane came in and in what order.

    http://www.amazon.com/Hot-Wheels-4-Lane-Raceway/dp/B000JSI63G
  • Martin_HMartin_H Posts: 4,051
    edited 2010-12-21 17:37
    Erco, that's really cool and my son would love it. Now can you make it forty feet long and big enough for pine-wood derby cars?
  • Martin_HMartin_H Posts: 4,051
    edited 2010-12-21 18:09
    BTW I finally bit the bullet and learned how to get a video onto my computer and upload it to YouTube:

    http://www.youtube.com/watch?v=eb6WKBRd_R8
  • AttorneyJonAttorneyJon Posts: 10
    edited 2011-02-01 16:48
    Nice job Martin_H! I wonder if you'd be willing to share your code? I started working on something like this for my son this weekend. I used an erector set and the basic stamp to control the servo, but didn't get a chance to set up sensors -- or for that matter -- even figure out how to code something like that. If you'd be willing to share your code, I'll give you all the credit! Thanks for any help.
  • wrightmewrightme Posts: 43
    edited 2011-02-01 17:07
    The track we used when I was a Den Leader had a release button that triggered a solenoid. A rubber band then pulled the catch to drop the gate. When the gate dropped, an arm with a magnet passed a sensor that triggered the timing start. The finish line and sensors were next to the computer.
  • Martin_HMartin_H Posts: 4,051
    edited 2011-02-01 18:44
    @AttorneyJon, hey thanks! I plan to release the schematics and source code under the greater GPL and post them on my son's pack website (I'm the web master too). That way other packs can build them. l plan to post a pointer to it from this thread along with a video of the production model (which is complete). The derby is Saturday, so it will likely be after that.

    If you want it sooner, send me a personal message me and I'll send you a copy.

    To answer my own question above. Since I have a 42 foot run of cable, I decided to use CAT-5 cable for the sensor and control wires. The theory being that the twisted pairs are noise resistant, but cat-5 is so common it is really cheap per foot. For the servo I used two conductors for each servo wire to make it a little beefier.
  • groggorygroggory Posts: 205
    edited 2011-02-02 00:01
    Martin_H wrote: »
    @AttorneyJon, hey thanks! I plan to release the schematics and source code under the greater GPL and post them on my son's pack website (I'm the web master too). That way other packs can build them. l plan to post a pointer to it from this thread along with a video of the production model (which is complete). The derby is Saturday, so it will likely be after that.

    If you want it sooner, send me a personal message me and I'll send you a copy.

    To answer my own question above. Since I have a 42 foot run of cable, I decided to use CAT-5 cable for the sensor and control wires. The theory being that the twisted pairs are noise resistant, but cat-5 is so common it is really cheap per foot. For the servo I used two conductors for each servo wire to make it a little beefier.

    As to wire length: Take the wire that you want to use. Measure the resistance per foot. Multiply by the number of feet you want. Apply a little Ohm's law. Then you will find out if the voltage drop penalty is within your design spec.

    As to ADCs...TOTALLY UNNECESSARY! ADCs increase cost, require processing time, affect timing precision (not much, lol), and aren't necessary. Just use a IR sender and photoTransistor. Then add in a little circuitry to make it act as a binary system and you now have some nice digital switches (and cheap to boot).
    http://www.sparkfun.com/products/246
    PS...Your CDS cells will work fine too. Just make them behave as a binary system. You may want to add some Schmidt triggers in there.

    As to voltage drop. If you need to go farther you could always increase the voltage. Just make sure the voltage going into your microprocessor is within spec.

    As to directly driving the servos off the microcontroller. Why are you doing that? I mean, if the question of whether the micro can power it or not comes into question then just increase the voltage and make a simple transistor or mosfet circuit to interface the two together

    As to CAT5 being noise resistant. It totally isn't unless you design for it. It has no shielding! So in of itself it is not noise resistant. The reason why people use CAT5 for networking and how it got its reputation for being noise resistant is because of the twists + the signaling. In a normal digital circuit (like yours) you send logic highs as +3.3V and logic lows as +0V. If I add some AC voltage and get it to interfere with your wire let's say I manage to get 2V AC induced into your wiring. Now your logic highs can be electrically as low as 1.3V and as high as 5.3V! Your circuit may be able to tolerate the 5.3V and read it (or fry your micro) but that 1.3V will likely either be undetermined or detected as low (corrupted data). On the same note your logic lows can be as low as -2V and as high as 2V, again an undesirable situation.
    ...On a balanced circuit you'd have two wires for each signal that would be opposite each other. So a logic high would be transmitted as 3.3V on one wire and -3.3V on the other wire. Let's say that 2V AC signal gets induced on that wire. The first wire goes to 5.3V and the second wire goes to -1.3V. Recenter that signal (little subtraction) and we can see that 2V got put on the wire and the correct signal is +/- 3.3V (high). Unless you design this 'balanced circuit' in you won't get noise reduction.
    ...Regardless, CAT5 is a perfectly fine wire choice.

    Good luck on your project. Looking good!

    PS. Feel free to post up your schematics and I'm sure plenty of us could help you improve upon them. I'm an eagle scout so always willing to help out a fellow scouter. If your schematic becomes polished enough I'd even be willing to draw it up in Eagle PCB for ya so you can get a pro PCB made....make your whole device last a little nicer.
  • wrightmewrightme Posts: 43
    edited 2011-02-02 05:37
    CAT 5 twists work for ethernet and T1 for noise resistance, because they are differential signals. It would also work for 422.

    For the "voltage/zero" logic, no. In fact, if you send a TX/RX down a twisted pair, I would expect crosstalk between your tx/rx.
  • Martin_HMartin_H Posts: 4,051
    edited 2011-02-02 18:20
    @groggory , the ADC was built in so I used it, otherwise I would have used a photo transistor. I know it is a little slower, but I timed it to make sure it was fast enough. I'm pretty much using it as a binary system where I look for the edge transition from high to low voltage. The servo is controlled from a separate cable with only the servo signal line comes from the microcontroller. The voltage and ground are the lines come from the battery.

    I'll definitely post the schematic and a new video when I get a chance. Likely after Saturday.


    @wrightme, I'm sending an analog voltage down the cable with a ground return, so no digital tx/rx.
  • wrightmewrightme Posts: 43
    edited 2011-02-02 20:53
    Martin_H wrote: »
    @groggory , the ADC was built in so I used it, otherwise I would have used a photo transistor. I know it is a little slower, but I timed it to make sure it was fast enough. I'm pretty much using it as a binary system where I look for the edge transition from high to low voltage. The servo is controlled from a separate cable with only the servo signal line comes from the microcontroller. The voltage and ground are the lines come from the battery.

    I'll definitely post the schematic and a new video when I get a chance. Likely after Saturday.


    @wrightme, I'm sending an analog voltage down the cable with a ground return, so no digital tx/rx.

    Correct, that was understood. Well, by "analog," do you mean you are sending a contact closure to actuate a solenoid?
    Twisted pair should work fine for your purpose, but does not really gain you a "noise reduction" benefit. As a suggestion, use a pair doubled up to reduce resistance, thus reducing voltage drop on the run. My comments towards the noise reduction were between differential and non-differential data signals, and yours are not data signals.

    If it were I, and I was using the light level analog voltage to show the finish, I would make that line as short to the stamp as possible, and make the solenoid line the long one.
Sign In or Register to comment.