Last active
December 24, 2015 22:39
-
-
Save j0uni/6873893 to your computer and use it in GitHub Desktop.
Hacking remote controlled power outlet / switch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
One-evening hacking for Rev remote controlled power outlet. | |
The transmitter sends long and short pulses for certain bit length (probably 25 bits). | |
UPDATD: Oscilloscoped from tx data pin (FOUND THEM!) | |
(Chan1 off) = 0101110111010100000011000 | |
(Chan1 on) = 0101110111010100000000110 | |
Short pulse=320us | |
Long pulse=960us | |
Someone has also hacked this with little bit different times & approaches: http://rayshobby.net/wordpress/wp-content/uploads/software/rfcontrol.pde | |
--------------------------------------------------------- | |
char offChr[] = "0101110111010100000000110"; | |
char onChr[] = "0101110101011100000000110"; | |
void setup() | |
{ | |
pinMode(2, OUTPUT); // tx data | |
pinMode(3, OUTPUT); // tx power | |
} | |
void turnOff() | |
{ | |
digitalWrite(3, HIGH); | |
delay(1000); | |
for (int i=0; i<10; i++) | |
{ | |
for (int i=0; i<25; i++) | |
{ | |
digitalWrite(2, HIGH); | |
if (onChr[i]=='1') | |
{ | |
delayMicroseconds(960); | |
digitalWrite(2, LOW); | |
delayMicroseconds(320); | |
} | |
else | |
{ | |
delayMicroseconds(320); | |
digitalWrite(2, LOW); | |
delayMicroseconds(960); | |
} | |
} | |
delayMicroseconds(960+320); | |
} | |
digitalWrite(3, LOW); | |
} | |
void loop() | |
{ | |
turnOff(); | |
delay(3000); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment