Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Slot Car Race Control
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Slot Car Race Control

by tip2tail on Fri Nov 12, 2010 6:45 pm

Hi All,

I'm a bit of a newbie to this scene although I did a bit of basic electronics (designing an LED dice) in Uni many years ago.

I am however a computer programmer and I have been asked by a family member to attempt to replace the software that is used by their slot car club to:

Control power to 4x lanes
Power 4x traffic lights for the starting system
Monitor 4x light sensors that act as the lap timers


The current software makes use of a kit that connects to the Parallel port on the PC however we would like to move this to USB in order to develop a more modern application and use a new PC that will not have a Parallel port.

Here are 2 basic diagrams for the current set-up. This doesn't need to be the new setup. I'd be quite happy not to use Relays and use transistors instead.

Light Sensors:
Image

Power Control & Traffic Lights:
Image

Is there anyone able to assist in making this kind of project?

The fillement light bulbs are already in situ on a bridge over the track. They are not really part of the circut and are controled by a local switch and not by the PC.

Basically I want to be able to send signals to each of the 4 traffic lights to turn them on and off from the program, to be able to control the power to the each of the 4 lanes (the power is from an external power source) and finally monitor the light sensors so that when the car passes between the light source and the sensors I can count a new lap for that lane i.e. Sensor1-light-broken then sensor4-light-broken I add laps and log time for Lane 1 and then Lane 4.

Thanks,

tip2tail
tip2tail
 
Posts: 2
Joined: Fri Nov 12, 2010 6:41 pm

Re: Slot Car Race Control

by franklin97355 on Fri Nov 12, 2010 8:10 pm

Let's start with:
What parts do you have, what do you want it to do when you are done, how will you control it when it's changed, does it work now and how is it controlled?

franklin97355
 
Posts: 21561
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Slot Car Race Control

by stinkbutt on Fri Nov 12, 2010 8:34 pm

If you're a programmer you'll want to take most of the foofaraw around the physical computing part from this problem. Easiest way to do that is to use an arduino.

First, you set up a voltage divider with a relatively big (10Mohm) resistor pulling the either high or low, (doesn't matter which way) and then use the photoresistor to pull the other way. You can program the arduino to listen at four pins to the voltages coming out of the four photoresistors and report when each one changes. That's what happens when a car passes by the photogate. The resistance of the photoresistor changes, so the divider changes and the voltage Vout changes. Which is what the arduino detects.

After the arduino records each pass, you'll need to report that to the computer. I don't precisely know how to do that, but there are ways, I'm sure someone else in the forums can tell you how to do that.
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Slot Car Race Control

by tip2tail on Sat Nov 13, 2010 4:18 am

franklin97355 wrote:Let's start with:
What parts do you have, what do you want it to do when you are done, how will you control it when it's changed, does it work now and how is it controlled?


Well right now I have a 4 photo resistors, a lot of wire and and 8 bulbs for the new kit: 4 to test the new gantry and 4 for in the starter lights.

The current set up is as shown in those two diagrams and is connected to the PC with a parallel port connector.

As I said the main plan is to move this over to USB and I will be making a new program in C# to handle that.

Thanks,

tip2tail
tip2tail
 
Posts: 2
Joined: Fri Nov 12, 2010 6:41 pm

Re: Slot Car Race Control

by chatham on Sat Nov 13, 2010 4:19 pm

I'm going to chime in and say that probably the quickest, easiest way to do this is going to be with Arduino and Processing. It's not my personally preferred way of making things (I do a lot of work making independent USB devices), but it's very likely going to be the fastest, simplest, easiest-to-get-good-advice system for doing something like you're doing. Besides, with the new Uno's, it's my understanding that you can make fully-featured USB devices now, so if you want to get fancier later, it'll be an exclusively firmware/software updating proposition.

So my recommendation would be to buy an Arduino if you don't have one already, as well as a couple of LEDs and a potentiometer or two. Actually, this right here sounds just about perfect. Those should give you enough basic things to get used to Arduino and do a couple of the examples so you can figure out how the Arduino/Processing pairing works, then apply what you've learned to your project.

With the Arduino, you should be able to easily read in the phototransistor inputs, as well as control the relays that you're using to turn on and off the lights, but it's of course going to take a little bit of time to get used to the Arduino. Heck, you could even have the Arduino take care of the lap timing.

This seems like a really great starter project - simple, but complicated enough to really learn things, and personally useful to boot! Good luck!
OpenChord.org - Open Source kits to let you play Guitar Hero with a real guitar, or build your own Wii/PS3/USB controllers.

chatham
 
Posts: 144
Joined: Thu Feb 04, 2010 2:30 am

Re: Slot Car Race Control

by some_call_me_tim on Mon Nov 15, 2010 6:54 pm

I would echo Alan's recommendation for using an Arduino. You could even conceivably get rid of the host computer. There are plenty of people familiar with the Arduino, here and at Arduino.cc. It uses a C-like language for programming so that shouldn't be a problem for you. Although you are using most of the standard digital I/O with what is presented here. You could consider upgrading to the Arduino Mega to get more I/O or you could consolidate lights and relays on a single pin using registers. For example, I could see setting up a speed trap (two sets of photo interrupters on the same track), so more I/O is always nice.

One specification I didn't see is what voltage/current is going to each track. If I remember my youth, you probably have 0-12V going to the track via a controller, but I have no memory of how much current. That will probably determine if you can go without relays. That ULN 2803A can sink 500mA, which is probably too little for the track but maybe enough for the lights, especially if you trade them out for LEDs.

some_call_me_tim
 
Posts: 7
Joined: Mon Nov 15, 2010 6:00 pm
Location: Sonoran Desert

Please be positive and constructive with your questions and comments.