Help ESP-01 with Nano

In this scheme how do I include the wifi?

My actual code:

int led_pin=13;
int Buzzer=4;
int analog_pin=A0;

void setup() {
Serial.begin(9600);
pinMode(led_pin, OUTPUT);
pinMode(Buzzer, OUTPUT);

}

void loop() {
int temp;
temp=analogRead(analog_pin);

if(temp>300)
{

Serial.print("[alarmegas]");  
Serial.println("[alarmegas]"); 
delay(30000);

}
}

First get a decent power supply. The 9 volt battery (and onboard regulator) don't have the ability to supply the power requirements of the ESP.

The ESP-01 uses a serial interface so you either connect it to the serial pins (D0,D1) and disconnect the USB cable or use software serial on two different pins.

1 Like

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

Just pointing out an alternative.

Using an ESP8266 board like the NodeMCU or ESP32 and a DS18B20 temperature sensor would be easier than your current setup with adding on a ESP8266-01. No Nano required and you have WiFi.

It is not just programming 2 processors to talk to each other. If the Nano is a 5V unit you have to contend with levels shifting the Nano 5V TX to the ESP 3.3V RX and providing adequate 3.3V to the ESP (Nano 3.3V will not cut it).

1 Like

I like your idea, thank you very much.
And how would I make the connections in this scenario? Can you help me? :slight_smile:

Start by ditching the PP3 battery if that really is what you are using then substitute a NodeMCU or ESP32 for the ESP-01as previously suggested

Using an ESP-01 and an Arduino makes no sense.

I gather the blue board you cite is a gas sensor. This requires 5 V and draws significant current so you need a 5 V supply to power it. The Nano is not a 5 V power supply so you have a problem there.

The ESP-01 does not have the analog input connected, otherwise it would do the job. Looks like a WeMOS D1 Mini is the answer, when you find a suitable 5 V power supply.

NodeMCU is an unnecessarily more expensive version of the WeMOS D1 Mini; no advantage.

If only a temperature measurement was wanted, a DS18B20 could be directly used with an ESP-01 and powered by two "AA" cells, but this appears to be using a gas sensor.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.