IR Sensor not working properly

Hello everyone,
I am trying to figure out an issue with my IR sensor. It is not working with the most basic circuit, which involves an Arduino Uno, the IR sensor and a battery pack. These are my connections:
Sensor VCC => Arduino 5v
6xAA battery pack positive => Vin
6xAA battery pack negative => GND
Sensor GND => GND
Sensor signal pin => 7

I believe my IR sensor is supposed to have a flashing red LED, but it isn't flashing, it is just a solid red. I made a functional IR transmitter. I also used multiple different sensors for this issue as I thought it was a hardware issue. I also ensured that the VCC pin of the sensor is getting 5v. However, the signal pin is getting 2-3v. Does anyone know what the problem could be? Thank you!

  • Give us a Link to the sensor.
1 Like

Here is the link to my IR sensor: DKARDU Digital 38khz Ir Receiver Sensor Module + 38khz Ir Transmitter Sensor Module with Dupont Cable for Arduino Electronic Building Block,5 Pieces of Each : Amazon.ca: Electronics

  • In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch. Use the < CODE / > icon from the ‘posting menu’ to attach the copied sketch.

  • The IR TX LED needs to be modulated at 38kHz

You can change the PWM frequency and so modulate the light from the Arduino PWM pin.

Do a net search for this, but this is one I found after a short search.

When it is flashing at 38KHz it will look solid due to you persistence of vision. There two ways "see" the flashing:-

  1. Use an oscilloscope to look at the LED signal.
  2. Rapidly move the Arduino from side to side in front of your face.
    If you see a blur of lights it is not flashing.
    If you see individual spots for the LEDs it is flashing.
const int IR_RECEIVER_PIN = 7;  // Digital pin

void setup() {
  Serial.begin(9600);
  pinMode(IR_RECEIVER_PIN, INPUT);
}

void loop() {
  int sensorValue = digitalRead(IR_RECEIVER_PIN);  // Read digital signal
  Serial.print("IR Sensor Value: ");
  Serial.println(sensorValue);
  delay(500);
}

  • How is the TX LED wired and driven ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.