user49876: I'm wanting to analogRead the value off a MQ-135 gas sensor. I have tired this with both an Arduino Uno and an TTGO ESP32 SX1276.
When reading the value of the sensor off the Uno, I get values approximately equal to 400 which is expected, as shown in this video. When doing the same on the TTGO, I get values close to 2000. For some reason, this person gets a similar value range as shown in this video.
What I don't understand is how these values are different when only the board is being changed. Do different boards analogRead differently?
More or less, how do I get the TTGO to read the same values as the Uno?
Below is my code for both boards. Nothing is changed between the boards:
#define sensor 2 //sensor pin

int gasLevel = 0; //int variable for gas level

void setup() {
  Serial.begin(9600); //start serial comms
  pinMode(sensor,INPUT); //set sensor for input
}

void loop() {
  gasLevel = analogRead(sensor);
  Serial.println(gasLevel);
  delay(1000);
}

The following things I have tested:

Multiple boards of both the Arduino Uno and TTGO
Different pins, both analog and digital

I also am powering the sensor using 3.3V pin, so there is no variation in the voltage the sensor is receiving.

user4143: 
Do different boards analogRead differently?

Yes.
Your typical Arduino has a 10-bit ADC. That can give values between 0 and 1023 (210-1), with 400 falling just short of half way.
The ESP32 has a 12-bit ADC. That gives values between 0 and 4095 (212-1), which means that your 2000 falls, yes, just short of half way.
It is not the value from the ADC that is important - it is what the value represents. It is meaningless until you convert it into something meaningful, like a voltage.
Like asking "How heavy is it?" -- "It's 23." Completely meaningless, until you qualify it with units, and the units are different because of the different resolutions, so you need to "convert" it into units that have a meaning.
Typically the value represents a proportion of the supply voltage (but not necessarily: it's actually a proportion of the ADC reference voltage, which is often the same thing as the supply voltage).  On the Arduino the value is 1/1024th of the supply voltage. On the ESP32 it's 1/4096th.

49876: <p>I'm wanting to analogRead the value off a MQ-135 gas sensor. I have tired this with both an Arduino Uno and an <a href="https://primalcortex.wordpress.com/2017/11/24/the-esp32-oled-lora-ttgo-lora32-board-and-connecting-it-to-ttn/" rel="nofollow noreferrer" title="TTGO ESP32 SX1276">TTGO ESP32 SX1276</a>.</p>

<p>When reading the value of the sensor off the Uno, I get values approximately equal to 400 which is expected, as shown in this <a href="https://youtu.be/V1uOHOcVZrE?t=6m21s" rel="nofollow noreferrer">video</a>. When doing the same on the TTGO, I get values close to 2000. For some reason, this person gets a similar value range as shown in this <a href="https://youtu.be/3tXRNusJhgs" rel="nofollow noreferrer">video</a>.</p>

<p>What I don't understand is how these values are different when only the board is being changed. Do different boards analogRead differently?</p>

<p>More or less, how do I get the TTGO to read the same values as the Uno?</p>

<p>Below is my code for both boards. Nothing is changed between the boards:</p>

<pre><code>#define sensor 2 //sensor pin

int gasLevel = 0; //int variable for gas level

void setup() {
  Serial.begin(9600); //start serial comms
  pinMode(sensor,INPUT); //set sensor for input
}

void loop() {
  gasLevel = analogRead(sensor);
  Serial.println(gasLevel);
  delay(1000);
}
</code></pre>

<p>The following things I have tested:</p>

<ul>
<li>Multiple boards of both the Arduino Uno and TTGO</li>
<li>Different pins, both analog and digital</li>
</ul>

<p>I also am powering the sensor using 3.3V pin, so there is no variation in the voltage the sensor is receiving.</p>
 4143: <blockquote>
  <p>Do different boards analogRead differently?</p>
</blockquote>

<p>Yes.</p>

<p>Your typical Arduino has a 10-bit ADC. That can give values between 0 and 1023 (2<sup>10</sup>-1), with 400 falling just short of half way.</p>

<p>The ESP32 has a 12-bit ADC. That gives values between 0 and 4095 (2<sup>12</sup>-1), which means that your 2000 falls, yes, just short of half way.</p>

<p>It is not the value from the ADC that is important - it is <em>what the value represents</em>. It is meaningless until you convert it into something meaningful, like a voltage.</p>

<p>Like asking "How heavy is it?" -- "It's 23." Completely meaningless, until you qualify it with units, and the units are different because of the different resolutions, so you need to "convert" it into units that have a meaning.</p>

<p>Typically the value represents a proportion of the supply voltage (but not necessarily: it's actually a proportion of the ADC reference voltage, which is often the same thing as the supply voltage).  On the Arduino the value is 1/1024th of the supply voltage. On the ESP32 it's 1/4096th.</p>
