Hi all! I am looking for some advice on a race car data logger project I am hoping to undertake this Winter. I will try to give as much information as possible about what I am trying to accomplish and some of the requirements that I have for the system. My understanding of how this will all tie together is basic at this point so figuring out the best approach is the goal here.
The DAQ setup is for a circle track race car that is a pure race car i.e. no nonsense when it comes to existing computer systems like OBD so that sort of acquisition is not possible (there will be significantly more wiring in the DAQ than the car itself). I would like to record the data to an SD card in no more than 10 minute sessions. I have looked into similar commercial systems and they are upwards of $4k so I think I can do it with Arduino and myself for pennies on the dollar.
My number one goal right now is a system capable of logging a 5V analog input from a linear potentiometer at each shock/spring at a rate of 100Hz. This seems like the easiest sensors to start with anyway. I already have (4) 10k-ohm transducers and an Arduino Uno
I see that there are some limitations that might pose some serious roadblocks, if not now, then certainly in the future with any expansions that I would like to add. I have a wishlist of other readings including: Throttle position, steering position, GPS, 3-axis accelerometer, etc
I need some help with the steps involved here:
How is the voltage input from each sensor going to be processed by the Arduino and stored on the SD card? Are the sensors going to be all read simultaneously or are there delays that will affect performance i.e. are the data points going to be synced with regards to time? I have seen some talk about needing some sort of way to buffer the information before it is written to the card?
What would be the most efficient way to plot and view the data when downloaded from the SD card to a PC?
400Hz and logging to the SD card is pushing it for the basic 16MHz Arduinos. The analogRead() function is fairly slow and SD cards can be annoyingly slow at the worst times. There are a number of projects online that show you how to log this much data to an SD card. It's not as simple as you might think.
This is a full-size car with a human driver, right?
Running low voltage analog wires along the full length of the car will pick up all sorts of amazing interference. I mean enough energy can be induced into the wires to kill the Arduino, not just disturb the readings a little. The electrical environment in any car is actually much more damaging to electronics than you would ever imagine. Every single wire coming in or out of your box must be protected against plus and minus 24V continuous, with up to 15000V static electricity spikes.
Thanks for the tips. I will do some more research on the reading/writing.
Yes, it's a full-size car so the cable lengths would probably be 6ft long at worst case. However, the ignition system basically has no shielding to prevent interference. I was originally thinking of using phone wire or ethernet (with a couple wires left over) and connector harness for the analog sensors but that doesn't provide very much protection from the dangers you describe. Would shielded ethernet cables grounded to a metal enclosure for the Arduino be sufficient?
Ethernet cables are twisted-pair. They achieve very good resistance to interference by sending identical but opposing currents down each wire of the pair. This is NOT what happens when you connect the center pin of a potentiometer to an Arduino analog input. The shielding will help somewhat, but I would not expect it to be suitable for 6ft of analog sensor wire.
It doesn't cost much to try. Just tape everything on outside the bodywork and start the engine. See if the interference is small enough for you to do what you want.
The next thing to try would be a small Arduino (Mini, Micro or Teensy) at each sensor so that the length of analog wiring is just an inch. Then you would need a digital bus like CAN or MODBUS for the centre controller to talk to each sensor.
I suspect that you will have to go to proper digital sensors at each wheel. This could easily cost $100-$5000 per corner.
You are correct, it would be quite simple to test once I solve a few more problems and get a setup together.
I was wondering if you might know how this is circumvented on automobiles? Most vehicles have analog sensors, throttle position sensors for example, mounted close to the interference-causing ignition systems unless there is shielding in the ignition system itself to prevent interference.