About Me Assignments Projects

Week 13

NETWORKING

This week i had a real probalm that i wanted to slove in mind so i was pllaing to crate a project around that this week

THE IDEA

I had this genius idea for a device that would solve the age-old problem of needing my brother to check if power is flowing to a plug point when I flip the MCB switch. Imagine a little gadget with lights that instantly tell me whether the power's on or off. No more relying on my brother's questionable judgment, like the time he confidently declared, "Yep, it's on!" only for me to discover later that he'd been staring at the microwave instead of the actual plug point. With my invention, I'll finally have the power... quite literally!

ESP-NOW Communication Protocol

Initialization:

Each device participating in the ESP-NOW network needs to be initialized with the ESP-NOW protocol. One device typically acts as a sender (transmitter), while the other acts as a receiver. However, devices can also operate in both roles.

Registration:

Devices need to register their MAC addresses with each other to establish a communication link. Once registered, devices can communicate directly without needing to know each other's IP addresses.

Sending Data:

The sender prepares data to be transmitted, which can be in the form of packets. ESP-NOW supports both unicast (point-to-point) and broadcast communication. For unicast communication, the sender specifies the MAC address of the receiver. For broadcast, it sends data to a predefined broadcast MAC address.

Transmission:

The sender transmits data packets over the air using the ESP-NOW protocol. The receiver, listening for ESP-NOW packets, captures and processes the incoming data.

Reception:

The receiver receives the data packets and processes the information contained within them. It can then perform actions based on the received data, such as controlling GPIO pins, updating sensor readings, or triggering events.

Acknowledgment:

ESP-NOW does not provide built-in acknowledgment of received packets. However, the application can implement its own acknowledgment mechanism if required.

Error Handling:

ESP-NOW does not include error correction or retransmission mechanisms. Applications may need to handle packet loss or errors at a higher level if necessary.

Power Management:

Devices can operate in low-power modes, waking up periodically to send or receive data as needed. This allows for efficient use of battery-powered devices in IoT applications.

In summary, ESP-NOW enables direct communication between ESP8266 and ESP32 devices by establishing a simple and efficient protocol for data transmission. It operates independently of traditional Wi-Fi networks, making it suitable for IoT applications where power consumption, simplicity, and reliability are essential.

As I have done this already in week 4, I just loaded the example program and connected the board via USB, selected the port and board type, and uploaded the code. The expected output was observed.

Designing PCB for ESP-NOW Communication using EasyEDA

Circuit Design for Sender Device:

For the sender device, the circuit typically includes an ESP8266 or ESP32 module, along with necessary components such as voltage regulators, resistors, capacitors, and optional peripherals like sensors or indicator LEDs. Here are the key steps:

  1. Component Selection: Choose the ESP8266 or ESP32 module and other required components from EasyEDA's extensive component library.
  2. Schematic Design: Use EasyEDA's schematic editor to create a schematic diagram of the sender device. Connect the components according to the ESP-NOW communication requirements.
  3. Layout Design: Transfer the schematic to EasyEDA's PCB layout editor. Arrange the components on the PCB, ensuring proper spacing and connections.
  4. Routing: Use EasyEDA's auto-routing or manual routing features to connect the components with traces on the PCB. Pay attention to signal integrity and avoid crossing traces where possible.
  5. Ground Plane: Create a ground plane to provide a low-impedance return path for signals and reduce electromagnetic interference (EMI).
  6. Power Distribution: Ensure proper power distribution and decoupling capacitors for stable operation of the ESP module and other components.
  7. Design Validation: Perform design rule checks (DRC) and electrical rule checks (ERC) to ensure the design meets manufacturing and electrical requirements.
  8. Exporting Gerber Files: Once the design is complete, export Gerber files from EasyEDA to send for manufacturing.
Sample Image Sample Image

Circuit Design for Receiver Device:

The receiver device's circuit will be similar to the sender's but with the ESP module configured to receive data from the sender and control peripherals like LEDs accordingly.

Sample Image Sample Image

About EasyEDA:

EasyEDA is an online platform for designing and simulating electronic circuits and PCB layouts. It offers a comprehensive suite of tools for schematic capture, PCB layout, and simulation, all accessible through a web browser. Some key features include:

PRODUCTION

After designing the PCB layouts for my ESP-NOW communication project using EasyEDA, I exported the Gerber files and converted them into PNG images of the pads, traces, and drill holes using our lab's Gerber to PNG converter tool. These images were essential for visualizing the PCB design before manufacturing. Then, following the fabrication methods discussed during the Embedded Production Week, I used the PNG files to mill my PCB on the Modela milling machine. This fabrication process allowed me to create precise and customized PCBs for my project, ensuring proper connectivity and functionality of the ESP-NOW communication system.

ASSEMBLY

After finalizing the PCB designs, I generated a Bill of Materials (BOM) using EasyEDA's built-in BOM generator. This BOM listed all the components needed for the project. Next, I requested the components using the Fab Stash, our lab's inventory management app, ensuring I had all the necessary parts for assembly. With the components in hand, I proceeded to solder the two PCBs together. Following the soldering process, I verified the connections and tested the functionality of the ESP-NOW communication system. This involved checking for proper signal transmission between the sender and receiver devices and ensuring that the LEDs responded accordingly to the transmitted data. Through careful assembly and testing, I successfully completed the project, readying it for deployment in my IoT application.

Sample Image

TESTING

Programming ESP8266 with FTDI Breakout Board

Connection Setup:

Programming Mode:

Using the IDE:

Uploading Code:

Debugging:

Power Supply:

Sample Image

I failed in uploading the any more codes after i have uploaded my first code