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

Thread: I Think My Teensy 3.2 is Broken???

  1. #1
    Junior Member
    Join Date
    Sep 2019
    Posts
    1

    I Think My Teensy 3.2 is Broken???

    So I was going to use a Teensy 3.2 that I found buried in a cabinet somewhere to make an EEPROM Storage device (with a shield I made) with the Arduino software. I was running some test code to get the serial and stuff working, and I came across this issue: the analog readouts (without any connections) are reading greater than 0. In fact, they read to be about a rough consistent 100 to 800 in the 0-1023 range. I am getting my information through the serial printout, of which seems to work. I checked with a meter, and there is no voltage traveling through that I can tell.
    Here is what I was using to test it:
    Code:
    int Sensor = A1;
    float val;
    int count = 0;
    
    void setup() {
      // put your setup code here, to run once:
    Serial.begin(9600);
    pinMode(Sensor, INPUT);
    
    }
    int rx_byte = 0;
    
    void loop() {
     if (count == 0){
      Serial.println("Connect Sensor to Port A1 (sauce) and type '1' to get value set");
      delay(20);
      count++; 
      }
    
    if (count != 0){
      val = (analogRead(Sensor));
    }
    if (Serial.available() >0) {
        rx_byte = Serial.read();
    
     if (rx_byte == '1'){
        val = (analogRead(Sensor));
        delay(100);
            if (val > 0){
                Serial.println(val);
                val = (analogRead(Sensor));
                delay(100);
                Serial.println(val);
                val = (analogRead(Sensor));
                delay(100);
                Serial.println(val);
                val = (analogRead(Sensor));
                delay(100);
                Serial.println(val);
                delay(100);
            }
            else {
                Serial.println (" NO Signal Found. Check Your Wiring");
            }
        }
    }
    }
    If it were printing a small variation (like a single digit number), I wouldn't be too concerned. What I want is for the 'NO Signal Found' as the error message when the sensor isn't getting a signal. I currently am running this without anything wired in with the exception of the mini USB. Thoughts???

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,534
    As you can read in the MK20 data sheet and in the NXP ADC application notes, reliable ADC measurements with the integrated delta sigma converters require a source impedance lower than 10kOhm. For this type of ADC, it is perfectly normal to act as random number generators or capture Radio Moscow with high impedance sources or open pins. Letting them see defined conditions with a 10k resistor in parallel with a 1nF capacitor between an analog pin and AGND should read close to zero with a little noise depending on your settings for the ADC resolution, conversion speed and averaging.

Posting Permissions

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