Actiivate/Deactivate an MQ-2 sensor to save battery

Hello,

I have connected an MQ-2 sensor to an Arduino 2560 R3. I want to save as much battery as possible, so I want to activate the sensor when it is time to take the measurements (once every 3 hours) and deactivate it, the rest of the time. When I mean deactivate, I mean that I don't want to be supplied/not consuming current/not the LED switching ON, everything on the sensor to be switched OFF. How can I realize this? Is it feasible??

I was thinking of using 3 relais (one for VCC wire, one for GND wire and one for Analog output wire). Is there any better solution?

Thank you...

alex5678: Hello,

I have connected an MQ-2 sensor to an Arduino 2560 R3. I want to save as much battery as possible, so I want to activate the sensor when it is time to take the measurements (once every 3 hours) and deactivate it, the rest of the time. When I mean deactivate, I mean that I don't want to be supplied/not consuming current/not the LED switching ON, everything on the sensor to be switched OFF. How can I realize this? Is it feasible??

I was thinking of using 3 relais (one for VCC wire, one for GND wire and one for Analog output wire). Is there any better solution?

Thank you...

I presume you have printed the data sheet and have studied it before getting the sensor. Did you see it needs to preheat at least 48 hours to get a steady result?

Paul

Ok, let's say it is not an MQ-2 sensor, but an IR flame sensor. How do I activate/deactivate it?

Thank you...

To deactivate any device, cut the power.

However, in many cases you cannot have an unpowered device connected to a powered Arduino, without protection on the I/O pins.

jremington: However, in many cases you cannot have an unpowered device connected to a powered Arduino, without protection on the I/O pins.

It is the unpowered Arduino reading a powered sensor that is the problem, not an unpowered sensor into a powered Arduino.

Not true. An unpowered sensor can and often will draw current from an active HIGH Arduino output pin and overload the pin, damaging it.

It is usually a bad idea to connect any unpowered device to any powered device via I/O pins, without some sort of protection. When this power scenario cannot be avoided, I've used a 1K series resistor, with no problems so far.

alex5678: Ok, let's say it is not an MQ-2 sensor, but an IR flame sensor. How do I activate/deactivate it?

How to activate/deactivate a sensor and other precautions tends to be pretty sensor-specific. So "let's say it's some unspecified flame sensor" is not going to get you any useful information.

follow the data sheet on how to power the device and to put it into standby mode or get a device that is micro-power

Not true. An unpowered sensor can and often will draw current from an active HIGH Arduino output pin and overload the pin, damaging it.

What the hell are you doing connecting an output to a sensor?

Sheer folly.

Grumpy_Mike: What the hell are you doing connecting an output to a sensor?

How about I2C, SPI... (I know, not applicable to an analog sensor like the MQ2) The first is supposed to be open collector of course, but that just means an unpowered sensor may pull down the bus entirely. The second is driven high and low.

alex5678: Ok, let's say it is not an MQ-2 sensor, but an IR flame sensor. How do I activate/deactivate it?

Thank you...

What sensor are you using? MQ2 detects flammable gasses in concentrations of less than 1%, so any of the gasses it can detect won't ignite. A flame sensor would return completely different data. In fact no flammable gasses would be present.

What exactly are you doing?

wvmarle:
How about I2C, SPI… (I know, not applicable to an analog sensor like the MQ2)
The first is supposed to be open collector of course, but that just means an unpowered sensor may pull down the bus entirely. The second is driven high and low.

Yes but you don’t connect a sensor directly to an I2C or SPI bus, you connect an I2C or SPI interface to it.

Yes but you don't connect a sensor directly to an I2C or SPI bus, you connect an I2C or SPI interface to it.

This is a joke, right?

On the Arduinos I use, I2C, SPI and TTL serial sensors are connected to port pins, which are often output pins.

It is a BAD IDEA to connect these pins directly to an unpowered sensor.

Or did you just unwisely skip that cup of coffee this morning?

I was thinking of using 3 relais (one for VCC wire, one for GND wire and one for Analog output wire). Is there any better solution?

Better solution is only ONE releais - only for VCC wire. :)

30second before reading data, switch on relay with analog output ( sensor need 20s warmup ) then read data and disconect relay

This is a joke, right?

Well either you are not communicating correctly or yes you are having a joke.

I have never connected a sensor to an output pin, can you explain exactly when you have and what sensor it was.
By definition you read a sensor, and you do not do that with an output pin.

I have never connected a sensor to an output pin, can you explain exactly when you have and what sensor it was

IMUs of about a dozen types are sensors that use the SPI bus for speed, the venerable MPU6050, for example.

The SPI bus by definition uses an output pin from the Arduino for the clock signal and often another one for the device select. These output pins are connected directly from the Arduino and the sensor.

I could name a large number of other similar situations, including sensors that use bidirectional "RS232" TTL level serial as well as other less well defined serial interfaces. All use output pins from the Arduino connected to an input on the sensor.

I'm surprised that you have not encountered this situation. But my point remains that in such a situation, damage to the Arduino or the sensor can occur if one device is powered and the other is not.