I drew this schematic of an LPG dectection circuit. I plan on soldering this on a perfboard with 24awg wires (or those breadboard jumper test wires). The ESP32 is for connecting to an IOT app alarm system. I tried using ChatGPT and Gemini to validate but they prove unreliable. Thank you in advance -w-
Nicely done!
Clear drawing with labels and clever layout!
I recommend testing this on breadboard. Once it is soldered on a dedicated board, it is very difficult to make changes. Also it is difficult to isolate problems (disconnect parts to research other parts of the circuit).
You may also find out that things are out of stock and alternatves have different layouts or sizes (a 25V capacitor is larger than a 16V capacitor).
You may need a very stable 5v source to get a reliable reading from the sensor. Maybe you can use your 5V source as a reference to get rid of instability (2 resistors and 1 analog input). A phone charger may not be suitable here!
I will get a photo of my adapter as soon as possible! It’s not a phone charger tho, so I don’t know if it’s reliable enough. And the two resistors from the AO is a voltage divider, I tried to use capacitors to make the 5V more stable, but I still not quite get what you mean by using the 5V as reference… I have all the caps in 16V, and thank you for your tips :3
Thank you for the material! I will definitely need those- Also I will redraw this in KiCAD as soon as possible
Reference voltage:
Since your 5V may not be stable, your sensor will also be unstable.
Solution:
Make a voltage divider from 5V to 3V (like you already have from your sensor output).
Connect an analog input to your new 3V.
In your code: correct your sensor output using this reference voltage. They will both be unstable (if your supply voltage is unstable), but they will have the same instability and therefore the instability will cancel out.
Please be aware that electrolytic capacitors have a plus an minus side. Usually, that is shown in electrical diagrams..
---|]---
Where the bracket is the minus side and should be a bit larger than shown above (so the plus side snuggles in)
I’ve redrawn as you advised, it really brings more clarity for later. About your other reply, could I use internal 3v3 as reference? (I don’t know if that’s possible). It is an improvement for accuracy, but would you think it’s necessary? This would be my first time designing a proper circuit.
What is the button for? To initiate a test? Anyway, I'd drop the 0.1uF capacitor and do any debouncing (if at all necessary) in software.
I plan to use it to initiate:
- Bypass calibration when calibrating
- Recalibrate when calibrated
It’s mainly for testing and demonstration purposes. Also yeah, I think I can ditch that capacitor becuase I use a microcontroler and even if it bounce it wouldn’t cause much trouble, thank you!
Are you sure the MQ-6 will provide the necessary sensitivity with a 15.1K load?
1000uF, wow that's big
The main use case here is to detect leaks in kitchen (I live in Viet Nam), I don’t know if it’d be suitable for factory setting, but I wouldn’t think it’d need much sensitivity. Also I would understand sensitivity as in respond time and not accuracy/resolution right?
No accuracy/resolution.
In the datasheet the data is given for a Rl of 4.7K
Uhmmmm, honestly I don’t know, but for my use case I won’t need to accurately measure ppm but just the change in value, and the voltage divider is more to protect the esp32. Perhaps to make it near 4.7K I’ll use R1 1.5K and R2 3.3K?
I'm sorry, you are using the module , please ignore my comments
Thank you for replying anyways -w-
I can also downsize to a 470uf but the 1000uf I use is 16V and it still fits my casing and well, I think more capacitance wouldn’t hurt
Be aware the MQ series of sensors are more a vague idea of gas, not a precise measurement, needs frequent calibration, and is expensive in terms of both power and measurement time.
Have you considered a MEMS sensor?
It can. Don't use more than you need.





