2

I'm trying to make a radio controlled plane using ESP-01 as the receiver. The communication protocol I'm using is esp-now by espressif. When I plug in the ESP-01 and the motor at the same time, the transmitter returns that the delivery failed. However, when I plug in the esp-01 first, then the motor, it works fine.

Here's my schematic: enter image description here BTW I used an arduino instead of an ESP-01.

Can someone explain why this happens and are there any solutions to it?

Mitu Raj
  • 10,946
  • 6
  • 24
  • 48
  • In a general level or specific to your circuit? If the latter, you should post your circuit. The question sounds very familiar - have you asked this before? – Justme Nov 09 '21 at 05:40
  • Yes, I asked before and deleted it because it wasn't clear enough. I have also added the schematic as requested. – HARISH RAM student Nov 09 '21 at 06:39
  • That's not an ESP-01, that's an Arduino. – Justme Nov 09 '21 at 07:16
  • I just put an arduino there because fritzing doesnt have an esp-01. My bad, I forgot to edit that in. – HARISH RAM student Nov 09 '21 at 09:24
  • Does D2 on you connection resembles GPIO2 pin of ESP-01? Does the Q1 base connected directly to it and emitter to a ground without any resistors? – NStorm Nov 09 '21 at 09:49
  • Unless you say exactly what you have connected where and how, we can't help you, because we don't know what you have done. – Justme Nov 09 '21 at 09:54
  • Lack of decoupling? Vcc sagging under load? – winny Nov 09 '21 at 10:15
  • Try adding a resistor (say 10k) from Q1 base to ground. Without it the motor may run when there is no ERSP and the motor noise may affect the processor. Also, add a reverse polarity diode across the motor mounted physically and electrically near the motor terminals. – Russell McMahon Nov 25 '21 at 07:48

1 Answers1

1

If you schematics D2 pin resembles pin 2 (GPIO2) of the ESP-01, you are pulling it low during the startup through Q1. According to the ESP8266 docs GPIO0 & GPIO2 should be pulled high to boot from on-board SPI Flash (where you store your program).

You can move your motor control pin to GPIO1 (pin 8) or GPIO3 (pin 4) instead.

Also, it's bettor to add a resistor in series with Q1 base to limit base-emitter current as ESP8266 pin can really source only 12 mA of current. Back EMF diode for the motor is also mandatory. In the end it should look similar to this:

Motor Connection Scematic

R1 will depend on your parameters. But most likely providing you are running your ESP-01 from 3.3V it should be somewhere around 470-1000 ohm, but > 225 ohm to limit current below 12 mA.

winny
  • 14,707
  • 6
  • 46
  • 66
NStorm
  • 1,929
  • 13
  • 23