Infrared I/O

Hello,
my first post!
I'm a total newb of electronics and Arduino, having only "academic" bases and some programming skills.

I'm currently sweating on a project to remotely control an electronic pellet stove.
Having failed to hook up directly to the electronics (fried my first board trying...) I want to simulate the stove remote controller.
I managed to decode the remote output using IRemote library, but I systematically fail to have any output out from my IR LED.

My hardware setup:
DFRobot UNO arduino compatible board (brand new)
Sensor shield
DFRobot IR emitter (maybe broken)
DFRobot IR receiver (tested: working)

Finally I decided to make a simple sketch to troubleshoot the emitter. I obviously put the two LEDs facing each other.
It looks like this:

void setup()
{
  Serial.begin(115200);
  pinMode(2, INPUT);
  pinMode(9, OUTPUT);
  digitalWrite(9, LOW);
  if (digitalRead (2) == HIGH) {
    Serial.println("high");
  }
  if (digitalRead (2) == LOW) {
    Serial.println("low");
  }
  delay(100);
  digitalWrite(9, HIGH);
  if (digitalRead (2) == HIGH) {
    Serial.println("high");
  }
  if (digitalRead (2) == LOW) {
    Serial.println("low");
  }
  delay(100);
  digitalWrite(9, LOW);
}

void loop()
{
}

The serial monitor output is

high
high

I also tried to change the OUTPUT pin to pin 3, but with the same effect.
Am I doing something wrong or is the emitter not functioning? Any idea how to easily troubleshoot it?

The easiest way to test the IR emitter is to run a blink program with the IR emitter and video record the LED. The video recorder (cameraphone) should be able to pick up the IR emitter when it turns on and off.

The code is a bit long winded for example:-

if (digitalRead (2) == HIGH) {
    Serial.println("high");
  }
  if (digitalRead (2) == LOW) {
    Serial.println("low");
  }

Can be written:-

if (digitalRead (2) == HIGH) {
    Serial.println("high");
  }
  else {
    Serial.println("low");
  }

or even shorter:-

if (digitalRead (2) == HIGH) Serial.println("high"); else Serial.println("low");

How have you wired up the emitter?
Does it need a resistor?
A link to the sensor would help.

I looked around DFRobot, but...
rischio has stated he's trying to reproduce this stove's IR codes (IRemote library). So, to me, that means that's part of the 38kHz carrier scheme, etc.
An IR receiver isn't going to respond/toggle simply for an IRED "shining" on it. The typical IR receiver output is High till it gets the 38kHz IR signal where it goes Low.

IRemote library is supposed to have routines for send as well as receive.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1251570417

You need to be sure you've understood the 38khz carrier thing.

There's the stuff you need for lots of what you talk about in...

(That's called "Reading what remote sends"... but talks about SENDING things, towards the end.)

Also: To see if your IR LED is sending ANYTHING, look at it with a webcam, a video camera, a non-SLR digital camera. Almost any one of these will "see" the IR. Just to test your tester... see what you see when you shine your TV's remote control at it.

ok, thanks a lot to all the inputs.

Just as an addition, the hardware I'm using is this:

the two boards should have all that it takes to send / receive 38kHz signals, even though there is no schematics and documentation. I have access to a lousy multimeter, I will try to see what I get out of it.

My fear is that the sender diod/board is dead...

cheers

the two boards should have all that it takes to send / receive 38kHz signals,

No while the receiver will receive 38KHz modulated signals the transmitter will not send 38KHz modulated signals without being driven by a 38KHz modulated signal, not a simple high / low.

Yes, this is clear. The above test will not work.
What I meant is that I should have all the needed hardware. I tried to send modulated signals with the IRemote lib with no success.
I'm sure that the receiver is working because it detects and decodes remote controller's signals, but I'm not sure that the transmitter is working.
My next steps will be to try to figure out the schematics of the mini board of the sensor and try to film it with my iPhone to see if I see any light out of the diod.
I will do it next week, since I'm really busy at the moment. If anyone as another simple way to tell if it is working please go ahead!

Thanks to everyone for the help and support.

Dear fellow Arduinians,
an update on my latest findings:
I have switched on the IR LED and filmed it with my iPhone: I do not see any light.

I have tried to figure out the small DFRobot board schematics and I found the following:

  • PIN3 (Ground) is connected to condenser (190uF) PIN A
  • PIN2 (5V+) is connected to IR LED PIN +, in parallel with condenser PIN B
  • PIN1 (Signal) is connected to resistor 471 (450 ohm) and in series with IR LED PIN -
    Any idea of how this should work?

Any further advice?

Thanks to everyone!

  • PIN3 (Ground) is connected to condenser (190uF) PIN A

There is no way that capacitor is 190uF, it is physically too small.

I would suggest connect pin2 to +5V and pin 1 to an arduino output.

Write a blinking LED sketch with the arduino pin you use and film the LED, if nothing happens then I would think the LED is broken, providing that your other information is correct.

Grumpy_Mike:
There is no way that capacitor is 190uF, it is physically too small.

maybe I mis-interpreted the multimeter reading. The scale is a bit criptic.

Grumpy_Mike:
I would suggest connect pin2 to +5V and pin 1 to an arduino output.

Write a blinking LED sketch with the arduino pin you use and film the LED, if nothing happens then I would think the LED is broken, providing that your other information is correct.

this is exactly what I did with no success. I will try to solder another LED from a spare remote and see what happens.
Thanks! :slight_smile:

Hello everyone!

New update. With the above mentioned circuit the LED is on when the Arduino PIN is LOW.
I see a faint glow with the iPhone camera.

Now I have to find out if the iRemote library can work with a circuit working in this way.

Thanks to all for the support.