I am interfacing MQ7 gas sensor https://www.sparkfun.com/products/9403 with esp32. MQ7 is a carbon monoxide sensor which requires two cycles to work.
It requires 90 seconds cycle to release absorbed gas (by powering it with 5V) and 60 seconds cycle to start absorbing CO (by powering it with 1.5V). I have written code to achieve this toggle on a GPIO of esp32.
I have designed following circuit to achieve the toggle.
In this circuit, RH is the resistance of the MQ7 sensor. If I apply 0V on Base, VRH = 1.5V (precise) If I apply 3.3V on Base, VRH = 4.84V (instead of 5V)
Fore time being, I am using Powerbank for 5V Vcc supply.
The problem I am facing is that due to large VCE saturation of pn2222 (max=1V), I am unable to get 5V during saturation phase.
I think I can use a Transistor with small VCE saturation to resolve this issue? Should I do it? Or there is better alternative available?