I was very helpfully directed to this forum from Stack Overflow with this question.
So I've been working on some project for making air quality sensors and ran into a problem. As anyone who has worked with a NodeMCU would know, the chip only has one analog pin. Unfortunately, I have two MQ gas sensors, MQ2 and MQ7, and so I had to follow the guide here to install two analog sensors to the chip.
Now, the MQ sensors are working kinda strange. They output very high values when I uploaded the code from the Arduino IDE and often make no sense when converted into ppm (makes 0). Dunno if it's due to the fact that the heater in the sensors aren't being preheated or what.
Later, I was told that the GPIO pin outputs around ~3V of power while the MQ gas sensors needed 5V to function but I was told it can be done. What I was advised was to "use the IO-pins to switch on/off a transistor which drives the sensor".
Could anyone here detail me on how to do this? Or could I just use a voltage divider to constantly supply ~2V more of power to the sensors (currently I'm trying it with a 10K and an 18K)?