I state that it is only recently that I entered the world of Blynk so I apologize if I ask stupid questions. I have Arduino one, Esp8266 and a sensor Mq-2. I would like to see the value of the gas in my house through Blynk, but I do not understand the values that Blynk shows me since these values never change (tested with the lighter). The links I made are:
First I edited your post to properly format the posted code are per the Welcome Topic that you may have missed?
As for your setup… It doesn’t make sense to me… are you using an Arduino (what type) with an ESP (what type) as a shield? Or are you running the ESP as standalone as your Sketch libraries indicate?
Also these pinouts just don’t make sense… they show as if you are using an ESP (possibly ESP-01) as a shield, but your connections are all wrong. e.g. GPIO0->GND puts the ESP into flash mode, good for loading in your sketch, but must be floating or HIGH for starting the sketch - and this is assuming running in Standalone mode (no Arduino).
And then, now assuming ESP as shield, why is your ESP’s RX->RX on Arduino’s programming port, as is the TX.TX? Normally it would be RX->TX and TX->RX, but NOT using the programming ports, instead using Software Serial ports… then you program the Arduino (with proper libraries), not the ESP, as the ESP just becomes a simple Serial to WiFi adapter (GPIO0 unused).
I think you need to clarify what you are trying to connect and how…
I think you’d find it beneficial to use the sketch builder to generate some Blynk code then work through that code to understand how it works. You should pay attention to how timers work, and how the timer is called in the void loop.
You’ll need a timed loop that checks the reading from your sensor at a sensible frequency (every 5 seconds maybe - check the specs on your device to see how long it takes to obtain a reading and what the suggested frequency of readings is).
Once you have that data, and you can see that it’s being output to your serial monitor, you’ll be able to push it to Blynk so that it can be displayed on a widget in your app.
Thanks for the answers. Is it possible to have an example of how I should connect esp-01 and the mq-2 sensor? Can you give me an example of a sketch on how I should use serial port knowing I need analog port 0? I hope I’m not too rude but I think your example would help me a lot. Thank you
I state that it is only recently that I entered the world of Blynk so I apologize if I ask stupid questions. I have Arduino one, Esp-01 and a sensor Mq-2. I would like to see the value of the gas in my house through Blynk, but I do not understand the values that Blynk shows me since these values never change (tested with the lighter). The links I made are: