AC Mitsubishi - use Arduino as IR remote - Raw data issues

Everything related to protocols and IR codes
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: AC Mitsubishi - use Arduino as IR remote - Raw data issues

Post by AnalysIR »

Hi David

I can confirm your first signal decodes with AnalysIR into a Mitsubishi288AC signal.

It is likely that you need to correct the timings, particularly as it is such a long signal.

AnalysIR has a feature that automatically 'cleans' recorded signals to give vastly improved performance when sending the signals.

If you change the timings to the closest of 3400,1700,433,1299..you should see some results (assuming your emitter circuit is good)
david2000
Posts: 5
Joined: Sat Nov 03, 2018 8:49 am

Re: AC Mitsubishi - use Arduino as IR remote - Raw data issues

Post by david2000 »

Firstly, thanks for the reply!
I can confirm your first signal decodes with AnalysIR into a Mitsubishi288AC signal.
Thanks for the confirmation. What concerned me a little is that when capturing, there is always a trailing comma. This made me wonder if perhaps the signal was truncated. But if you say it does register as a complete signal, that is good news.
AnalysIR has a feature that automatically 'cleans' recorded signals to give vastly improved performance when sending the signals.
This does not appear to be possible to do while running in demo mode and it's difficult for me to justify purchasing the full version given I will only ever use it once, to get these "on" and "off" values.
If you change the timings to the closest of 3400,1700,433,1299..you should see some results (assuming your emitter circuit is good)
I'm sorry but I don't quite follow you here. Are you suggesting that I round the figures up or down? There are 583 values to deal with, how do I determine to where they should be rounded? Up or down and by how much? I'm a tad confused.
david2000
Posts: 5
Joined: Sat Nov 03, 2018 8:49 am

Re: AC Mitsubishi - use Arduino as IR remote - Raw data issues

Post by david2000 »

just match them to the closest/nearest value, so 583=>433
I THINK I follow you. So I changed my code (painstakingly) manually to this but the unit still does not respond to this code when sent. There is one value right in the middle of "16928" which only occurs once. I did not modify it since my guess is that it's a "gap/break" before the code is transmitted again (?).

If I swap out the IR Led with a "normal" led, I can see it's definitely sending something when a key is pressed in the serial monitor ("Which also reports "sent signal") but for reasons beyond me, this will not work. I hate to admit defeat but I think I'm going to have to give up on this. Either I am way too stupid or it's just not possible. :( (Or both) ;)

Any other suggestions before I bin this project? (Aside from trying a different Arduino, which I have already done. Also tried on an Arduino Mega. I've also tried different (brand new) IR transmit LEDS.)

Any help appreciated.
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: AC Mitsubishi - use Arduino as IR remote - Raw data issues

Post by AnalysIR »

Some comments:
- The code you posted is not for the IRremote library, which I had assumed!...but should be very similar as IRLIB is a re-write of IRremote. Also note that IRLIB is no longer supported and has moved on to IRLIB2.
- Try 38kHz instead of 36 (This is according to our AnalysIR application). Should only be an issue if your emitter circuit is not the best. However, some receivers may reject longer signals such as this with the wrong carrier.
- You were correct to ignore the longer gap.
- I presume you have verified the correct output pin for the leonardo, as it is different from the normal pin on Arduino UNO.
- The 'cleaned signal' you posted decodes as a Mitsubichi AC signal with AnalysIR, so your 'painstakingly' manual editing looks correct.

So if it still does not work, please post a photo and/or circuit diagram of your IR emitter circuit, as that would be the most likely issue remaining.
david2000
Posts: 5
Joined: Sat Nov 03, 2018 8:49 am

Re: AC Mitsubishi - use Arduino as IR remote - Raw data issues

Post by david2000 »

Image
- The code you posted is not for the IRremote library, which I had assumed!...but should be very similar as IRLIB is a re-write of IRremote. Also note that IRLIB is no longer supported and has moved on to IRLIB2.
I am indeed using IRLIB2 and the reason for that is that using the IRemote library, I am not able to transmit this length of code.
How I came to this conclusion: I have a "normal" LED in place of the IRled and if I compile and upload the standard IrSendRawDemo sketch without editing anything at all. The LED blinks every 5 seconds as expected as it transmits the code. However, if I make NO other changes except to replace the example code's transmit code with my own cleaned one, the LED no longer blinks. No other changes made to sketch or to hardware setup. So it must be something to do with the unusual length of this string. FYI, I have already set #define RAWBUF 255 in my IRemoteInt.h file.
Try 38kHz instead of 36 (This is according to our AnalysIR application). Should only be an issue if your emitter circuit is not the best. However, some receivers may reject longer signals such as this with the wrong carrier.
OK, I have just tried this and there was no change in the result. ie the unit doesn't respond in any way whatsoever. :( Again I have tested from across the room all the way up to a few centimeters from the receiver on the unit itself.
I presume you have verified the correct output pin for the leonardo, as it is different from the normal pin on Arduino UNO.
I think perhaps you mean MEGA (?) as I do not have a leonardo, but did try the code on my MEGA in the hope that perhaps the extra memory would fix the issue. When running the sketch on the MEGA, I did use pin 21 (instead of pin 2 when using the IRemote library and instead of pin 3 when using the IRLIB2 library). The results were the same.
So if it still does not work, please post a photo and/or circuit diagram of your IR emitter circuit, as that would be the most likely issue remaining.
OK, I have attached a photo of each of the 3 setups I have tried. (Mega, Uno, ProMini).
Based on what I read on your blog here, "To maintain the peak current at 20mA the resistor value should be circa 173 ohms (or greater)." I am using a 220 ohm resistor in my circuit.
Note:
IRLIB2 sketch I am using PWN pin 3
IRemote sketch I am using pin 2 (as in these attached images).
You do not have the required permissions to view the files attached to this post.
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: AC Mitsubishi - use Arduino as IR remote - Raw data issues

Post by AnalysIR »

OK..thanks for the great info:)

FIrst, thing I suggest you go back to IRremote on the UNO, so that we have similar setups.

For sending, RAWBUF is not used or relevant. It has to do only with rx of signals.

Depending on your code, it could be related to SRAM(on the uno), but the mega should have more available.

So reduce RAWBUF back to 100 & go back to using IRremote(I am not sure how the latest version of IRLIB2 uses or allocates SRAM.

Another approach, you could use is to copy the example we have on our blog, for sending signals from flash, using IR remote. YOu will probably have to do something like this anyway, for your project to run on a basic arduino.

I mentioned leonardo, because of a comment in your code.

For IRremote use pin3 on the UNO!! (not 2)

Finally, change the resistor to 100R, if available (or put 2 220R in parallel). You would probably get away with 3 220R in parallel also, if I remember the details of that blog correctly.


Summary: Consider the above & post back after retesting on the UNO & re-post the actual code you use on the UNO with IRremote.
david2000
Posts: 5
Joined: Sat Nov 03, 2018 8:49 am

Re: AC Mitsubishi - use Arduino as IR remote - Raw data issues

Post by david2000 »

Another approach, you could use is to copy the example we have on our blog, for sending signals from flash, using IR remote. YOu will probably have to do something like this anyway, for your project to run on a basic arduino.
OK, I switched to your example code to send from flash (found here) and that seems to have solved the issue! (Thank you!) I also changed the resistor value to 100R as you recommended. I also manually cleaned up the "OFF" code I captured previously and using the above mentioned sketch, it works fine. I tested originally using an arduino UNO and now that it is working, I have switched over to an arduino pro mini which appears to be working equally well.

Finally it appears to be working as expected. The only caveat so far is that the range is not particularly good. About 4 meters (about 13 ft) max. Ideally I'd need 5 - 6 so hopefully I can improve that.

I am assuming that ALL settings from the remote are transmitted each time? So whatever the temperature and fan/swing settings were at capture will be re-sent each time the arduino transmits? If I use the actual remote to change the temp and then send the captured signal from the arduino, should I expect the temp to change? Or will the last set temp always remain and the signal merely toggles the unit on/off?

Thank you very much for the tips and suggestions to (finally) get this working. Much appreciated.
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: AC Mitsubishi - use Arduino as IR remote - Raw data issues

Post by AnalysIR »

Range:
Yes that is currently limited by your emitter circuit. Using a transistor driver circuit or the constant current circuit from our blog will improve things. Similarly all of the modules available in our shop are excellent (with programmable IR power)

AC
Yes they send the full configuration with each signal, generally.
sathyashriya
Posts: 1
Joined: Sun Feb 25, 2024 9:13 am

Re: AC Mitsubishi - use Arduino as IR remote - Raw data issues

Post by sathyashriya »

I'm trying to control an air-conditioner using Arduino UNO with the program. To receive IR signals from the remote, I'm using IR receiver module to receive signals form the remote and give codes for the ON and OFF command. And once I receive an array of raw codes for both, I'll give them in another program and give temperature conditions accordingly to invoke them to switch the AC on and off.

But the AC is not switching ON and OFF according to the temp conditions given. The air-conditioner is Mitsubishi Electric.

What could be the reason for this?

The program I'm following is: https://github.com/LokeshPatil-loki/aka ... IR_Recieve

Below are the raw codes obtained from the receiver module.
#define RAW_DATA_LEN 100
uint16_t rawDataOff[RAW_DATA_LEN]={
3310, 1878, 278, 1446, 326, 1406, 362, 474,
390, 478, 390, 434, 422, 1374, 278, 562,
306, 562, 390, 1362, 362, 1362, 350, 490,
394, 1362, 298, 542, 306, 558, 394, 1362,
362, 1362, 278, 558, 310, 1446, 326, 1414,
278, 558, 394, 430, 434, 1358, 366, 430,
370, 538, 390, 1362, 322, 522, 326, 538,
354, 514, 394, 474, 326, 542, 454, 306,
422, 558, 306, 562, 394, 474, 390, 474,
330, 538, 390, 438, 430, 438, 342, 562,
394, 430, 370, 542, 390, 482, 330, 538,
394, 434, 346, 562, 390, 442, 342, 562,
390, 434, 346, 1000};

#define RAW_DATA_LEN 100
uint16_t rawDataOn[RAW_DATA_LEN]={
3394, 1794, 362, 1362, 322, 1410, 362, 478,
390, 478, 394, 470, 458, 1310, 362, 474,
390, 478, 394, 1358, 322, 1402, 278, 562,
390, 1366, 298, 542, 390, 474, 394, 1362,
362, 1362, 362, 474, 394, 1358, 362, 1362,
362, 474, 394, 470, 458, 1310, 366, 470,
394, 474, 390, 1362, 302, 538, 306, 562,
394, 470, 394, 474, 394, 474, 394, 474,
394, 470, 394, 470, 330, 538, 394, 474,
306, 562, 354, 518, 330, 542, 394, 470,
306, 562, 462, 418, 414, 458, 394, 470,
334, 538, 394, 470, 394, 1362, 362, 470,
390, 474, 394, 1000};

I went through some previously answered questions by you and got another code to capture long signals from the remote. And the raw data obtained from them is as below:
Raw: (451) 3404, -1784, 416, -1308, 412, -1312, 412, -424, 376, -492, 360, -512, 352, -1400, 412, -424, 504, -368, 444, -1316, 372, -1352, 328, -512, 376, -1380, 412, -424, 376, -492, 444, -1316, 412, -1312, 324, -512, 444, -1312, 412, -1312, 412, -428, 376, -488, 380, -1376, 412, -424, 356, -508, 380, -1380, 412, -424, 404, -464, 444, -432, 356, -516, 356, -508, 356, -512, 428, -444, 376, -492, 440, -428, 356, -512, 440, -424, 440, -428, 404, -468, 508, -368, 356, -512, 356, -512, 444, -424, 440, -424, 376, -492, 440, -424, 440, -1312, 372, -468, 356, -508, 380, -488, 444, -424, 400, -468, 356, -1396, 412, -1312, 328, -508, 444, -424, 356, -512, 444, -424, 380, -1380, 408, -1316, 412, -424, 376, -492, 440, -424, 440, -424, 444, -420, 444, -424, 400, -1356, 412, -1312, 412, -424, 444, -1308, 348, -1376, 328, -512, 440, -424, 440, -424, 440, -428, 440, -1312, 412, -424, 404, -468, 440, -1312, 348, -1376, 412, -428, 440, -428, 440, -424, 356, -512, 444, -420, 380, -488, 444, -424, 356, -512, 356, -512, 376, -492, 356, -512, 356, -516, 436, -428, 356, -512, 356, -512, 440, -424, 440, -428, 376, -488, 444, -424, 440, -424, 440, -428, 380, -488, 376, -492, 440, -424, 356, -512, 356, -512, 444, -428, 440, -424, 356, -512, 440, -424, 444, -420, 444, -420, 444, -424, 352, -516, 356, -508, 444, -424, 440, -424, 356, -512, 376, -496, 440, -424, 404, -476, 352, -516, 440, -424, 356, -508, 356, -516, 380, -488, 376, -492, 440, -428, 440, -424, 440, -428, 440, -428, 356, -512, 376, -488, 404, -472, 440, -424, 356, -512, 436, -428, 436, -1288, 376, -492, 376, -1348, 376, -1348, 436, -436, 432, -1288, 404, -1320, 380, -1352, 400, -17080, 3568, -1736, 396, -1332, 396, -1352, 376, -468, 404, -464, 400, -464, 396, -1352, 376, -488, 380, -496, 376, -1348, 376, -1356, 376, -488, 376, -1348, 376, -492, 372, -492, 376, -1348, 372, -1348, 376, -496, 372, -1356, 368, -1356, 368, -500, 368, -496, 368, -1356, 368, -500, 364, -508, 368, -1356, 392, -476, 368, -500, 388, -480, 364, -500, 368, -500, 368, -504, 368, -500, 384, -484, 368, -496, 368, -524, 368, -500, 344, -524, 368, -504, 340, -524, 340, -524, 344, -520, 368, -500, 368, -500, 344, -528, 364, -500, 368, -1360, 340, -524, 340, -528, 344, -524, 344, -524, 344, -520, 340, -1384, 340, -1388, 340, -528, 320, -544, 320, -548, 316, -576, 292, -1432, 292, -1432, 292, -576, 316, -552, 288, -576, 288, -576, 288, -580, 312, -556, 288, -1432, 292, -1456, 264, -604, 264, -1460, 264, -1464, 264, -604, 264, -628, 216, -652, 240, -632, 212, -1540, 212, -652, 184, -684, 180, -1568, 180,
Raw: (583) 3404, -1784, 412, -1312, 372, -1352, 412, -424, 356, -512, 360, -508, 444, -1312, 328, -508, 500, -376, 356, -1396, 328, -1396, 416, -420, 356, -1400, 412, -424, 428, -440, 440, -1316, 412, -1312, 348, -492, 440, -1312, 404, -1328, 344, -492, 356, -512, 360, -1396, 372, -468, 440, -424, 404, -1356, 324, -512, 404, -468, 356, -516, 444, -424, 360, -508, 360, -508, 404, -468, 356, -512, 444, -424, 444, -424, 444, -420, 440, -428, 404, -468, 508, -368, 444, -424, 356, -512, 440, -424, 444, -424, 356, -512, 440, -424, 440, -428, 444, -424, 356, -508, 400, -468, 356, -516, 404, -468, 356, -1392, 412, -1312, 400, -444, 440, -428, 440, -424, 444, -428, 440, -1312, 328, -1396, 412, -424, 356, -512, 404, -464, 432, -440, 404, -476, 356, -512, 404, -1352, 480, -1252, 328, -520, 440, -1312, 412, -1316, 328, -512, 440, -424, 400, -468, 356, -508, 356, -1396, 328, -508, 444, -376, 424, -1376, 412, -1312, 412, -428, 440, -428, 356, -508, 444, -424, 432, -444, 376, -492, 440, -424, 440, -424, 440, -424, 356, -508, 380, -492, 444, -420, 356, -512, 440, -424, 368, -500, 360, -508, 440, -428, 484, -388, 468, -408, 440, -424, 404, -468, 440, -424, 440, -420, 444, -424, 372, -496, 404, -464, 356, -508, 428, -440, 440, -424, 356, -516, 440, -424, 440, -424, 440, -424, 444, -424, 376, -492, 444, -428, 404, -468, 440, -424, 404, -464, 444, -424, 356, -508, 376, -492, 440, -424, 376, -492, 360, -512, 440, -424, 504, -372, 444, -428, 440, -432, 440, -428, 440, -424, 356, -508, 440, -424, 404, -468, 440, -424, 356, -512, 440, -424, 440, -1284, 440, -428, 424, -1304, 440, -1284, 436, -428, 436, -428, 436, -1284, 436, -1288, 436, -17040, 3544, -1752, 432, -1296, 460, -1276, 400, -468, 408, -460, 376, -488, 400, -1332, 376, -484, 404, -464, 432, -1296, 404, -1324, 404, -464, 400, -1364, 408, -440, 400, -468, 400, -1348, 376, -1348, 380, -492, 376, -1344, 376, -1352, 384, -484, 376, -492, 376, -1348, 376, -488, 380, -488, 372, -1356, 376, -492, 396, -472, 376, -500, 376, -492, 376, -492, 376, -492, 376, -496, 372, -496, 372, -500, 368, -496, 368, -496, 368, -500, 396, -476, 372, -508, 368, -496, 392, -476, 368, -500, 368, -496, 368, -500, 368, -496, 368, -500, 368, -500, 368, -496, 392, -476, 368, -508, 392, -476, 368, -1352, 392, -1336, 392, -476, 364, -504, 392, -476, 392, -476, 368, -1360, 364, -1356, 368, -500, 368, -500, 368, -500, 364, -504, 392, -484, 392, -476, 368, -1380, 368, -1356, 368, -480, 372, -1372, 344, -1396, 344, -520, 344, -524, 344, -528, 340, -524, 368, -1360, 340, -528, 344, -520, 344, -1396, 340, -1376, 368, -504, 340, -524, 368, -500, 344, -524, 340, -528, 364, -504, 344, -524, 340, -524, 368, -500, 368, -504, 364, -504, 368, -500, 344, -524, 344, -520, 340, -524, 364, -504, 344, -524, 340, -528, 368, -500, 344, -520, 368, -504, 368, -508, 340, -524, 344, -524, 340, -524, 344, -520, 368, -500, 368, -500, 344, -524, 344, -520, 364, -504, 368, -500, 368, -504, 340, -524, 340, -524, 344, -520, 360, -512, 344, -524, 340, -528, 340, -524, 344, -524, 340, -528, 340, -524, 340, -524, 364, -508, 340, -524, 340, -528, 340, -520, 368, -504, 340, -524, 344, -524, 320, -552, 316, -548, 320, -544, 316, -548, 316, -548, 316, -552, 340, -1408, 292, -552, 316, -1432, 316, -1408, 320, -552, 316, -548, 320, -1404, 296, -1428, 316,
I tried giving the above raw data as input to invoke the ON and OFF command according to the temperature conditions. The AC still does not respond. What should I do now?


I'm not from the computer science or the electrical domain, so I'm unsure of the technicalities of this project.
Please help me out here.
Post Reply