I Think My Teensy 3.2 is Broken???

Status
Not open for further replies.

Sovas

New member
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???
 
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.
 
Status
Not open for further replies.
Back
Top