MQ138 wiring and code examples for ESP32

Customer:

I just received MQ138 sensors. Do you have any documents regarding wiring them to ESP32 boards and code samples?

Originally submitted via email support on 24 March 2025. Migrated to the forum for community visibility.

Soldered Support:

Please see the MQ library: GitHub - SolderedElectronics/Soldered-MQ-Gas-Sensor-Arduino-Library: Library for all MQ sensor Soldered Boards. · GitHub

It includes an MQ138 example: https://github.com/SolderedElectronics/Soldered-MQ-Gas-Sensor-Arduino-Library/blob/main/examples/native/MQ-138-ALL/MQ-138-ALL.ino

And for easyC version: https://github.com/SolderedElectronics/Soldered-MQ-Gas-Sensor-Arduino-Library/blob/main/examples/easyC/MQ-138-ALL-easyC/MQ-138-ALL-easyC.ino