This project demonstrates how to read data from an MPU9255 sensor and multiple analog sensors using an ESP32 microcontroller, and transmit the data wirelessly using the LoRa E32 module. The data is sent in a structured format and received by another ESP32, which then prints the data to the Serial monitor.
ESP32 Dev Kit
LoRa E32 Module
MPU9255 Sensor
Analog Sensors
Jumper Wires
Breadboard
Install Arduino IDE: Download and install the Arduino IDE from the official website.
Install ESP32 Board: Follow the instructions to install the ESP32 board package:
File
-> Preferences
.https://dl.espressif.com/dl/package_esp32_index.json
.Tools
-> Board
-> Board Manager
and search for "ESP32". Install the package by Espressif Systems.Install Required Libraries:
Install the following libraries via Arduino Library Manager (Sketch
-> Include Library
-> Manage Libraries...
):
MPU9255
LoRa_E32
Connect Components: Connect the ESP32, LoRa module, MPU9255 sensor, and analog sensors as per the pin configuration mentioned above.
Upload Code:
transmitter.ino
in Arduino IDE and upload it to the transmitter ESP32.receiver.ino
in Arduino IDE and upload it to the receiver ESP32.The transmitter code initializes the MPU9255 sensor and reads data from it, along with data from four analog sensors. This data is processed and sent via the LoRa E32 module.
Key sections include:
The receiver code receives the structured data from the LoRa E32 module and prints it to the Serial monitor.
Key sections include:
Signal
structure.Power Up: Power up both the transmitter and receiver ESP32 boards.
Monitor Serial Output: Open the Serial Monitor from the Arduino IDE for both transmitter and receiver boards (set baud rate to 19200). The transmitter will send sensor data, and the receiver will display the received data.
Verify Communication: Ensure that the data sent by the transmitter matches the data received and displayed by the receiver.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to modify and expand this project as needed.