user35238: I'm trying to use a pH probe with NodeMCU, the problem is that NodeMCU is 3.3V and the pH analog sensor requires 5V, at first I thought using the VIN pin but didn't work, then I used the VU pin from NodeMCU V3 (by Lolin) but it didn't give me the right values, like if it missed more power. Is there any other way? Or any esp8266 board which supports 5V into it's analog input?

user53282: Old topic, but in case it shows up in searches, like the one I was just doing ... I run a 5v ultrasonic SR04 off a Lolin nodemcu, and if you connect to "VU" on the Lolin nodemcu, you will get 5v.


user11885: Depending on your specific sensor and power supply setup you have following options:

Change supply voltage
Most resistive sensors don't have to power anything and will function just fine when supplied with less than 5V. Study the datasheet and make test measurements to find out whether this is suitable.
Use a voltage divider
Supply the sensor with 5V and use a simple voltage divider before    connecting to your MCU and therefore measure 0-3.3V.
Interface another IC
Get a small external ADC that can handle 5V readings and may be interfaced by any serial protocol supported by your esp8266 (namely UART and I2C).



user4143: The simplest method is just a voltage divider - just as if you were interfacing a 5V logic signal output with a 3.3V input. However it may not work.
A voltage divider will only really be of use if the output of the pH sensor is low impedance. If it's not then you will need a very high impedance voltage divider, and the analog input of the ESP8266 isn't high enough impedance to support a very high impedance voltage divider - it will skew the results horribly.
So you may need to buffer the output of the pH sensor through an op-amp first.
If you use a unity gain non-inverting buffer you can then use a voltage divider to reduce the output voltage.

simulate this circuit – Schematic created using CircuitLab
Alternatively, as others have suggested, use an external 5V ADC chip and logic level conversion to communicate with the ESP8266.

35238: <p>I'm trying to use a pH probe with NodeMCU, the problem is that NodeMCU is 3.3V and the pH analog sensor requires 5V, at first I thought using the VIN pin but didn't work, then I used the VU pin from NodeMCU V3 (by Lolin) but it didn't give me the right values, like if it missed more power. Is there any other way? Or any esp8266 board which supports 5V into it's analog input?</p>
 53282: <p>Old topic, but in case it shows up in searches, like the one I was just doing ... I run a 5v ultrasonic SR04 off a Lolin nodemcu, and if you connect to "VU" on the Lolin nodemcu, you will get 5v.</p>

<p><a href="https://i.stack.imgur.com/61b9k.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/61b9k.jpg" alt="enter image description here"></a></p>
 11885: <p>Depending on your specific sensor and power supply setup you have following options:</p>

<ol>
<li><p><strong>Change supply voltage</strong><br>
Most resistive sensors don't have to power anything and will function just fine when supplied with less than 5V. Study the datasheet and make test measurements to find out whether this is suitable.</p></li>
<li><p><strong>Use a voltage divider</strong><br>
Supply the sensor with 5V and use a simple <a href="https://en.wikipedia.org/wiki/Voltage_divider" rel="nofollow noreferrer">voltage divider</a> before    connecting to your MCU and therefore measure 0-3.3V.</p></li>
<li><p><strong>Interface another IC</strong><br>
Get a small external ADC that can handle 5V readings and may be interfaced by any serial protocol supported by your esp8266 (namely UART and I2C).
<a href="https://i.stack.imgur.com/elOoV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/elOoV.png" alt=""></a></p></li>
</ol>
 4143: <p>The simplest method is just a voltage divider - just as if you were interfacing a 5V logic signal output with a 3.3V input. However it may not work.</p>

<p>A voltage divider will only really be of use if the output of the pH sensor is low impedance. If it's not then you will need a very high impedance voltage divider, and the analog input of the ESP8266 isn't high enough impedance to support a very high impedance voltage divider - it will skew the results horribly.</p>

<p>So you may need to buffer the output of the pH sensor through an op-amp first.</p>

<p>If you use a unity gain non-inverting buffer you can then use a voltage divider to reduce the output voltage.</p>



<p><img src="https://i.stack.imgur.com/3G8oQ.png" alt="schematic"></p>



<p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2f3G8oQ.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p>

<p>Alternatively, as others have suggested, use an external 5V ADC chip and logic level conversion to communicate with the ESP8266.</p>
