Electronics > Beginners
Infrared frequency heater remote
<< < (2/2)
max246:
Sorry if I sound a bit too stupid, but are you saying that I will just make my own "on and off" procedure?

Just create my code that does digitalWrite HIGH and LOW on the same timing of what I see on the screen?

what about if I want to use the IR library from arduino? I see I can send "RAW" data, but I am not sure if measuring the "delta" of each spike was correct.


Also, how can I confirm that this is 38KHZ ? I just want to make sure I am  able to reproduce this signal so I can "hack " my heater.
hexreader:
I think the honest reply is that I simply do not know enough about your heater and it's remote to be able to give meaningful advice.

Sorry

Are you trying to make your own IR remote?, or are you trying to wire 6 buttons directly to the heater? or are you trying to control your heater from a computer of some kind?   .. or am I missing the point entirely?

I have very limited Arduino knowledge, but I suspect that there is no library to create the raw signal that you seem to want, so my guess is... yes, you will need to use digitalWrite high/low (or direct port manipulation) with appropriate delays.

Maybe mentioning 38kHz was a mistake, since re-reading the above, it seems that you really do want the raw signal (presumably to inject into the point in the circuit where  the IR receiver output goes/went to?)

It is possible that I completely misunderstand, in which case please just ignore my guesswork.
hexreader:
This sketch seems to produce a scope trace to match yours:


--- Code: ---// produce raw command for 6 button heater control
// currently only know one button code, so for now, just repeatedly send that one code
// written by amateur coder who accepts no reponsibility for anything, anywhere, ever

// pin allocation
int heatPin = 13;                             // LED connected to digital pin 13

// function prototypes
void send0();
void send1();
void sendmessage(signed int send_data);

void setup() {
  pinMode(heatPin, OUTPUT);                   // sets the digital pin as output
  digitalWrite(heatPin, LOW);                 // sets the output low - quiescent state
}

// test program - send same button code over and over
void loop() {
  sendmessage(0xD88);                        // button 1 code
  delay(2000);                               // repeat every 2 seconds
}

// send a 12 bit message plus stop bit
void sendmessage(signed int send_data){
signed char bitnum;                          // count through 12 bits

  for (bitnum = 11 ; bitnum >= 0 ; bitnum--){
    if ((send_data >> bitnum) & 0x001){      // test bit 0 after shifting n bits
      send1();
    }
    else{
      send0(); 
    }
  }
  send0();                                    // stop bit of zero
}

// send a one (1200uS high followed 400uS low)
void send1(){
  digitalWrite(heatPin, HIGH);                // sets the output high
  delayMicroseconds(1200);                    // high time
  digitalWrite(heatPin, LOW);                 // sets the output low
  delayMicroseconds(400);                     // low time
}

// send a zero (400uS high followed 1200uS low)
void send0(){
  digitalWrite(heatPin, HIGH);                // sets the output high
  delayMicroseconds(400);                     // high time
  digitalWrite(heatPin, LOW);                 // sets the output low
  delayMicroseconds(1200);                    // low time
}

--- End code ---
alsetalokin4017:
check the comments on the last two function definitions
hexreader:
Well spotted...

.... fixed with edit
Navigation
Message Index
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod