Teensy 2.0++ not outputting 5v.

Status
Not open for further replies.

Dafyddct

Member
Hi Guys,

I want to test a potentimeter in Arduino, however it isn't giving me accurate results.

The teensy shows that from the 5v pin, only 0.16v is being outputted. And when I measure the pot,
it begins at 15 and ends up somewhere jumping around 300-400.
The pot is brand new and I have wired things up correctly.

This is the code used:

Code:
int Switch = A0;

void setup(){
  Serial.begin(9600);
  pinMode(Switch, INPUT_PULLUP);
}
void loop(){
  int analog = analogRead(Switch);
  delay(100);
  Serial.println(analog);
}
 
And just too add, Ive tried, INPUT and INPUT_PULLUP, both are very un-accurate.
Hi Guys,

I want to test a potentimeter in Arduino, however it isn't giving me accurate results.

The teensy shows that from the 5v pin, only 0.16v is being outputted. And when I measure the pot,
it begins at 15 and ends up somewhere jumping around 300-400.
The pot is brand new and I have wired things up correctly.

This is the code used:

Code:
int Switch = A0;

void setup(){
  Serial.begin(9600);
  pinMode(Switch, INPUT_PULLUP);
}
void loop(){
  int analog = analogRead(Switch);
  delay(100);
  Serial.println(analog);
}
 
Hi, In order for us to help, you'll need to provide us with the following:

-> Circuit diagram (or description) of exactly how you've got the potentiometer hooked up.
-> Exactly what teensy pins are connected to what.
-> What values are you reading back out through the serial monitor
 
Last edited:
Doesn't the analogRead() disable both INPUT and OUTPUT modes when activating the pin for the ADC?

Omitting pinMode() could be done?
 
Hi, In order for us to help, you'll need to provide us with the following:

-> Circuit diagram (or description) of exactly how you've got the potentiometer hooked up.
-> Exactly what teensy pins are connected to what.
-> What values are you reading back out through the serial monitor
The left pin of the pot goes to +5v on the breadboard (which is linked to the teensy), the middle pin of the pot goes to the analog input on the teensy and right pin goes to the ground of the vreadboard (which is wired to the teensy's ground).

The serial monitor reads a steady 0 when the pot is fully left. Then as I move it towards its right position, it scrambles ranges from 0-5.. And sometimes 1023.

Thanks.
 
EDIT: Scratch this, did some reading. Aref is set at 5v internally anyway.

Have you connected AREF to 5v?
This isn't required on Arduino depending on software setup, but I've never had a 2.0 ++ in my hand so I've no idea if the case is different.
 
Last edited:
The AREF pin lets you connect an external reference voltage to use as the upper limit of your analog readings. But reading up, this isn't required on teensy boards as it's internally set up for 5v reference.
 
Status
Not open for further replies.
Back
Top