Hi everyone, a few days ago I had nothing to do and so I came across a pretty interesting video on the remote lighting of LEDs. the remote control and then said that to make this circuit work you needed to have very important codes that were then used to turn on the LEDs, then I go to the second part of the video where it shows how to connect this sensor (shown in the image below, taken from the site this guy). So I did like him, pasted the same code and made the same connections or first pin of the sensor connected to 11 as mentioned in the code (see code), second pin to GND and third pin to 3V. serial monitor, I take the remote control, press a few test buttons but the sensor does not give me any signal. Today i retryed, but this time I aimed the infrared led at the remote control sensor and opened the serial montor,result=the signal receive and transmiss the signal decoded but if i push 3 different buttons/sometimes only 1 it appears about an hundred and more and more codes like
68EF51C8
68EF51C8
68EF51C8
68EF51C8
and don't know why,don't know if the sensor is working.Let me know whit a comment :/.
Post Scriptum:
Wiring:
first pin to digital 12 of arduino
Second to GND
the extreme pin (3) to vcc (3.3V)
* Original code by:
* http://arcfn.com door Ken Shirriff
*
*/
// Import the IR-remote library
#include <IRremote.h>
int IrReceiverPin = 12; // Turn the variable "IrReceiverPin" to pin 12
IRrecv irrecv(IrReceiverPin); // create a new instance of "irrecv" and save this instance in variabele "IRrecv"
decode_results results; // define the variable "results" to store the received button code
void setup()
{
Serial.begin(9600); // Initialise the serial monitor
pinMode(LED_BUILTIN, OUTPUT); // Initialise digitale pin LED_BUILTIN as output
// When the IR-remote library crashes we can see it from the shown text
Serial.println("Starting IR-receiver...");
irrecv.enableIRIn(); // start the IR-receiver
Serial.println("IR-receiver active");
digitalWrite(LED_BUILTIN, LOW); // Turn off the builtin LED
}
void loop() {
// When the IR-receiver receives a signal
if (irrecv.decode(&results)) {
// Print the received value as a hexadecimal value
Serial.println(results.value, HEX);
// Resume the IR-receiver to listen for new signals
irrecv.resume();
// Determine which button has been pressed
switch (results.value) {
case 0xFF42BD: // button *
digitalWrite(LED_BUILTIN, HIGH); // Turn LED on
break;
case 0xFF52AD: // button #
digitalWrite(LED_BUILTIN, LOW); // Turn LED off
break;
}
}
delay(100); // pause 100ms
}
Imgur: The magic of the Internet <----wiring image.