Go Down

Topic: Arduino - RF Sending (Read 644 times) previous topic - next topic

Arank

Sep 23, 2014, 02:00 am Last Edit: Sep 25, 2014, 04:09 pm by Arank Reason: 1
Hello,

I managed to use a sound card to "decode" my RF control signal, when I play the recorded sound from Audacity with a RF transmitter hooked on the microphone exit it triggers the remote normally.


But now I don't know how to send it from the Arduino. I already saw many RF librarys but I couldn't find any that handles "raw" binary data.


Anyone can help me with what I need to do now?


Peter_n

I would read it as:
short low, long high = 1 (or 0)
long low, short high = 0 (or 1)
So I read the attachment as : (0)0101100011011010101110101010
O well, that is the same as you had already  :smiley-roll:

The 2272 / 2262 tri-state coding is like this:
http://code.google.com/p/rc-switch/wiki/KnowHow_LineCoding
Two bits are converted to one.
For example:
00 = 0
11 = 1
01 = F
(10 does not occur).
In your data bits, both 01 and 01 occur, no matter which two bits I group, or if the signal is inverted.
So it might not be 2272 / 2262 encoding.

Are there different buttons for different signals ? that would help a lot.

You could set the bits in a table and transmit them, even without knowing the protocol.
Octal is 7 bits. Octet is 8 bits. An Octopus has four pairs of arms. October is the tenth month. An Octillion can be 10^27 or 10^48. An Octave is the interval between notes of half or twice the frequency. And last but not least: Octyl on its own is not really something.

Arank

Hi Peter_n, thanks for you response.

Quote
Are there different buttons for different signals ? that would help a lot.


Actually this remote have just one button, the encoder is a HT6P20B, I found some articles about it, but couldn't mange it to work.


http://acturcato.wordpress.com/2014/01/10/emulator-for-ht6p20b-encoder-on-arduino-board/
http://acturcato.wordpress.com/2014/01/04/decoder-for-ht6p20b-encoder-on-arduino-board-english/

Quote
You could set the bits in a table and transmit them, even without knowing the protocol.


That was exactly what I thinking, but I don't know how. Since I want to do this with 4 or 5.
Can you explain me?

Peter_n

I found a few more.

This video: https://www.youtube.com/watch?v=gw0Fa4-t8os
Is this code: http://forum.arduino.cc/index.php?topic=54788.msg707885#msg707885

But I think the one you found could be better.
This is the Github : https://gist.github.com/acturcato

You have 27 or 28 bit and Actucato tells it is 28 bit and should end with 0101
Perhaps your bits have to be reversed: ADDRESS.01.0101
However that doesn't match the address.
acturcato uses 0x2A9955 for the ADDRESS. Converted to binary, there are no consecutive three '0' and no three '1'. But in your bits there are.

I don't know what to do next. Your bits don't match the protocol found by acturcato.

Perhaps you have to look for Arduino code that learns the data and plays it back.
Octal is 7 bits. Octet is 8 bits. An Octopus has four pairs of arms. October is the tenth month. An Octillion can be 10^27 or 10^48. An Octave is the interval between notes of half or twice the frequency. And last but not least: Octyl on its own is not really something.

Arank

#4
Sep 23, 2014, 01:20 pm Last Edit: Sep 23, 2014, 02:08 pm by Arank Reason: 1
Quote
I don't know what to do next. Your bits don't match the protocol found by acturcato.


I will try to capture the code again, just to be sure, but since this code works when I play it back with the sound card, I think it's "right".

Quote
Perhaps you have to look for Arduino code that learns the data and plays it back.


I already tried many librarys that is suposed to do it, any worked with any of my remotes.

There is no way of playing it as it is?
I mean creating a char array with the sequence and send it to the transmitter?

I saw some sketches doing something like this, but I couldn't figure how it works to change what I need, I actually don't understand the deeps of the RF communication, for me it was really hard to get these remote code, and as I said I got like 4 or 5 (different protocol) remotes that I would like to use with the Arduino. So I think handling the "raw" (binary) data could be the better sollution to handle it all.

jremington

Quote
There is no way of playing it as it is?
It is very simple to replay that transmission. You need to accurately measure the durations of the high and low pulses, store those in an array, and then recreate the signal.

In the simplest case, just use digitalWrite() to set the output high or low and use delayMicros() to time the pulse.
"It seems to run on some form of electricity"

Peter_n

I agree with jremington. I think at this point you need to get good data with more in front and at the back, because you need the 'sync' at the start. And use array or just code as jremington wrote.
Octal is 7 bits. Octet is 8 bits. An Octopus has four pairs of arms. October is the tenth month. An Octillion can be 10^27 or 10^48. An Octave is the interval between notes of half or twice the frequency. And last but not least: Octyl on its own is not really something.

Arank

#7
Sep 24, 2014, 12:01 am Last Edit: Sep 25, 2014, 04:45 pm by Arank Reason: 1
Thanks for your help guys, I found a simple sketch and addapt it to my needs timing the pulses and intervals and making a char array to switch low / high.


Code: [Select]
// High/Low microsecond timings, first value is high timing, the rest alternate low/high
const int hlUsTimings[] = {
380,440,700,800,360,440,720,780,380,440,700,800,360,460,700,780,380,440,700,800,360,800,360,460,720,13000};
const int hlUsSize = sizeof(hlUsTimings) / sizeof(hlUsTimings[0]);

const int pinChangeDelay = 0;                     // Value to subtract from numbers to compensate for instruction timings
const int outPin = 3;                             // Transmitter output pin
const int ledPin = 4;                             // LED output pin

void setup() {
  pinMode(ledPin,OUTPUT);
  pinMode(outPin,OUTPUT);
  digitalWrite(outPin,LOW);
  delayMicroseconds(13000);
}

void loop() {
  digitalWrite(ledPin,!digitalRead(ledPin));
  byte pinState = 0;
  noInterrupts();
  for (int y = 0; y < hlUsSize; y++){
    pinState = !pinState;
    digitalWrite(outPin,pinState);
    // if (pinState == 0){
      // delayMicroseconds(20);
    // }
    int z = hlUsTimings[y] - pinChangeDelay;
    delayMicroseconds(z);
  }
  interrupts();
}



I will try for the other remotes I want to do it, but I think it should work for anything.
Thanks!

Go Up