Looking for some ADC help / advice please
eagletalontim
Posts: 1,399
I am trying to decide if it using an ADC chip or building a simple ADC circuit with capacitors and resistors would be better. My goal is to keep cost down and get a fairly steady reading of the throttle position of my vehicle in a range of 0% to 100% to the closest whole number. I am currently using the resistor and capacitor design and using the ADC.spin code found in the obex I think.... The current circuit I am using works pretty good but is a little jumpy at low throttle (under 15% it may jump +/- 1%). I am pretty sure it has something to do with the environment and the circuit board I am using as well. The circuit is soldered within 1/2" of the Prop chip on the Prop Proto board and is all through hole components. On the circuit board I am designing, the components are all surface mount and are a little closer to the Prop unless I switch to using an already made ADC chip.
The biggest issue I am having is the output of the throttle is 5V which comes from the vehicle's ECU. It is not extremely stable, but with the right filter caps, it can be stable enough for what I need. So, with all this said, would it be easier / smarter to just use a single ADC chip or go with the basic ADC design I am already using with better filtering caps?
The biggest issue I am having is the output of the throttle is 5V which comes from the vehicle's ECU. It is not extremely stable, but with the right filter caps, it can be stable enough for what I need. So, with all this said, would it be easier / smarter to just use a single ADC chip or go with the basic ADC design I am already using with better filtering caps?
Comments
I've had some great success with the pcf8591 chip. Four analog inputs and one analog output. http://www.nxp.com/documents/data_sheet/PCF8591.pdf It sits on the I2C bus so doesn't use any extra propeller pins, seems super stable and the code to drive it is in the Obex. My input went up to 5V like yours does, and as a bonus, what you can do is run the pcf8591 chip from 5V, and interface it via the 3V3 I2C bus that the propeller uses for the eeprom. 3V3 will register as a logic high. So for your application, you would not even need a voltage divider.
The pcf8591 is 8 bit - would that be good enough resolution?
Do both ? - Include a simple, easy tiny ADC like the SOT23-5 MCP3221, and use that to check your own ADC, and determine if those issues are in the ADC, or in the Sensor.
Microchip also have 16b and 18b ADCs with precision references, in SOT23-5 packages, if you want a serious ADC specs.
Cheers
http://www.smsc.com/index.php?tid=377
These have 11-12b ADCs and can measure Current and Voltage, over a 0-40V common mode range.
Similar to the TI INA226, but better price, and they have a Dual channel one.(PAC1720)
I think you are going to have to learn to cope with the noise on the throttle signal (if that's what is the cause).
Motor cars are very noisy environments.
I would replace your throttle device with a quality potentiometer and stable voltage source and then test for the amount of jitter, just to prove if its the throttle or the circuit layout.
For A/D you must have super stable voltage source.
0-100 to 1% resolution is less than 7 bits of accuracy, should be quite achievable.
You always get lsb jitter with adc when near the threshold.
Can you average the result.? ie take last reading , add new reading, divide by 2, and use the result, which then becomes the last reading for the next calculation etc.
Increase the sample rate and average more samples.
Replace the throttle device with a grey scale encoder.
Just some ideas
Dave
As to the ref voltage not being stable, are you digitizing the output of the existing TPS or are you adding a separate pot for reading the position? Maybe a fixed reference if you have a separate pot. Then again, (here I am thinking out loud) if you are digitizing the output of the existing TPS, you may not have as big a problem with the instability. It's all relative... er, proportional perhaps. That is, for any given value out of the TPS assuming it is a pot, the out put will always have the same proportionality for a given position and regardless of the reference voltage, a certain count should happen at a given point every time. I.e. for 1/3 throttle, Vref=5V, the count should be Vsample/Vref*4096=1/3of max counts. if Vref falls to 4V, the output will be again proportional to Vref and again the same count value (+/- noise) should appear.
The noise you could smooth out with a weighted running average of sequential samples much the same way quantum noise is averaged out of a fluoroscopic image.
FF
Tim,
I see no reason that the sigma/delta ADC could not work for you. But do use SMD components mounted right next to the Prop pins. BTW, the QuickStart board has pads for thes parts, and it's not at all difficult to install them.
-Phil