How to switch on/off sensor modules before deep sleep

zonehun1
Posts: 3
Joined: Fri Jun 28, 2019 6:17 pm

How to switch on/off sensor modules before deep sleep

Postby zonehun1 » Fri Jun 28, 2019 6:29 pm

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.

ESP_Sprite
Posts: 9759
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » Sat Jun 29, 2019 1:57 am

Can you draw us a schematic of your setup?

zonehun1
Posts: 3
Joined: Fri Jun 28, 2019 6:17 pm

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

Postby zonehun1 » Sat Jun 29, 2019 7:02 am

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.

quangminh.le0701
Posts: 6
Joined: Mon Jul 01, 2019 2:55 pm

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

Postby quangminh.le0701 » Mon Jul 01, 2019 2:55 pm

could i have that library for esp32 wroom doit dev kit

zonehun1
Posts: 3
Joined: Fri Jun 28, 2019 6:17 pm

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

Postby zonehun1 » Mon Jul 01, 2019 6:03 pm

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.

Who is online

Users browsing this forum: No registered users and 63 guests