Hello, i am trying to turn on my fan using IR signals, however, have failed to do so. Im new to the arduino, electronics and programming so a simple explanation would be really grateful.
I am using the IRremote library.
I'm using a very cheap IR reciever I have found on ebay "TSOP1738 VISHAY DIP-3 Sensor" and an IR led with an arduino mega.
I'm using the example codes in the library - IRrecvDumpV2 and IRsendRawDemo to recieve and send IR signals.
After experimenting using the IRremote library, I've been receiving fairly consistent raw data values. when i send a signal using my fan's remote control. Often not, i get values that are off by 50. Below are values I've recieved when i press the on button on my fan.
Encoding : UNKNOWN
Code : 143226DB (32 bits)
Timing[23]:
+1300, - 400 +1250, - 400 + 450, -1250 +1250, - 400
+1300, - 350 + 500, -1150 + 500, -1200 + 450, -1200
+ 500, -1200 + 450, -1250 +1250, - 400 + 450
unsigned int rawData[23] = {1300,400, 1250,400, 450,1250, 1250,400, 1300,350, 500,1150, 500,1200, 450,1200, 500,1200, 450,1250, 1250,400, 450}; // UNKNOWN 143226DB
Encoding : UNKNOWN
Code : 143226DB (32 bits)
Timing[23]:
+1300, - 400 +1300, - 350 + 450, -1250 +1250, - 400
+1300, - 400 + 450, -1200 + 450, -1200 + 450, -1250
+ 450, -1200 + 450, -1200 +1300, - 400 + 450
unsigned int rawData[23] = {1300,400, 1300,350, 450,1250, 1250,400, 1300,400, 450,1200, 450,1200, 450,1250, 450,1200, 450,1200, 1300,400, 450}; // UNKNOWN 143226DB
Encoding : UNKNOWN
Code : 143226DB (32 bits)
Timing[23]:
+1300, - 400 +1300, - 400 + 450, -1200 +1300, - 350
+1300, - 400 + 450, -1200 + 450, -1250 + 450, -1200
+ 450, -1250 + 450, -1200 +1300, - 350 + 450
unsigned int rawData[23] = {1300,400, 1300,400, 450,1200, 1300,350, 1300,400, 450,1200, 450,1250, 450,1200, 450,1250, 450,1200, 1300,350, 450}; // UNKNOWN 143226DB
if you compare the raw data, they are different to each other. Is this a problem?
I know for a fact that the buffer size should not be a problem since the raw data array is only 23 in length.
Anyways, I pick one of them and replace the array shown in IRsendRawDemo using my arduino uno.
I have the IR led connected to my arduino uno in series with a 330 ohm resistor. I am using pins 3 and ground. To ensure the LED is working correctly, I use a camera to detect Infrared. I am pointing the LED towards the fan at a close range but nothing happens...
I make sure to wait 5 seconds as it takes 5 seconds for a pulse to occur but nothing still happens. I try shortening the 5 seconds but nothing still happens.(with the example code).
I thought then occured to me. Using my camera, i notice the intensity of the IR LED from my arduino is extremely dim compared to the intensity of the IR LED from the remote control. I remove the resistor and try again, yet my fan dosen't turn on. I make sure the LED didnt pop or shortcircuit by using my camera to see if there is light. There is still light but the fan dosen't turn on so i am confused on what to do next..
Why can't i get my fan to work using my arduino.