Could please provide any sample code and connection diagram regarding this.
My concern is even though each and every connection seems correct from power to tx/rx it is not working.
One strange thing i have noticed that even though there is no transmitter in power line but receiver still prints some garbage data.
this is arduino code i am using:
#include <SoftwareSerial.h>
/* led indicator led */
#define led 13
//to store state of led
bool led_state = LOW;
/* board type */
#define TX 1
#define RX 0
#define PLC_MODE TX
SoftwareSerial plc_serial(2, 3); // Rx, Tx
void setup() {
//KQ330 works on 9600 baudrate
plc_serial.begin(9600);
//serial monitor baudrate
Serial.begin(115200);
pinMode(led, OUTPUT);
}
void loop() {
//transmit data if board type is transmitter
#if PLC_MODE
//print 'H' for every 1 second of interval
plc_serial.print("H");
//toggle led for every 1 second of interval
led_state = digitalRead(led);
digitalWrite(led, !led_state);
delay(1000);
//receive data if board type is receiver
#else
if (plc_serial.available()) {
c = (char)plc_serial.read();
Serial.println(c);
/*
Process received data
*/
}
#endif
}
Communication does not seems very realiable, even in the github example posted above they are receiving lots of noise. So think you have to add some checksum and redundancy to obtain reliable communication.
The transmitter and receiver power supply are separated ( the trasmitter one is near the ac lines and draws 260mA, quite power hungry ). Datasheet is quite poor!
Did you succeded in receiving anything? Try sending more than 1 char a time and ( sorry if it sounds obvious ) did you cross the rx/tx from the board with tx/rx from the modem?
P.S.
'A few' year ago I made a powerline modem for a customer for controlling lights ( so this remembers me 'the good old days' )