I searched the forum but couldn’t find anything specific to what I’m trying to do so I thought I should make a new post.
I’m building a home environment monitor using an Arduino Mega 2560 with the following sensors and modules connected:
20x4 LCD
SHT31 humidity and temperature sensor
MQ2 gas sensor
Electret microphone breakout
BMP581 pressure sensor
PMS7003 particulate matter sensor
LIS3MDL magnetometer
Photoresistor
Adafruit’s Ultimate GPS
3 push buttons connected to a SN74HC14N Schmitt trigger (for switch debouncing)
I also plan to add an ESP-01 and micro SD card reader for connectivity and data logging.
Currently the Arduino is powered by the 9v barrel jack, and the sensors are powered by a breadboard ready USB cable that outputs 2A at 5V. But even with the extra power supply, it seems like it’s not getting enough power. The LCD display dims out or doesn’t turn on sometimes, the Arduino seems to crash randomly at times, and some of the sensor reads don’t get updated as they should.
I’m only reading one sensor at a time, so I thought I could save power by switching each module on only when it is being used, and turn it off when it’s not being used. I read some posts that do something similar using a P channel MOSFET transistor connected to each sensor’s Vcc pin. But they didn’t mention which specific P channel MOSFETs would be suitable, and how to connect them.
After looking for P channel MOSFETs online, it looks like most of them are in the TO-220 package. Are there any P channel MOSFETs in the typical TO-92 transistor package that anyone knows? That would be more suitable as I’m trying to put as many components as possible on a prototyping shield and the TO-220 package seems a bit large for that.
Also, how should the transistors be connected? I will be putting the Arduino to sleep for one minute intervals (in data logging mode), so all of the modules would need to be powered off during that time. So the transistor would need to switch off with a 0V signal, and turn on with a 5V signal once the Arduino wakes up, right? Does anyone have a schematic for this type of setup?
I know how to write the code to do this, I’m just struggling to find the right hardware to do the switching. If anyone has any ideas or suggestions it would be greatly appreciated!