In this blog post, we’ll explore how to create an off-grid voice automation system using LoRa (Long Range) communication. Imagine having a voice-controlled setup that works even in remote areas without reliable cellular or Wi-Fi networks. Whether you’re camping, exploring, or simply want to extend your communication range, this project is for you!
Components Needed⚙️:- LoRa Wio E5.
- Xiao ESP32-S3.
- Gravity: Offline Language Learning Voice Recognition Sensor.
- Customized PCB from Seeed Fusion.
In the world of electronics prototyping, transitioning from a breadboard to a custom-designed printed circuit board (PCB) is a significant leap. It not only enhances reliability but also provides a professional touch to your projects. In my case, I decided to move away from the tangle of jumper wires and breadboard connections by designing a custom PCB using Seeed Studio Fusion PCB Service.
Now, instead of messy breadboard connections, I have a custom-designed PCB that integrates the Xiao ESP32-S3 and LoRa E5. This setup allows me to directly transmit data via LoRa without any hardwired.
Whether it’s an environmental monitoring system, a smart agriculture application, or an off-grid communication device, having a purpose-built PCB simplifies the journey from idea to reality.
Remember, every PCB tells a story—a story of creativity, problem-solving, and innovation. So, go ahead and craft your own PCB with Seeed Fusion Service.
Gravity: Offline Language Learning Voice Recognition Sensor🔊:The Gravity Offline Speech Recognition Sensor is designed around an offline voice recognition chip, making it a powerful tool for voice control without relying on an internet connection. Here are its key features:
- Built-In Command Words: With 121 pre-defined fixed command words, this sensor covers a wide range of functionalities out of the box.
- Customization: Beyond the built-in commands, you can add 17 custom command words, tailoring the sensor to your specific needs.
- Controller Compatibility: The sensor seamlessly integrates with multiple common controllers, providing flexibility for makers and electronics enthusiasts.
- Applications: Whether it’s smart home appliances, toys, lighting fixtures, or robotics projects, this sensor is a versatile solution for any application that requires reliable voice control or interaction.
In summary, the Gravity Offline Speech Recognition Sensor empowers makers to create innovative voice-controlled devices, even in offline environments. 🎙️🔌
Adding Voice Learning Sensor with our PCB⚡:The Gravity Offline Learning Sensor is a perfect fit for our voice automation project. Now, let’s seamlessly integrate it with our custom PCB. This sensor can work in both I2C and UART communication, and in our PCB design, we have added connectors to connect with external sensors.
Now our hardware is completely ready, the next step is to program the Xiao ESP32 S3 to communicate with the Voice Learning Sensor.
First, install the DFRobot_DF2301Q library from the DFRobot repo.
Add the library to the Arduino IDE.
Once you have installed the library next open the example sketch and look for the DF2301Q.
You can see both I2C and UART examples, now we need only the I2C example.
#include "DFRobot_DF2301Q.h"
DFRobot_DF2301Q_I2C DF2301Q;
void setup() {
Serial.begin(115200);
while (!(DF2301Q.begin())) {
Serial.println("Communication with device failed, please check connection");
delay(3000);
}
Serial.println("Begin ok!");
DF2301Q.setVolume(5);
DF2301Q.setMuteMode(0);
DF2301Q.setWakeTime(15);
uint8_t wakeTime = 0;
wakeTime = DF2301Q.getWakeTime();
Serial.print("wakeTime = ");
Serial.println(wakeTime);
DF2301Q.playByCMDID(23);
}
void loop() {
uint8_t CMDID = 0;
CMDID = DF2301Q.getCMDID();
if (0 != CMDID) {
Serial.print("CMDID = ");
Serial.println(CMDID);
}
delay(3000);
}
This example sketch can read the voice learning sensor values and it will print it in the serial terminal.
"Image"
Transmit Data via LoRa🛜:The next step is to transmit our voice sensor data via LoRa communication. To transmit our data here I'm going to use the LoRaE5 library by Ramin Sangesari.
Thanks to Ramin Sangesari for this awesome simple library.
This library contains two example sketches, one is a receiver and the other one is the transmitter.
Here is the final sketch that can transmit our voice learning sensor data via LoRa.
#include <LoRaE5.h>
#include "DFRobot_DF2301Q.h"
DFRobot_DF2301Q_I2C DF2301Q;
#define GROVE_TX 43
#define GROVE_RX 44
const long interval = 2000;
unsigned long previousMillis = 0;
void setup(void) {
Serial.begin(115200);
lora.init(GROVE_RX, GROVE_TX);
lora.initP2PMode(866, SF12, BW125, 12, 15, 14);
while (!(DF2301Q.begin())) {
Serial.println("Communication with device failed, please check connection");
delay(3000);
}
Serial.println("Begin ok!");
DF2301Q.setVolume(5);
DF2301Q.setMuteMode(0);
DF2301Q.setWakeTime(15);
uint8_t wakeTime = 0;
wakeTime = DF2301Q.getWakeTime();
Serial.print("wakeTime = ");
Serial.println(wakeTime);
DF2301Q.playByCMDID(23); // Common word ID
}
void loop(void) {
uint8_t CMDID = 0;
CMDID = DF2301Q.getCMDID();
if (0 != CMDID) {
Serial.print("CMDID = ");
Serial.println(CMDID);
String GPSData = (String(CMDID));
lora.transferPacketP2PMode((char *)GPSData.c_str());
Serial.println("[Data has been sent.]");
}
delay(3000);
}
Here is the receiver sketch:
#include <LoRaE5.h>
unsigned char buffer[128] = {0,};
String incomingString;
#define GROVE_TX 43
#define GROVE_RX 44
void setup(void) {
Serial.begin(115200);
lora.init(GROVE_RX, GROVE_TX);
delay(2000);
lora.initP2PMode(866, SF12, BW125, 12, 15, 14);
}
void loop(void) {
short length = 0;
short rssi = 0;
memset(buffer, 0, 128);
length = lora.receivePacketP2PMode(buffer, 128, &rssi, 1);
if (length) {
incomingString = String((char*)buffer);
String Data = incomingString;
Serial.print("Incoming data from voice sensor : ");
Serial.println(Data);
}
}
Final Deployment✅:Here is the final deployment, which directly transmits the Offline Voice sensor's data to the receiver node via long-range communication.
In the realm of voice automation, LoRa technology emerges as a game-changer. Our project seamlessly integrates voice recognition capabilities with long-range communication, enabling smart devices to respond to spoken commands even in remote areas. As we wrap up this endeavor, we celebrate the fusion of hardware, software, and creativity—a symphony of innovation that empowers us to interact with our environment effortlessly. From smart homes to agricultural automation, the possibilities are boundless. So, let our voices echo through the airwaves, shaping a future where communication knows no bounds. 🎙️🌐✨
Comments
Please log in or sign up to comment.