Power Line Carrier Communication (PLCC) using KQ-130F / KQ-330 and Arduino
Get link
Facebook
X
Pinterest
Email
Other Apps
Here we have 4 different projects about Power line carrier communication (PLCC) using KQ-130F / KQ-330 module and Arduino.
Parts list:
Arduino Mega (you can use NANO or UNO)
Power line carrier communication module KQ-130F / KQ-330 (2pcs)
FTDI (USB to TTL serial converter)
LCD 16X2 with I2C
Power Supply 5V 1A
Capacitor 1000uF 16V (2pcs)
Capacitor 100nF (2pcs)
Capacitor 220nF 400V (4pcs)
Resistor 1K (5pcs)
RED LED
Green LED
Blue LED
Yellow LED
White LED
Buzzer
Common mode choke (2pcs)
Solid state relay module 5V 1 channel
PLCC Module:
There are 3 different types of this module
KQ-130K: Maximum carrier rate up to 1200 BPS (AC & DC power line) KQ-130E: Maximum carrier rate up to 400 BPS (AC & DC power line) KQ-130F: Standard carrier rate is 100 BPS (only AC power line)
TX goes to RX of the microcontroller
RX goes to TX of the microcontroller
Filtering Circuit:
Its better to use this circuit on the input side of the receiver and the transmitter (one circuit for each i.e 2 circuits) for noise reduction. I also used ferrite ring around the power cord cable.
First Project:
This code sending "Hello" to the receiver every 2 seconds. It sound useless but you can use it as a test to make sure your PLCC module is functional.
Receiver Circuit:
Transmitter Circuit:
Watch this video for more details:
Code:
voidsetup() {
Serial.begin(9600); // To Computer
Serial1.begin(9600); // To KQ-130/330
}
voidloop() {
// Send "Hello" to the power line
Serial1.println("Hello");
// If the module receives something from the power line, print it to the screen
while (Serial1.available()) {
Serial.write(Serial1.read());
}
delay(2000);
}
Second Project:
This code control 5 LEDs (Red, green, blue, yellow and white) using serial command.
For example to turn ON the Red LED you have to write " RED ON " in serial monitor then hit Enter.
To turn OFF the Red LED you have to write " RED OFF " in serial monitor then hit Enter.
The same thing for other colors.
You can also turn ON all LEDs together at the same time using this command " ALL ON " then hit Enter.
Transmitter Circuit:
Receiver Circuit:
Code:
constint RED = 2;
constint GREEN = 3;
constint BLUE = 4;
constint WHITE = 5;
constint YELLOW = 6;
voidsetup() {
Serial.begin(9600);
Serial1.begin(9600);
pinMode(RED, OUTPUT);
pinMode(GREEN, OUTPUT);
pinMode(BLUE, OUTPUT);
pinMode(WHITE, OUTPUT);
pinMode(YELLOW, OUTPUT);
Serial.println("System Ready: Sending ALL-ON / ALL-OFF now supported.");
}
voidloop() {
if (Serial1.available() > 0) {
String burst = Serial1.readStringUntil('\n');
burst.toUpperCase();
// --- MASTER COMMANDS (ALL) ---
if (burst.indexOf("ALL") != -1) {
if (burst.indexOf("ON") != -1) {
digitalWrite(RED, HIGH);
digitalWrite(GREEN, HIGH);
digitalWrite(BLUE, HIGH);
digitalWrite(WHITE, HIGH);
digitalWrite(YELLOW, HIGH);
}
elseif (burst.indexOf("OFF") != -1) {
digitalWrite(RED, LOW);
digitalWrite(GREEN, LOW);
digitalWrite(BLUE, LOW);
digitalWrite(WHITE, LOW);
digitalWrite(YELLOW, LOW);
}
}
// --- INDIVIDUAL COLORS ---
// RED
if (burst.indexOf("RED") != -1) {
if (burst.indexOf("ON") != -1) digitalWrite(RED, HIGH);