Hi
Im trying to mimic a RF remote to control a retail RF powerplug. (a Danish Sartano model number 50080).
I have not connected it to Blynk yet but will come when I get this right.
Though I have come quite far, but struggling with sending the signal in a correct way.
I have used a SDR usb dongle with the linux commandline tool rtl_433.
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Exact sample rate is: 250000.000414 Hz
Sample rate set to 250000.
Bit detection level set to 0 (Auto).
Tuner gain set to Auto.
Reading samples in async mode…
Tuned to 433920000 Hz.
Picking up the “on” signal from the remote:
*** signal_start = 573180, signal_end = 721237
signal_len = 148057, pulses = 282
Iteration 1. t: 203 min: 94 (134) max: 313 (148) delta 2221
Iteration 2. t: 203 min: 94 (134) max: 313 (148) delta 0
Pulse coding: Short pulse length 94 - Long pulse length 313
Short distance: 215, long distance: 570, packet distance: 1763
p_limit: 203
bitbuffer:: Number of rows: 5
[00] {151} 65 1d b8 32 8e dc 19 47 6e 0c a3 b7 06 51 db 83 28 ed c0
[01] {33} 2e 0f fa d3 00 : 00101110 00001111 11111010 11010011 0
[02] {33} 2e 0f fa d3 00 : 00101110 00001111 11111010 11010011 0
[03] {33} 2e 0f fa d3 00 : 00101110 00001111 11111010 11010011 0
[04] {32} 2e 0f fa d3 : 00101110 00001111 11111010 11010011
and trying to mimic it by the arduino pro mini 3.3v
But the rtl_433 tool picks up the signal quite different, instead of 3-4 repeated signals, it picks it up as 13 signals.
*** signal_start = 2630409, signal_end = 2664289
signal_len = 33880, pulses = 33
Iteration 1. t: 205 min: 91 (14) max: 320 (19) delta 17
Iteration 2. t: 205 min: 91 (14) max: 320 (19) delta 0
Pulse coding: Short pulse length 91 - Long pulse length 320
Short distance: 107, long distance: 110, packet distance: 339
p_limit: 205
bitbuffer:: Number of rows: 14
[00] {1} 00 : 0
[01] {1} 00 : 0
[02] {2} 80 : 10
[03] {4} e0 : 1110
[04] {1} 00 : 0
[05] {1} 00 : 0
[06] {1} 00 : 0
[07] {1} 00 : 0
[08] {10} ff 80 : 11111111 10
[09] {2} 80 : 10
[10] {3} c0 : 110
[11] {2} 80 : 10
[12] {1} 00 : 0
[13] {3} c0 : 110
Must have something to do with bitbuffer I guess?
Extra info:
since the rtl_433 uses 250k sampelrate I have multiplied the min/max with 4.
signal_len = 33880, pulses = 33
Iteration 1. t: 206 min: 92 (14) max: 320 (19) delta 40
Iteration 2. t: 206 min: 92 (14) max: 320 (19) delta 0
Pulse coding: Short pulse length 92 - Long pulse length 320
If anyone know on how to move on, I’ll appreciate some help
my arduino code is this
#define rfTransmitPin 4
#define ledPin 13
void setup(){
Serial.begin(9600);
pinMode(rfTransmitPin, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(rfTransmitPin, LOW);
Serial.print("ready\n");
}
void loop(){
transmitCode();
Serial.print("transmitting ON signal \n");
}
#define SHORT_WAIT delayMicroseconds(336) //min x4
#define LONG_WAIT delayMicroseconds(1228) //max x4
#define TX_LOW digitalWrite(rfTransmitPin, LOW)
#define TX_HIGH digitalWrite(rfTransmitPin, HIGH)
#define OUTPUT_0 {TX_HIGH; SHORT_WAIT; TX_LOW; LONG_WAIT;}
#define OUTPUT_1 {TX_HIGH; LONG_WAIT; TX_LOW; SHORT_WAIT;}
#define FRAME_SIZE 33
int code[] = {0,0,1,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,0,0,1,1,0};
void transmitCode() {
digitalWrite(ledPin, HIGH);
//for (int repeat = 1; repeat <= 3; repeat++)
// {
for (int i = 0; i < FRAME_SIZE; i++)
{
if(code[i] == 1)
{
Serial.print(code[i]);
//OUTPUT_1;
digitalWrite(rfTransmitPin, HIGH);
delayMicroseconds(1228);
digitalWrite(rfTransmitPin, LOW);
delayMicroseconds(336);
}
else
{
Serial.print(code[i]);
//OUTPUT_0;
digitalWrite(rfTransmitPin, HIGH);
delayMicroseconds(336);
digitalWrite(rfTransmitPin, LOW);
delayMicroseconds(1228);
}
}
digitalWrite(rfTransmitPin, LOW);
delayMicroseconds(200);
// }
Serial.print("\nwaiting \n");
digitalWrite(ledPin, LOW);
delay(10000);
digitalWrite(ledPin, LOW);
}