Hello guys! So im trying to reverse engineer a IR sensor for an air conditioner project. The IR is a panasonic made, checked it using a program. problem is i cant get the decimal values for each button pressed. everytime i do it just shows the same numbers. I cant seem to find the library needed to correctly display the values. any help?
Please show your code using code tags </>.
See this part of IRremote.hpp in the IRremote library:
/**
* The length of the buffer where the IR timing data is stored before decoding
* 100 is sufficient for most standard protocols, but air conditioners often send a longer protocol data stream
*/
#if !defined(RAW_BUFFER_LENGTH)
# if defined(DECODE_MAGIQUEST)
#define RAW_BUFFER_LENGTH 112 // MagiQuest requires 112 bytes.
# else
#define RAW_BUFFER_LENGTH 100 ///< Length of raw duration buffer. Must be even. 100 supports up to 48 bit codings inclusive 1 start and 1 stop bit.
//#define RAW_BUFFER_LENGTH 750 // 750 (600 if we have only 2k RAM) is the value for air condition remotes.
# endif
#endif
You state " IR is a panasonic made", I think they made a lot more than one variety, which one. You also state: " air conditioner project", are you designing one or trying to hack one? You might give us make and model numbers but rest assured the users will use their favorite search engine and find out which of many different protocols that device uses. It would also help us help you if you read the forum guidelines.
We are designing a Inverter. From a normal AC.
type or past#include <IRremote.hpp>
//#include <IRRemoteControl.h>
//#include <IRRemoteControlInt.h>
//#include <arduino.h>
//#include <IRremote.h>
const int RECV_PIN = 22;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup() {
Serial.begin(9600);
irrecv.enableIRIn();
// put your setup code here, to run once:
}
void loop() {
if (irrecv.decode(&results)){
Serial.println(results.value,DEC);
irrecv.resume();// put your main code here, to run repeatedly:
}
delay(100);
}e code here
I did. i got 0 clues as to what i need to do. i even tried using binary. still too many same results, although some of the binary values change when buttons are pressed.
so the model number of the remote is GZ-1002A-E3
The clue is that they recommend changing RAW_BUFFER_LENGTH to 750 for AC remotes.
Edit the file "IRremote.hpp" in the IRremote library to change those lines to:
# else
//#define RAW_BUFFER_LENGTH 100 ///< Length of raw duration buffer. Must be even. 100 supports up to 48 bit codings inclusive 1 start and 1 stop bit.
#define RAW_BUFFER_LENGTH 750 // 750 (600 if we have only 2k RAM) is the value for air condition remotes.
# endif
I see! alright ill do that and see if it helps. And reply accordingly later. Stay in touch Teacher. Thank you.
Processing: IMG20221202122046.jpg...
ok so i tried using the method you suggested. To no avail tho.
#include <IRremote.hpp>
//#include <IRRemoteControl.h>
//#include <IRRemoteControlInt.h>
//#include <arduino.h>
//#include <IRremote.h>
const int RECV_PIN = 22;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup() {
Serial.begin(9600);
irrecv.enableIRIn();
// put your setup code here, to run once:
}
void loop() {
if (irrecv.decode(&results)){
Serial.println(results.value,BIN);
irrecv.resume();// put your main code here, to run repeatedly:
}
delay(100);
}`
What model Arduino are you using? The UNO doesn't have a Pin 22. For the Arduino MEGA 2560 the "MinimalReceiver" example uses Pin 21 (INT0).
Yes im using the mega 2560 for this. Is that a bad idea?
Have you tried using Pin 21 instead of Pin 22?
Not yet. ill do that right now
So do something different.
If you want more help, provide more detail. What values do you want? If the values you want are larger than 32 bits you will not get them from "results.value". You will have to interpret the raw pulse lengths. Try the example sketch "ReceiveDump".
Please, stop posting pictures of your screen. Copy the text from Serial Monitor and paste it into your post.
Alright. im gonna use a A.IR shield ESP8266 with ESP8266 MOD. If that dont work ill come back to your method. Sorry bout the picture thing.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.