WIFI enabled smoke detector

HI All,

I am doing a project for wifi based smoke detector and integrated with blynk.

Now my question is can i do wife based smoke detector with below hardware ?

  1. Sensor - MQ2
  2. ESP8266 - WIFI chip
  3. voltage regulators , LED , buzzers, wires.

I see in lots of projects they user ardunio uno + ESP8266 , i don’t understand why should we use ardunio.

processing the analog output of MQ2 and triggering ESP8266 is only the reason ?
why can’t we user digital output of MQ2 and trigger ESP8266 directly ?

Please help me in understanding.

Actually if you read a lot of the post by the “more seasoned” users, most would recommend some type of ESP8266 dev board. Most favor the Wemos D1 mini.

This will depend on if you are using a bare bones sensor, or one of the ones mounted on a board.

If we’re talking about doing “wifi” (rather than your “wife”) then the answer is, “Yes”. The ESP8266 has an analog input pin. :wink:

As @Toro_Blanco suggested, you should be using an ESP8266 development board (e.g., Wemos D1 Mini, NodeMCU 1.0 / ESP-12E, …), rather than a ESP8266 “chip”.

With some projects (not yours), the ESP8266 may not provide enough GPIO. I assume (not sure) folks are using the Uno for increased GPIO and the ESP8266 simply for wi-fi connectivity. There’s always the wifi- and bluetooth-enabled ESP32 which has more GPIO. In this day and age, an Uno certainly wouldn’t be my first choice.

By the way, there are a few ESP8266- and ESP32-based developments boards with onboard lithium battery charging circuits (i.e., you can directly connect a lithium rechargeable battery). This may be of benefit with your application.

Have you seen this as an alternative?


1 Like

If you are truly talking about a circuit built from scratch with a bare ESP8266 chip, then you shouldn’t be asking that sort of question here, as you should have enough circuit design knowkedhe to be able to work-out the answer.

If you’re talking about using an ESP-01 dev board like this:
then the problem you’ll have is the lack of an analogue input pin. The pin does actually exist on the chip, and if you have a very steady hand and a very small soldering iron, you can solder a wire on to the chip.

I think the analogue pin on this version of the ESP8266 chip has a 1v maximum signal level for the analogue input, so you’d need a couple of resistors as a voltage divider to convert the 5v signal from the MQ2 to 1v.

If you went for the MQ2 on a board that has a digital as well as analogue pinout:
then you’d be able to use the ESWP-01, but you would onlky get an on/off signal based on the setting of the potentiometer on the MQ2 board, You wouldn’t get a PPM reading of the gas levels that you would using an analogue input.

Boards like the Wemos D1 Mini or NodeMCU do have the analogue pin broken out so that it’s available, and the have a resistor network on-board that makes the pin responsive to 0 to 3.3v signals. This means that you’d still need a two resistor voltage divider to map the 0-5v signals from the MQ2 to a range that’s usable by these boards.
Arduino 5v boards have digital pins with 0-5v range, which is why you see so many MQ2 circuits that use them.


Hard to believe someone would use an Uno in place of a two-resistor voltage divider. @Deepak_Deepu
can Google “esp8266 MQ2”, if he hasn’t already. There are countless examples.

Agreed, but it’s simple and easy if you’re putting together an online tutorial aimed at students rather than a real-world solution.
Most real world situations will use commercially available smoke/gas detection hardware, because your life depends on it, and off the shelf solutions that are well engineered and fully certified are cheap.