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
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!
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.
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.
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.
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.
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.
ESP-NOW does not provide built-in acknowledgment of received packets. However, the application can implement its own acknowledgment mechanism if required.
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.
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.
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:
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.
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:
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.
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.
I failed in uploading the any more codes after i have uploaded my first code