I know this might seem like a strange place to ask such a question, but I have a need to build a 8 lane race track that will be used for Matchbox type cars that will run a single run (downhill race) and I want to control it via a computer where I can monitor which lane wins, calculate speed, turn on lights and output times to a digital display, etc… I was thinking that some of the hardware used in robotics might be the ticket and was wondering if anyone could help suggest which hardware might work the best for such an application.
I know that there are people out there that already sell complete kits for derby cars, etc., but for an 8 lane track it would cost close to $1000. I’m pretty sure this could be done a lot cheaper.
Also, which software would be easiest to code for such an application?
Actually, I’ve designed several race tracks over the years starting back in 1978 using the old TI-99 . However, things have changed quite a bit over the years and I did another one around 10 years ago using primarily relays, IR sensors that I built using radio shack parts, etc… Having a little spare time my hands, I thought I would build one for a show we have coming up in December that is a charity event for the US Marine Corps Toys for Tots. I thought it would be cool to have it set up where I could have the computer active during the race and feed the winning lanes into a program that would calculate the times and log the informttion into a database. To do this I would have to have a serial interface that could take the inputs from each lane.
Anyway, I have never programmed a microcontroller before except for some basic code for the SPLAT PLC’s for some control systems I built several years ago. I love playing with new things and was hoping that some of the robotic microprocessors might be easy to program and interface. By what I can tell from the spec sheets, it looks like your suggestions are along that line.
I guess the Arduino Mega Sensor Shield is required to interface with the sensors, is that correct? Does this include the 2X16 Serial LCD or is it driven directly from the microcontroller?
The DFRobot GP2Y0D180Z 2-10cm Range Sensor is good from 2cm up to around 10. Since this is a range sensor, what happens when a car would pass underneath it and would there be enough change in voltage, etc, to tell the difference between the track and the car itself which would only be 1/4 inch closer?
For a novice, how difficult would the programming be for the microprocessor? I started writing code for a SPLAT PLC that I had lying around and it probably would do the job but does not allow me to interface with the computer in real time. I assume the outputs from the Arduino Mega 2560 Microcontroller could be read in real time, is that correct?
One more thing, would a reflective sensor such as the RB-See-191 work for the finish line? I could place a reflective surface in each lane and when the cars passed underneath it should break the beam except what is reflected off each car. Are these more sensitive to ambient light, i.e, may not work well in direct sunlight?
By the way, I do some other simple things with servos if you care to watch an example go to our website for our sons project, Herbie stephensherbie.com/video/index.html.
You need a sensor which trips when the car crosses a specific point. An infrared sensor can do this easily (which you connect to a microcontroller).
calculate speed
This would be the difference in distance traveled over time, so you need to trigger a timer as soon as the race starts (you can do this with a servo motor which holds back the cars, and lowers a gate while the microcontroller starts the timer. As cars cross the IR beam at the end, the microcontroller records the time and then calculates the average speed.
The LCD is sold separately. Most LCDs are controlled via digital pins (parallel) serial (two pins) or I2C (4 pins). The MEGA has several serial lines, one of which can be connected to the computer, the other to the LCD.
Consider making a hole in the lane (not so wide that the car falls in of course) and placing the sensor facing upwards. The signal will change from “infinity” to the smaller distance as the car passes over.
Not too difficult if you know the basics of programming.