Spectra Symbol Position Sensors HotPot 150mm how to read on analog pin teensy 3.2

Status
Not open for further replies.
Hello,

Please help me to read from a Spectra Symbol Position Sensors HotPot.
I connect the Pins to 3.3 V, AGND, and PIN 23. I use the code below for reading, but I get constant reading some random values from 0 to 250 even if I don't touch the sensor. Can you advise me what should I do to stop that.

Thanks


int softpotPin = 23; //analog pin 0

void setup() {
digitalWrite(softpotPin, HIGH); //enable pullup resistor
Serial.begin(9600);
delay(2000);
}

void loop() {
int softpotReading = analogRead(softpotPin);

Serial.println(softpotReading);
delay(250); //just here to slow down the output for easier reading
}
 
On a Teensy you need to enable the pin. Add pinmode(softpotPin,INPUT); to setup

And get rid of the digitalWrite, since that's not doing anything sensible.
 
On a Teensy you need to enable the pin. Add pinmode(softpotPin,INPUT); to setup

And get rid of the digitalWrite, since that's not doing anything sensible.

Thanks for help, done what you suggested, now I get other readings sometimes is maximum 1023 and sometimes are random values between 900-1023 without touching.

Is it possible to have constant reading let say 1023?

Thank you.
 
First... sounds like you have the ground and hot wires backwards... the 'wiper' should return to ground when there is no contact but it seems to be floating near the high end...

EDIT -- this may not be correct... it may just be floating with no connection to high or low and it's just reading high from an induced charge!

Pot noise causes output that is not rock solid in most cases but those things have bigger problem where the wiper doesn't really 'connect' to anything when there is no pressure... So the voltage can float around a bit... I think a high-value resister (1MOhm?) might be needed to pull the wiper low when there is no pressure making a good connection between the layers.

EDIT -- I think 100KOhm may be the recommended pull up but you need to make sure it's much smaller than the nominal resistance of the strip - I might try 1MOhm just to see.

https://forum.pjrc.com/threads/35382-SoftPot-to-Pitch-Bend-MIDI-questions

ResponsiveAnaglogRead may also help give you a usable output. The library does not have an Teensy instruction page as yet but the gitHUB page should show you how to use it.


I found it very easy to access the basic function but there are more options under the hood that might get better results.

https://forum.pjrc.com/threads/42479-simple-midi-contoller?p=135668&viewfull=1#post135668
 
Last edited:
Status
Not open for further replies.
Back
Top