Interfacing ESP8266 with PIC16F877A Microcontroller


Interfacing PIC16F877A Microcontroller with ESP8266

In this article, let us discuss how to interface WIFI module ESP8266 with a PIC microcontroller. So far you might have been using the ESP8266 module as a standalone microcontroller or might have been using it with the Arduino library. But, when it comes to hardcore embedded system projects we should know how to use it with PIC microcontrollers as well. This will help you to customize your projects in design perspective and at the same time also making it cheap.

The ESP8266 modules comes with a default firmware loaded into it, hence we can program the module using AT commands. These commands have to be sent through a serial communication channel. This channel is established between the PIC and the ESP8266 module by using the USART module in the PIC microcontroller. The whole working will be monitored and reported to the user by using a 16×2 LCD display. Hence, this tutorial assumes that you have some basic knowledge about the USART module in PIC, Interfacing LCD with PIC and using AT commands in ESP8266. If you do not then you can fall back to the linked tutorials to learn them beforehand.

Materials Required:

You would need the following hardware to complete this tutorial

  1. PIC16F877A
  2. 20MHz crystal oscillator
  3. 7805
  4. LM317
  5. ESP8266
  6. 16*2 LCD display
  7. PicKit3 programmer
  8. Resistors (1K,220ohm,360ohm)
  9. Capacitors (1uF, 0.1uF, 33pF)
  10. Jumper wires
  11. 12V Adapter to power the PIC and ESP module


The complete schematic of the project is shown here below


The schematics consists of two voltage regulator circuits, one is a +5V regulator which is used to power the PIC microcontroller and the other is a 3.3V regulator which powers the ESP8266 module. The +5V is regulated by using a 7805(Linear Voltage Regulator IC). The 3.3V is regulated by using LM317 (Variable Voltage Regulator). The ESP8266 module consumes a lot of current (~800mA) hence if you are designing your own power supply make sure it can source such high current. Also make sure that the ground pins of the PIC and the ESP8266 module is connected together.

READ  How to interface keypad with PIC12F675

So now we know that the PIC operates on +5V and the ESP8266 operates at 3.3V volts. In order to establish a USART communication between these two modules we need have a 5V – 3.3V logic converter circuit as shown in the above figure. This circuit is nothing but a potential divider which simply converts the incoming +5V to 3.3V. This will prevent the 3.3V tolerable RX pin of ESP8266 from getting +5V.

for more detail: Interfacing ESP8266 with PIC16F877A Microcontroller

Current Project / Post can also be found using:

  • esp8266 at commands pic projects
  • esp8266 module interface with pic
  • esp8266 with pic16f

Leave a Comment

= 4 + 7

Read previous post:
5V Power Supply Atop a 9V Battery

I have a $500 Rigol DP832 programmable triple-output power supply sitting on my bench, yet I built a 5V regulator...

Scroll to top