Telemetry Project

Hello all,

I have a project I am working on, and would like the thoughts and input from those more experienced with the Arduino. I have searched the forum, as well as the Reference and Learning sections, and believe my ideas to be sound. However, I would still prefer to know I'm on the right path before shelling out the time and money, only to end up banging my head against the wall... :slight_smile:

I am working on providing telemetry data from a race car to the pit. Unfortunately, the engine is pre ODB-II, so collecting the data is requiring a bit more effort than originally planned. Additionally, the terrain of the course is quite varied, ranging from flat open desert to 1500' rocky mountains in an underdeveloped (no reliable cell service), remote location - so the communication method is limited. I want to sample 7-8 measurements, use the Leonardo to dump them into a HAM TNC as ASCII, and display the data on the laptop in the pit. My thoughts so far are:

Sending units -> Arduino Leonardo -> HAM TNC -> radio -> air -> radio -> HAM TNC -> laptop.

From my reading in the forums and documentation sections, I believe that the Arduino will be able to perform this function with relative ease. The questions I am looking for direction on are:

  1. Will tapping the sending unit's wiring for input into the Arduino alter their accuracy at the in car gauges (or Arduino)? Electronic theory is not my strongest subject. :frowning:
  2. Can anybody recommend a readily available application (Windows or Linux), that will allow me to display the received data on the laptop - preferably as gauges?
  3. Any other thoughts, ideas, or direction, you might want to throw out there.

I am really enjoying researching this project, it has forced me back into learning and playing with electronics - something I haven't done in at least a decade. The Arduino, the RaspberryPi, and so many other options are available now that make these types of amateur/home-brew projects both easy and affordable.

thx,
bfj

  1. Will tapping the sending unit's wiring for input into the Arduino alter their accuracy at the in car gauges (or Arduino)?

It shouldn't if your car gauges are low impedance. In any case, you can/should use OpAmps as voltage followers or buffers to tap the signals and connect them to Arduino. This will avoid loading the instruments too much and provide the right signals to Arduino. You may even need to set some amplification to the Op Amps and invert signals or add DC levels depending on what the gauges get to work with. It's not difficult to do that. Check the signals you will be tapping and post here your measurements so we can help you better.

You can check these configurations to get familiar with the subject.

-Summing Amplifier
-Voltage Follower.
-Non Inverting Amplifier
-Inverting Amplifier.

  1. Can anybody recommend a readily available application (Windows or Linux), that will allow me to display the received data on the laptop - preferably as gauges?

-Labview maybe?
-You can always make your own code; but that's going to be a bit harder.

You have come up with a nice project idea.

Good luck.

Thank you arduinoadrian for the input, it looks as if I've got more reading to do.

It shouldn't if your car gauges are low impedance. In any case, you can/should use OpAmps as voltage followers or buffers to tap the signals and connect them to Arduino. This will avoid loading the instruments too much and provide the right signals to Arduino. You may even need to set some amplification to the Op Amps and invert signals or add DC levels depending on what the gauges get to work with. It's not difficult to do that. Check the signals you will be tapping and post here your measurements so we can help you better.

I am waiting for them to settle on the specific gauges/sending units, and then will do exactly that.

-Labview maybe?

My bad, I forgot to add the ever important "cost-effective" qualifier. I looked at LabVIEW, and while it appears that it would do everything I need and more, it is well outside our current budget.

-You can always make your own code; but that's going to be a bit harder.

Unfortunately, my coding abilities ended with AppleWorksBASIC some 25 years ago. Save for some lite HTML, PHP, and advanced batch files for running my networks, I am not much of a coder. I have looked into some VB controls that would give me the display functions in Excel - but will wait a little while to see if something less-expensive, or preferably FOSS, presents itself.

You have come up with a nice project idea.

Good luck.

Thank you. When I volunteered to help with this, I was under the impression the engine was a 1997, instead of the 1991 it actually is. That 97 engine would have been ODB-II compliant, and much easier to extract the needed data from. I'm hoping I can hack this thing together, but a little luck never hurts!

Thanks again!
bfj

  1. Can anybody recommend a readily available application (Windows or Linux), that will allow me to display the received data on the laptop - preferably as gauges?

There are some interesting web based GUIs that display data as gauges.

OK everybody, after waiting for the team to select and order the gauges, finally getting the information out of the vendor, conducting a fair amount of research into OpAmps, and playing around with an Uno and a pot, I think I have a slightly better understanding of how the input side of my little project is going to work. The signal from the majority of the sending units is .5-4.5v, which is great as I won't have to screw around with dropping 12v signals to Arduino levels. If my understanding of the OpAmp is correct, I need a simple voltage follower as arduinoadrian originally recommended. My question now is, can somebody recommend an OpAmp that will fill this need?

Also, any input on what would be the best way to take the 0-12v signal from the voltmeter, and bring it into the Arduino? I've read that I am probably looking at a voltage divider, but any other suggestions (including links to reading material) would be appreciated.

I'm still waiting on info for the tach and speedo, and will tackle them when it arrives.

thx,
bfj

LM324.

Very basic quad op-amp - works down to ground IIRC.

Just a voltage divider. Two resistors. Do recall that a car's charging voltage is not 12V. :smiley:

Thanks Paul__B, I actually picked up an LM324 earlier to do some more testing with - glad it will work for production as well!

Yeah, I realized that 12v was not going to be the high end as I was driving home. There goes my "just order a Rugged and be done with it" idea...

Here is what I came up with schematic wise (using an LM358, just for illustration purposes), is my understanding (and implementation) of what I read regarding voltage following op-amps correct in this?

As always, any input/constructive criticism/hints/etc are appreciated!

thx,
bfj

No schematic visible.

Sorry, had trouble getting the image attached...

Also, to confirm my theory, I want to run the voltmeter through another voltage following op-amp and then through a voltage divider, correct?

Thanks again!
bfj

Firstly, when using an op-amp to isolate those inputs, add a resistor - say 22k - between the input from the car gauges and the op-amp. You then need to add the same resistor in the feedback from the output to the "-" input of the op-amp to match the impedances. All this protects your op-amp from adverse voltages from the car wiring and protects your car wiring from the op-amp going up in smoke for whatever reason.

Similarly, the voltage divider for the battery voltage goes before the op-amp, and you need a resistor in the negative feedback that matches the parallel resistance of the two voltage divider resistors.

If the op-amp is running from 12V, you probably also want resistors between its outputs and the Arduino to prevent it feeding 12V-odd into the Arduino.

Thank you Paul__B. I've revised my schematic based on your input, and believe it to reflect your recommendations. I calculated the divider based on a possible 15v from the vehicle's charging system, and a desired high side of 4.5 for the Arduino. My calculations for the negative feedback came to just under 3200, so I used a 3.3K R in the schematic. I do however, have more questions now...

  1. How exact does the negative feedback R need to be? Do I need to mess around with finding a perfect balance between 3 Rs?
  2. Not an argument, just a clarification of theory for my understanding - in my mind, it seems that I'd want to pull from the voltmeter through the op-amp first, then to the divider, so that there is no load affecting the gauge further down the original circuit. You suggested the opposite, do you mind elaborating for me?
  3. I added 5v supply from the Arduino to the op-amps in the schematic, is this a good or bad idea?

Thank you for all your assistance, I was very excited testing this out on my breadboard!
bfj

BigFootJim:

  1. How exact does the negative feedback R need to be? Do I need to mess around with finding a perfect balance between 3 Rs?

No, balance need not be perfect for this degree of precision. I think you picked it perfectly already. Better to calibrate it in software as you are going to have to scale the readings anyway.

BigFootJim:
2. Not an argument, just a clarification of theory for my understanding - in my mind, it seems that I'd want to pull from the voltmeter through the op-amp first, then to the divider, so that there is no load affecting the gauge further down the original circuit. You suggested the opposite, do you mind elaborating for me?

Well, the 22k in parallel with the gauges will not affect them at all - particularly since the input impedance of the op-amp is so high. I didn't think the voltmeter was monitoring anything other than battery voltage - the battery clearly will not care. In any case, you could multiply the resistors by ten or more. Whatever you connect the voltage divider to "sees" the series resistance of the two.

BigFootJim:
3. I added 5v supply from the Arduino to the op-amps in the schematic, is this a good or bad idea?

The op-amps are low drain as I understand it. This does avoid isolation problems if you were to run from 12V.

I'm glad to see your progress with this project... a very neat one by the way. As a simple suggestion, I think it's better to use a potentiometer in your voltage divider that will allow you to adjust the fraction of voltage you are going to feed to the OP Amps more precisely. This will simplify the code later on. Simply use 2 resistors as usually for the voltage divider; but place a pot with a resistance value around 10 times smaller than the value of the resistor connected to ground. Take the voltage from the pot wiper and send it to the opamp. This will allow you to precisely adjust the voltage fraction using 5% resistors instead of 1% ones. Easier to experiment with the divider set up that way.
Good Luck

Paul__B:

BigFootJim:
2. Not an argument, just a clarification of theory for my understanding - in my mind, it seems that I'd want to pull from the voltmeter through the op-amp first, then to the divider, so that there is no load affecting the gauge further down the original circuit. You suggested the opposite, do you mind elaborating for me?

Well, the 22k in parallel with the gauges will not affect them at all - particularly since the input impedance of the op-amp is so high. I didn't think the voltmeter was monitoring anything other than battery voltage - the battery clearly will not care. In any case, you could multiply the resistors by ten or more. Whatever you connect the voltage divider to "sees" the series resistance of the two.

Yes, thank you for the clarification. Another case of me confusing different parts of this project - sleep deprivation combined with excitement about this has got me a little slow...

arduinoadrian:
I'm glad to see your progress with this project... a very neat one by the way. As a simple suggestion, I think it's better to use a potentiometer in your voltage divider that will allow you to adjust the fraction of voltage you are going to feed to the OP Amps more precisely. This will simplify the code later on. Simply use 2 resistors as usually for the voltage divider; but place a pot with a resistance value around 10 times smaller than the value of the resistor connected to ground. Take the voltage from the pot wiper and send it to the opamp. This will allow you to precisely adjust the voltage fraction using 5% resistors instead of 1% ones. Easier to experiment with the divider set up that way.
Good Luck

I'm glad to be making progress as well, thank you. I think I like this idea too. I can use a trimmer at 450-500ohms (if I've grasped the concept correctly) to give me a nice round figure to make the math/code easier - is this right?

I've built out my breadboard as follows based on my understanding, and input from you guys. Please let me know if I'm on the right path, and if I missed or screwed anything up. Once again, I truly appreciate all of the help and guidance on this. This is another shining example of why I love the FOSS community so much!

Oh, and I've decided to drop the Leo and move to a Mega - our crew chief added yet another gauge (9 total now) and I believe that I should be able to fab this onto a Mega proto-shield for a tight, clean design.

thx,
bfj

Not bad, but on further consideration, the LM324 is unable to drive positive voltages right up to the full 5V.

I have suggested better alternative op-amps (just today!) in this post.

Thanks Paul__B, I had noticed that I was only seeing about 3.82v coming out of the 324, and was thinking that I might have screwed something up. Price and packaging of the LMC6484 is the same as the LM324, and the pinout looks the same according to the datasheet, so the design impact is negligible - unless this will change the resistor requirements.

The Mega operates at 6v-20v, with 7v-12v being recommended - I'm thinking an LM7809 with a couple of caps to give her a steady 9v would work well. There is a note of the 5v being low and the board becoming unstable if supplied with less than 7v.

Would anybody care to share their thoughts on a GPS module? I was going to use a TNC with integrated GPS capabilities, but it is proving difficult to combine the Arduino telemetry data into the TNC the way I had imagined. If I collect the GPS data through the Arduino, I can pass all of the info through the TNC and just parse it on the receiving end.

Finally, how would I go about determining the vehicle's physical orientation? Specifically, I'd like to know if there is a way to know if she is lying on her side or top - ignoring the girlish screams from our driver/co-driver... :slight_smile:

thx,
bfj

Can you post a list of the all Gauges you need and the pins where you are planning to input them?. The picture is just too big and I has to be moving it all around to get the general idea. Also the min scale value, number of major divisions and full scale of each of them will help understand what you really need. You will need to have that list handy anyway, to write any code.
I also suggest you make a preliminary drawing (could be by hand) of the set up you want to have on the computer screen, being realistic of course. Don't shoot to high as it could get troublesome to build it on a first project. You can put whatever you want and then begin to remove what you don't really need to make the project work at first. In later versions, you will always have time to add and improve; but you have something running already.
Thanks

OK, the list so far is below:

A0 - Oil Pressure 0-100 with major divisions at 20/40/60/80 0.5-4.5v
A1 - Oil Temp 140-280 with major divisions at 160/180/200/220/240/260 0.5-4.5v
A2 - Coolant Temp 100-260 with major divisions at 120/140/160/180/200/220/240 0.5-4.5v
A3 - Fuel Pressure 0-100 with major divisions at 20/40/60/80 0.5-4.5v
A4 - Speedometer 0-160 with major divisions at 20/40/60/80/100/120/140 5v pulse
A5 - Air Fuel Ratio 0-18 with major divisions at 10/12/14/16 0.5-4.5v
A6 - Trans Temp 100-260 with major divisions at 120/140/160/180/200/220/240 0.5-4.5v
A7 - Voltmeter 0-18 with major divisions at 10/12/14/16 12v (varies)
A8 - Tachometer - 0-10(K) with major divisions at 1/2/3/4/5/6/7/8/9 12v pulse

Would also like to include GPS, a panic button, and possibly a roll sensor. There is a potential to add more down the road (switch positions, 4WD Hi/Lo, Trans gear, etc), but I think this is enough for this revision.

While I'd love to deliver replica gauges onscreen to our crew chief, I also understand that it will not be easy to implement. Additionally, we plan on having a course map on screen with position overlay from the GPS, so screen real estate would be an issue with gauges as well. I'd be happy with simple vertical bars with number scales using green/yellow/red (good/caution/problem) for quick visual reference on everything except the speedo and tach - I think those can be displayed as large text, with the tach going red if too high maybe. I really have been trying not to think too much about the delivery yet, as I'm of the opinion that they will have to accept whatever I (we) can deliver - even if it's just plain text. I did see some Java code to display gauges within HTML, and SparkFun has LabView SE bundled with an Uno, so there are a couple of options. Depending on how well this performs, and how much it is utilized, I might be willing to pay someone to code up a pretty UI in the future.

As for the code, I have been working with AnalogReadSerial to learn the about the Arduino, test theory, and my circuits; but I'm looking more at Smoothing since we'll only be sending data packets every 10-15 seconds. I think the current NMEA data along with an average from the sensors in that time frame is plenty for now - and far more than any other team will have. The exception will be the roll sensor and panic button - I'd like to see those sent out immediately. While common courtesy, basic human decency, and the race rules require that a team stop for any other team that has been involved in an accident/rollover/etc; there have been incidents in the past where nobody stopped for other teams in trouble - and I'd like to know ASAP if my friends are injured in the middle of the desert.

I attached a crude image of what I think is reasonably possible for the delivery. The map application is a separate program, but I threw it in there for layout/scale. I also added a smaller image of my current breadboard layout.

Thought and comments welcomed, as always.

thx,
jim

I absolutely LOVE your project. It's phase two of another project I'm working on. Much smaller scale though, my son's gokart that he races in the back yard.
I've been working on megasquirt http://www.megamanual.com/index.html to custom fuel inject his kart. Stage two is to use an Arduino to gather engine parameters such as spark advance, injector pulse width etc. and send back to me over wifi (very close range in back yard) or similar to what you're doing so I could data log in real time. Ideally I'd like to send changes in the tune back to the kart in real time while he's driving and adjust parameters on the fly. I'd also like to duplicate megasquirt with an Arduino and build my own fuel injection system. I love that stuff. I'm into tuning real cars and the thrill of building my own fuel injection system and tweaking it led to my kids kart project :slight_smile:

Anyhow carry on... will keep watching with great excitement.

Malcolm

1- With so much functionality you will definitely need many in/out pins specially analog inputs. You must go Arduino Mega which will leave the door open for more expansion in the future.
2-The refresh rate is not a problem. I suggest it to be the fastest possible so the analog indicators on screen do not show jumps in the values. The panic button is the easiest to implement. You can easily achive for example 30Hz refresh rate, which is more than enough for the slow moving variables you are displaying. Digital low pass filtering is required if you want smooth visualization though.
3- Very easily can send the info to other computers and have others see what's going on. That's the easiest.
4- This is a super cool project; but way too complex for a beginner, I guess. There is no question that with help from this forum you will be able to implement it by yourself; but it will take you a long long time to do so.
5- The pitch roll/indicator is already done and I made it public. Artificial Horizon+Compass. - Science and Measurement - Arduino Forum
6- These videos will help you understand what can be done:
7- The GPS part with on screen course positioning can also be done; but that's going to be the hardest. I suggest you leave that for later versions if not extremely necessary now.
8- With so many things being displayed screen space optimization can get critical as the indicators must be big enough for them to be observed easily.

Good luck.