Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 10 of 10

Thread: Teensy 4.1 ADC Accurecy

  1. #1
    Junior Member
    Join Date
    Jun 2018
    Posts
    10

    Teensy 4.1 ADC Accurecy

    Good Day,

    I trust you are all keeping well, I am using a Teensy 4.1.

    I am trying to read a Input from a VDO Oil Pressure input from a car / truck. the input Voltage on this sender ranges from 6v to 24V, so it could be used both on a 12v car and 24 Volt truck.

    According to the docs the Sender resistance is 10 - 184 OHM, so i am assuming no matter the Voltage the ohms value will be consistent weather is a 12v car or 24v truck.

    based on this, I have taken a resister divider, R1 at 68K and R2 at 10K this should give me a max pin voltage of 3.077V , from a 24v input. I should be able to Map the rawADC voltage to the Ohms to get the Bar Pressure.

    IS this the right way to do this ? is the Teensys ADC Accurate enough to pick this up ? IF there is another way I would be greatly appreciative, perhaps a dedicated ADC unit ? as i have to also use a similar VDO unit for water temperature. Do i have to use the Teensy reference voltage, if so how ? Would i have to use a 3.3v Zener Diode for safety sake ?

    your help and responses are greatly appreciated and its great to be part of such a great community.

    Thanks Gary

    This Post shows you how to do it on a 5V Ardunio. https://www.instructables.com/id/VDO...r-for-Arduino/

  2. #2
    Senior Member
    Join Date
    Jul 2020
    Posts
    406
    According to the docs
    You need to provide us with the docs too...

  3. #3
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    655
    I'd use something more like:

    3.3V -> 180 ohm resistor -> ADC -> sensor -> ground

    Input protection and different values if you are forced to use the 6-24V supply.
    Last edited by jonr; 09-03-2020 at 03:03 PM.

  4. #4
    I would asume you would. need a constant current source to feed the sensor. The voltage across the senaor will then be lineairy depended on the sensors resistance.. being 20R to 180R. A constant current source of 1.8mA will do the trick.

  5. #5
    Quote Originally Posted by jonr View Post
    I'd use something more like:

    3.3V -> 180 ohm resistor -> ADC -> sensor -> ground

    Input protection and different values if you are forced to use the 6-24V supply.
    Or 6V via 180R to the sensor, to gnd. The ADC connected to the sensor will give readings between 0.3 and 3.0 Volt.

  6. #6
    Senior Member Jp3141's Avatar
    Join Date
    Nov 2012
    Posts
    486
    Yes. The input signal is the resistance. You can power the sender from any voltage -- the 3.3 V supply on Teensy is convenient. In any automotive system, you need to protect against transients and noise. So, from the 180 Ω .. Sensor tap point, use a 10k resistor to the ADC and 0.1 uF to GND at the ADC's input. A 4.7 V zener from the tap to GND wouldn't hurt, but if that node could get accidentally shorted to 12 V or 24 V batt, you would need to use a high power resistor (at least 1 W).

  7. #7
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    655
    If you use 3.3V and the sensor gets unplugged, nothing bad happens to the ADC. With higher voltages, the ADC will see the full supply voltage. So you need input protection, with a zener diode usually being a poor choice.

  8. #8
    Quote Originally Posted by jonr View Post
    If you use 3.3V and the sensor gets unplugged, nothing bad happens to the ADC. With higher voltages, the ADC will see the full supply voltage. So you need input protection, with a zener diode usually being a poor choice.
    True, better use 3.3V supply to stay save.

  9. #9
    Senior Member
    Join Date
    Jul 2020
    Posts
    174
    You could get really fancy and use an opto-coupler.

  10. #10
    Senior Member
    Join Date
    Mar 2016
    Posts
    217
    I haven't looked this up but what is the max recommended impedance of the iMXRT1062's ADC? Good to keep the voltage divider below that.

    If you need a divider that goes above the max, you can use an opamp as a follower.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •