C
C
coopjmz2018-07-29 13:27:41
Arduino
coopjmz, 2018-07-29 13:27:41

How to make ESP8266 and HC-05 work together?

Sketch with comments-explanations:

#include <SoftwareSerial.h>
#define LED 2

SoftwareSerial BTSerial(9, 10); //RX, TX

void setup()
{
  delay(500);
  BTSerial.begin(9600); //С 38400 тоже пробовал
  Serial.begin(9600);
  delay(500);
}

void loop()
{
  char data_received = BTSerial.read();
  if (data_received == '1')
  {
    digitalWrite(LED, LOW);
    Serial.println("LED turned ON");
  }
  else if (data_received == '2')
  {
    digitalWrite(LED, HIGH);
    Serial.println("LED turned OFF");
  }
}

Breadboard photos:
Here, because. images Toaster refused to load
Pins
HC-05ESP8266
STATE
RXD--TX (GPIO 1)
TXD--RX (GPIO 3)
GND--GND
VCC (5V)--CN6009-3V3 (3.3V)
EN-3V3 (Without this, the phone does not connect to the module)
Problems:
  • NodeMCU not flashing when HC-05 Bluetooth module is powered on
  • Without 3.3 V on the EN pin of the module, the phone does not connect to it (via the Application )
  • The very control of the BT module through SoftwareSerial does not work at all

I did everything according to the instructions, I want to figure out what's wrong

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hobbyte, 2018-07-29
@hobbyte

Emnip, tx / rx on this board, NodeMCU, are connected to usb-uart, therefore it is not sewn.
Outweigh, for example, on d5/d6 the connection with bt.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question