Page 1 of 1

How to switch on/off sensor modules before deep sleep

Posted: Fri Jun 28, 2019 6:29 pm
by zonehun1
I looked through all the forums, relevant pages, youtube videos but did not find a solution to my problem. I have a NodeMCU 32-S development board connected with a Waveshare 9528 (MQ135) gas sensor module. I created the software codes in Arduino IDE and it is working perfectly since I'm a developer :) BUT I do not know how can I switch off/on this module? I like to use this from battery power and I know I have to switch everything (which is possible) off to conserve the battery power.

I connected the module on the following way:
ESP32 VIN - 9528 VCC
ESP32 GND - 9528 GND
ESP32 GPIO32 - 9528 AOUT
ESP32 GPIO4 - this would be the controller of the switch...

I'm a newbie in electronics. But tried with the 2N2222 transistor it not worked for me. Now I'm trying it with a IRLB8743 mosfet. But it is not working either :(

If you have any tips or suggestions how to create this kind of simple thing I would be really happy.

Thank you.

Re: How to switch on/off sensor modules before deep sleep

Posted: Sat Jun 29, 2019 1:57 am
by ESP_Sprite
Can you draw us a schematic of your setup?

Re: How to switch on/off sensor modules before deep sleep

Posted: Sat Jun 29, 2019 7:02 am
by zonehun1
Yes, of course. Here is the schematic.

Image

If I change the MQ135 module to a LED it can be blinked - how the software should work.

If I connect the MQ135 without the MOSFET, directly to 3.3v, GND and GPIO32; it works.

Re: How to switch on/off sensor modules before deep sleep

Posted: Mon Jul 01, 2019 2:55 pm
by quangminh.le0701
could i have that library for esp32 wroom doit dev kit

Re: How to switch on/off sensor modules before deep sleep

Posted: Mon Jul 01, 2019 6:03 pm
by zonehun1
quangminh.le0701 wrote:
Mon Jul 01, 2019 2:55 pm
could i have that library for esp32 wroom doit dev kit
If you think about the shcematic I created it with the EasyEDA online sketching tool. The library is the EasyEDA lib and I looked for the "nodemcu-32s" searching phrase. Then there is a Ai-Thinker-NodeMCU-32SLUA. For the MQ135 I have searched for the "mq-135" phrase.