Need help to decode async serial signal - pic inside

I'm hacking a "Living Solutions" Wireless Outdoor 2 outlet remote control, model YLT-11, and need some help figuring out what values two digital signals might represent.

I have captured and attached the two digital signals that I need help figuring out.

I've used my Arduino as a logic analyzer to capture the signals.
I'm using http://www.lxtreme.nl/ols to view the captured signal.
I'm using GitHub - gillham/logic_analyzer: Implementation of a SUMP compatible logic analyzer for the Arduino on the Arduino to capture the signals at 20Khz.

Using the sniffer tool, I cant quite seem to get any useful conversion out of it. I've tried a few different permutations and haven't really seen anything that struck me as solid.

I suspect that the signal is likely 8n1, no parity @ 2400 baud with a stop bit, but am not sure what else I can try to decipher these two signals.

I'm hoping I'm missing something simple here.

Doesn't look like asynchronous serial to me, I would consider seeing if it's a X10 signaling system.

This looks like an IR code to me. It is not asynchronous serial, rather I think the 1s and 0s are encoded as pulse lengths. So, the first message might be 10101010010001010 ... (or the reverse).

If you want to write a program to send these signals, one approach is to measure all the on/off timings carefully and just send a close copy of the entire stream.

agree with jremington, it looks like pulse length encoding

it starts with a start bit followed by 2 bytes

on = 0101-0100 1000-1010 == 0x568A
off = 0101-0101 0111-0100 == 0x5574

1 = pulselength > 1000 micros()
0 = pulselength < 1000 micros()

(check Arduino Playground - DHTLib for some code idea how to capture)

One thing I could use some help understanding, I don't know how many bytes of info there are in this. robtillaart indicates 2, but I dont see how to decipher this off hand. Can anyone shed some light on where the line between bytes is possibly drawn?

if I look at the image from the left to the right, the very first transition from low to high on the far left, because it appears double wide, do you think that that is both the start bit, as well as a single logic 1?

I'm still a bit in the dark, but will see if I can learn some more, and come back with more specific questions.
Thanks for the info everyone, I'll play with it a bit more from the suggestions made.

Every positive pulse is a bit .

The first (long) pulse is a wakeup bit (stating at 9 ms)

The first bit of the first byte start at ~10.5 ms , the first byte ends at ~24 ms (length 13500 micros for 8 bits)
The first bit of the 2nd byte starts at ~24.5 ms and ends at ~48 ms (also length 13500 micros for 8 bits )

speed equals to about 592 baud

Progress Update:
I have recently been able to toggle the relay via the Arduino. :slight_smile:

After some additional digging, I discovered the following:

Turns out I didn't know how to use the capture software properly (probably still dont), and it ended up that I was missing an earlier start bit that I didn't see initially. I slowed my capture down to 1Khz, and learned that I needed a 470us start bit, followed by a 12ms delay, then the data (data only repeated 3x) .

I also learned that after the start bit, for whatever reason, I need to send my data 3 times. Not 100% sure why... might be a timing issue, or something else I am unaware of at this time. I don't have access to a fancy logic analyzer, so I'm out of luck here as best I can tell.

But in the end, I got it to work.

In case this helps anyone else out in the future, here are some specifics about the item I was working with:

Living Solutions
Outdoor 2-outlet remote control
Distributed by Walgreen's
model number YLT-11
UPC: 049022614611

PS: I bought 2 of them, and they each use the same remote control signal.

Here is my test code:

//Timings
int longDelay = 1250;
int shortDelay = 480;

//output pin that sends signal
int pin = 8;

void setup() {
  pinMode(pin, OUTPUT);
  digitalWrite(pin,LOW);
  Serial.begin(115200);
}

void loop() {
  //Turn it On
  burst(pin);
  for(int i = 0; i < 3; i++){
    common(pin);
    common(pin);
    common(pin);
    common(pin);
    shortOn(pin);
    common(pin);
    shortOn(pin);
    shortOn(pin);
    common(pin);
    common(pin);
    delayMicroseconds(12000);    
  }
  //Admire
  delay(2000);

  //now turn it off
  burst(pin);
  for(int i = 0; i< 3; i++){
    common(pin);
    common(pin);
    common(pin);
    common(pin);
    common(pin);
    longOn(pin);
    longOn(pin);
    longOn(pin);
    shortOn(pin);      
    common(pin);
    shortOn(pin);  
    delayMicroseconds(12000);    
  }
  //Admire
  delay(2000);
}

void burst(int pinNum){
  digitalWrite(pinNum,HIGH);
  delayMicroseconds(470);
  digitalWrite(pinNum,LOW);
  //short off
  delayMicroseconds(12000);
}

void common(int pinNum){
  //long on
  digitalWrite(pinNum,HIGH);
  delayMicroseconds(longDelay);
  digitalWrite(pinNum,LOW);
  //short off
  delayMicroseconds(shortDelay);
  //short on
  digitalWrite(pinNum,HIGH);
  delayMicroseconds(shortDelay);
  digitalWrite(pinNum,LOW);    
  //long off
  delayMicroseconds(longDelay);

}

void shortOn(int pinNum){
      //short on
  digitalWrite(pinNum,HIGH);
  delayMicroseconds(shortDelay);
  digitalWrite(pinNum,LOW);    
  delayMicroseconds(longDelay);
}

void longOn(int pinNum){
    //long on
  digitalWrite(pinNum,HIGH);
  delayMicroseconds(longDelay);
  digitalWrite(pinNum,LOW);
  //short off
  delayMicroseconds(shortDelay);
}

So because I'm not satisfied not understanding why I got this to work.. I started digging.
It would seem to me that my signal is Manchester encoded. (maye not, but I suspect it is.)

I'm still learning, but a couple of good sites have helped me so far:

I started reading this...
http://www.airspayce.com/mikem/arduino/VirtualWire/
which led to this...

and then I got to this... (which REALLY turned on the light for me - would recommend anyone looking into RF communication read this)
http://www.rfm.com/products/apnotes/tr_swg05.pdf

I wrote a library for the Walgreens Living Solutions indoor controllers (433 MHz). It's located at GitHub - swmcdonnell/LSLight: Arduino library for the Walgreens Living Solutions remote control lights .

If the indoor and outdoor are the same, the codes are:
Prefix: 01101010101101100000
Suffix: 0

-Lamp- -OFF-- -ON-----
1 0111 1111
2 0011 1011
3 0101 1000
ALL 0100 1000

For example, to turn ON Lamp 1, the code is: "0110101010110110000011110"