-->
Page 1 of 1

Analog readings creeping upward

PostPosted: Thu Oct 13, 2016 6:58 pm
by Cjh411
I have a force sensitive resistor connected to the analog input with a voltage divider. One side of the FSR is connected to 3.3V, the other pin goes A0 with a pulldown resistor to ground.

The sensor is clearly working, as I get big spikes when I press the sensor. However, when I don't touch the sensor the analog readings creep upward from 40ish until I touch the sensor. It then will spike up to the reading number, and then reset at a reading of 40ish. If I hold a constant force on the sensor, it also will continue to creep upward until I let go and it returns to the minimum.

Is this a common occurence, or is something wrong with my code or circuit?

Re: Analog readings creeping upward

PostPosted: Sat Oct 15, 2016 9:27 pm
by rudy
If you want to test your code then use fixed resistors to generate different levels. The seems to be accuracy issues with the A/D converter operation.

https://github.com/esp8266/Arduino/issues/2070

Re: Analog readings creeping upward

PostPosted: Sun Oct 16, 2016 2:06 pm
by Barnabybear
Code: Select allextern "C" {
#include <user_interface.h>
}

// then in viod setup
wifi_set_sleep_type(NONE_SLEEP_T);


work well for me.