New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Implement B&O protocol #56

Closed
Ion3 opened this Issue Mar 19, 2014 · 8 comments

Comments

Projects
None yet
3 participants
@Ion3
Copy link

Ion3 commented Mar 19, 2014

Is it possible to implement the Bang & Olufsen protocol based on this project?

https://github.com/christianlykke9/Beomote

I would love to have the possibility to send B & O signals with my Arduino!

@exidyboy

This comment has been minimized.

Copy link

exidyboy commented Mar 19, 2014

On 20/03/2014, at 2:48 AM, Ion3 wrote:

Is it possible to implement the Bang & Olufsen protocol based on
this project?

https://github.com/christianlykke9/Beomote

I would love to have the possibility to send B & O signals with my
Arduino!

Why not just use the Arduino library you have linked to then ?
Not sure anyone will reverse engineer that code for you and fold it
into IRremote purely for the intellectual challenge :-)
I think you need to post information about how the protocol works and
whether it is similar to others.
There is no information in the code that leaps out at me about how the
protocol works but it appears a custom IR transmitter is used that has
an I2C interface.
That might make it too much of an outlier but also means you could run
IRremote and Beomote on the same Arduino if that is your reason for
wanting it included.
Why not take on the challenge yourself by getting a B&O receiver and
start examining the output from your remote - it would be an
interesting project with practical benefits for you - and they are
always the most motivating projects :-)

Good luck,

Mike

@Ion3

This comment has been minimized.

Copy link

Ion3 commented Mar 20, 2014

Dear Mike,

the Beomote (I’ve linked) is so far just a receiver and based on my current programming skills, it seems to be too challenging for me to turn it to a transmitter.

You are right, you need a special receiver to be able to receive 455 kHz signals. On the other hand, I believe it should easily be possible to reproduce the 455 kHz commands with an IR-LED. The HEX code commands seems to be listed here: https://github.com/christianlykke9/Beomote/blob/master/Commands.h

To sum up the information I got so far the protocol is as follows:
Frequency: 455 kHz
Coding: pulse distance
Frame: 4 start bits + 16 data bits + 1 trailer bit + 1 stopbit
Data: 0 address-bits + 16 command bits
Start-Bit 1: 200µs puls, 2925µs pause
Start-Bit 2: 200µs puls, 2925µs pause
Start-Bit 3: 200µs puls, 15425µs pause
Start-Bit 4: 200µs puls, 2925µs pause
0-Bit: 200µs puls, 2925µs pause
1-Bit: 200µs puls, 9175µs pause
R-Bit: 200µs puls, 6050µs pause, repetition of last bit
Trailer bit: 200µs puls, 12300µs pause
Stop bit: 200µs puls
Repetition: none
Pushbutton repetition: N-times repetition of original-frames within 100ms
Bit order: MSB first
(Source: http://www.mikrocontroller.net/articles/IRMP#B.26O)

Here another description of the Bang & Olufsen protocol: http://www.lintronic.dk/codeset_701.pdf & http://www.lintronic.dk/command_801.pdf

Maybe the image at the end of that IR Widget compendium is also helpful: (scroll down) http://www.compendiumarcana.com/irwidget/gallery/gallery.html

I also found a maybe useful circuit for transmitting infrared signals at this high frequency: http://www.analysir.com/blog/2013/11/22/constant-current-infrared-led-circuit/

And a final link describing the B&O IR protocol: http://lirc.sourceforge.net/remotes/bang&olufsen/Beo4

My problem is just how to link all the information I gathered together. I hope I can get some help here.

Thanks,
Timo

@Ion3

This comment has been minimized.

Copy link

Ion3 commented Mar 20, 2014

Dear Mike,

I think you got me moving. I wrote a quite simple example. Did I understand it right? Do I need to regard the frequency? From my understanding at the moment, it is just relevant while receiving data, correct?

Here the simplest way of writing the remote command for starting up the TV:

const int TVbuttonPin = 2;
const int BEO_IR =  13;

int TVbuttonState = 0;

void setup() {
  pinMode(BEO_IR, OUTPUT);      
  pinMode(TVbuttonPin, INPUT);     
}

void loop(){
  TVbuttonState = digitalRead(TVbuttonPin);

  if (TVbuttonState == HIGH) {       
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(3125);  // start bit 1
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(3125);  // start bit 2
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(15625); // start bit 3
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(3125);  // start bit 4
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 01: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 02: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 03: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 04: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 05: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 06: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 07: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 08: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(9375);  // data bit 09: 1 bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(3125);  // data bit 10: 0 bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 11: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 12: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 13: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 14: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 15: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(6250);  // data bit 16: repeat bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW); delayMicroseconds(12500); // trailer bit
    digitalWrite(BEO_IR, HIGH); delayMicroseconds(200); digitalWrite(BEO_IR, LOW);                           // stop bit
  } 

}

The HEX-Code for the command ist 0080 which makes BIN: 0000 0000 1000 0000

@exidyboy

This comment has been minimized.

Copy link

exidyboy commented Mar 21, 2014

Great work !

Yes that is exactly how I was going to suggest you should start out.
Just try and send one only command using delays to get the correct
'pulse distance coding'.
However I think you will still need to generate the correct frequency
of 455 kHz - by the way this is much higher than other remote control
protocols which are around 38KHz - not sure if a standard IR LED will
be OK.

Some options for generating 455KHz:

  • look at how 38KHz is done in the IRremote library
  • Use a dedicated hardware circuit like the one you linked to
    connected to BEO_IR
  • Use another Arduino (at least temporarily) (if you have one)
    dedicated to just generate a 455KHz waveform (either using 'delay' or
    using the PWM timers) and activate that 455KHz waveform generated code
    via an input pin that you connect to BEO_IR output of the 1st Arduino.

Hopefully your B&O device gives some feedback when it sees IR light
modulated at the correct frequency so you will know when you are in
the ballpark.

One way to break the problem up into more manageable steps if you get
stuck would be to get some practice with this 'bit banging' control
method by trying to control a more standard device that works at
38KHz. Then you can use the IRremote library and a 'standard' 38KHz IR
receiver to analyse the transmissions generated by your code.

Do you have an account on the Arduino forum as this discussion isn't
really about IRremote any more - perhaps we should move it there.

Good to see you making some progress !

On 21/03/2014, at 12:56 AM, Ion3 wrote:

Dear Mike,

I think you got me moving. I wrote a quite simple example. Did I
understand it right? Do I need to regard the frequency? From my
understanding at the moment, it is just relevant while receiving
data, correct?

Here the simplest way of writing the remote command for starting up
the TV:

const int TVbuttonPin = 2;
const int BEO_IR = 13;

int TVbuttonState = 0;

void setup() {
pinMode(BEO_IR, OUTPUT);
pinMode(TVbuttonPin, INPUT);
}

void loop(){
TVbuttonState = digitalRead(TVbuttonPin);

if (TVbuttonState == HIGH) {
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(3125); // start bit 1
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(3125); // start bit 2
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(15625); // start bit 3
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(3125); // start bit 4
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 01:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 02:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 03:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 04:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 05:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 06:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 07:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 08:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(9375); // data bit 09:
1 bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(3125); // data bit 10:
0 bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 11:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 12:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 13:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 14:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 15:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(6250); // data bit 16:
repeat bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); delayMicroseconds(12500); // trailer bit
digitalWrite(BEO_IR, HIGH); delayMicroseconds(200);
digitalWrite(BEO_IR, LOW); // stop bit
}

}
The HEX-Code for the command ist 0080 which makes BIN: 0000 0000
1000 0000


Reply to this email directly or view it on GitHub.

@Ion3

This comment has been minimized.

Copy link

Ion3 commented Mar 25, 2014

Dear Mike

Thank you for your feedback! I moved the discussion to:
http://forum.arduino.cc/index.php?topic=228399.0

I am still struggling with the carrier frequency. Are you able to help?

Thanx!

@exidyboy

This comment has been minimized.

Copy link

exidyboy commented Apr 6, 2014

Hi - I joined the conversation on the Arduino forum. 'AnalysIR' pointed out there that Ken's library should be able to generate 455KHz signals using sendRAW. Are you still around ?

@Ion3

This comment has been minimized.

Copy link

Ion3 commented Apr 7, 2014

Hi Mike,

I am not able to test it at the moment, but the idea is to let it look like something like this:

#include <PWM.h>

const int TVbuttonPin = 2;
const int fPIN = 9;
const int signalPIN = 13;

int TVbuttonState = 0;

void setup() {
  pinMode(signalPIN, OUTPUT);      
  pinMode(TVbuttonPin, INPUT);

  SetPinFrequency(fPIN, 455000);  
}

void loop(){
  TVbuttonState = digitalRead(TVbuttonPin);

  pwmWriteHR(fPIN, 32768);

  if (TVbuttonState == HIGH) {       
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(3125);  // start bit 1
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(3125);  // start bit 2
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(15625); // start bit 3
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(3125);  // start bit 4
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 01: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 02: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 03: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 04: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 05: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 06: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 07: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 08: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(9375);  // data bit 09: 1 bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(3125);  // data bit 10: 0 bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 11: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 12: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 13: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 14: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 15: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(6250);  // data bit 16: repeat bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW); delayMicroseconds(12500); // trailer bit
    digitalWrite(signalPIN, HIGH); delayMicroseconds(200); digitalWrite(signalPIN, LOW);                           // stop bit
  } 

}
@z3t0

This comment has been minimized.

Copy link
Owner

z3t0 commented Mar 7, 2015

@Ion3 The issue is being closed as it has been over 3 months since any activity and there does not seem to be any pending question. If the issue is not solved simply reopen it and label as 'New'. This will be considered as an idea for a future library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment