Pinewood Derby Race Timer Progress and Questions.
Martin_H
Posts: 4,051
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.
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
http://www.amazon.com/Hot-Wheels-4-Lane-Raceway/dp/B000JSI63G
http://www.youtube.com/watch?v=eb6WKBRd_R8
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.
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.
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.