View previous topic :: View next topic |
Author |
Message |
csete
Joined: 09 Jun 2005 Posts: 131
|
Posted: Mon Jan 20, 2014 4:12 pm Post subject: Raspberry PI IR Blaster troubleshooting |
|
|
I could really use help from the local experts and I wasn't sure where to turn. As a long time JP1 user, I know that the experts in these forums know all there is to know about IR remote controls.
I'm in the midst of trying to build an IR Blaster around a Raspberry PI. There are a lot of different references on the net related to this kind of project and they all make it sound very easy. However, I can't get my current circuit to control the TV. Based on a variety of schematics on the web, I've built out the following circuit:
I can see the LED's light using my camera and I can see them pulse the same way. If I use my Streamzap receiver along with IRScrutinizer, I'm getting the same (NEC1) codes from the IR blaster as I get from the original remote control. I'm testing from about 10 feet away from the TV and it seems like it may be related to LED brightness. However, the circuit appears to have the proper series resistance to match the forward voltage and current for the LED's.
Any pointers would be most appreciated as this is really starting to drive me a bit crazy.
Thanks,
Craig |
|
Back to top |
|
|
3FG Expert
Joined: 19 May 2009 Posts: 3371
|
Posted: Mon Jan 20, 2014 11:55 pm Post subject: |
|
|
Are you for sure modulating the IR output at 38KHz? With about 30% on time in each modulaton period? Is the receiver expecting 940nm, or a shorter wavelength?
I think the RS LEDs have forward voltage of 1.28V , and two of them in series will use up a little more than 2.5 volts, leaving 2.5 volts across the 30ohms. That corresponds to perhaps 80mA, which should be enough if the modulation frequency and wavelength are correct. |
|
Back to top |
|
|
Barf Expert
Joined: 24 Oct 2008 Posts: 1417 Location: Munich, Germany |
Posted: Tue Jan 21, 2014 6:39 am Post subject: |
|
|
27k for the base resistor appears much too much. Assuming 3 V on the pin23 and a hFE of 100 of the transistor gives a collector current of 100*(3 - 0.6)/27000 = 0.009 Amperes << 80mA that we would have had (3FG's computation) the transistor was really acting like a switching transistor. Decrease the base resistor (say, 1k), or better use a MOSFET like 2N27000, in which case you can just leave out the resistor.
Quote: | If I use my Streamzap receiver along with IRScrutinizer, |
With the LIRC mode2 interface? Nice! I was wondering if anyone would ever understand it! (I am the author of IrScrutinizer). |
|
Back to top |
|
|
csete
Joined: 09 Jun 2005 Posts: 131
|
Posted: Tue Jan 21, 2014 7:25 am Post subject: |
|
|
Thanks for your response. I really wondered about that resistor value. I can't remember where I came across that value either. Unfortunately, I haven't done enough electronics in the past decade to remember any of what I used to know. I guess it is time to relearn.
In terms of IrScrutinizer it worked perfectly after I realized that I needed to start it with "sudo" to get access to /dev/lirc0. It is a great program. I've seen a few bugs pop up that I've considered trying to send you fixes for, but haven't had a chance to track them down and fix them.
Thanks again,
Craig |
|
Back to top |
|
|
csete
Joined: 09 Jun 2005 Posts: 131
|
Posted: Tue Jan 21, 2014 8:08 am Post subject: |
|
|
Barf wrote: | 27k for the base resistor appears much too much. Assuming 3 V on the pin23 and a hFE of 100 of the transistor gives a collector current of 100*(3 - 0.6)/27000 = 0.009 Amperes << 80mA that we would have had (3FG's computation) the transistor was really acting like a switching transistor. Decrease the base resistor (say, 1k), or better use a MOSFET like 2N27000, in which case you can just leave out the resistor. |
Barf,
I just tried switching in a 1K resistor, but I'm seeing the same behavior. I don't have any MOSFET transistors. I'm not sure why this should be this hard. It seems like the circuits I've seen others using are very simple.
Any other thoughts? |
|
Back to top |
|
|
Barf Expert
Joined: 24 Oct 2008 Posts: 1417 Location: Munich, Germany |
Posted: Tue Jan 21, 2014 9:39 am Post subject: |
|
|
Well, then nothing more than "systematic debugging". Having a normal (visible-light) LED in parallel with the IR-leds can be a good idea, just make sure that it has its own resistor.
My understanding of LIRC is that it cannot do NEC1-.type repeats correctly -- by design.
Quote: | I've seen a few bugs pop up that I've considered trying to send you fixes for, but haven't had a chance to track them down and fix them. | Next version is due the next few days; you may want to wait for that. |
|
Back to top |
|
|
csete
Joined: 09 Jun 2005 Posts: 131
|
Posted: Tue Jan 21, 2014 1:31 pm Post subject: |
|
|
Barf wrote: | Well, then nothing more than "systematic debugging". Having a normal (visible-light) LED in parallel with the IR-leds can be a good idea, just make sure that it has its own resistor. |
Thanks. I will keep trying. Given that the Streamzap and IRScrutinizer are able to decode the resulting output from the LED's I'm assuming it must somehow be an issue of range. I'm just not sure how to coax more range out of these LED's. I had hoped that using two of them would give me what I need. Do you have any idea how to measure the output from a transmitter? I'd love to be able to compare the output of my LED's to the output from my (working) Dish Network remote.
I guess at this point, I need to figure out where the receiver is at on the TV and put the transmitter right against it to validate that for sure it is a range issue. If it is a range issue, I would at least know where to focus my attention.
Thanks again,
Craig |
|
Back to top |
|
|
csete
Joined: 09 Jun 2005 Posts: 131
|
Posted: Fri Jan 24, 2014 10:50 am Post subject: |
|
|
Barf,
I tested last night with my IR blaster very close to the TV and it still isn't working for me. So, it doesn't appear to be a range issue. Can you think of anything else that would cause the TV to not respond to my IR commands, but that the StreamZap and IRScrutinizer would see it OK?
Thanks for any other insights.
Craig |
|
Back to top |
|
|
Barf Expert
Joined: 24 Oct 2008 Posts: 1417 Location: Munich, Germany |
Posted: Fri Jan 24, 2014 1:46 pm Post subject: |
|
|
Hmm, then it is likely that the codes are somehow wrong. I cannot recall that you have claimed to control anything else, and you have also never told us about "the TV" or the codes you believe will control it. So it is hard to give any hard advice.
One possibility is to get codes at this site or remotecentral, or database, and try them. You can use IrScrutinizer generate lirc files, or you can apply this lirc-patch, so you can send the codes directly to the LIRC server.
So start by telling us brand of TV/Remote, and if you have any other gadgets to "play" with, and upload the captures. |
|
Back to top |
|
|
csete
Joined: 09 Jun 2005 Posts: 131
|
Posted: Fri Jan 24, 2014 1:54 pm Post subject: |
|
|
I'm sorry if I've been too mysterious
The TV is an LG 42LH30. What exactly can I capture/send that would help?
Thanks again,
Craig |
|
Back to top |
|
|
Barf Expert
Joined: 24 Oct 2008 Posts: 1417 Location: Munich, Germany |
Posted: Fri Jan 24, 2014 2:40 pm Post subject: |
|
|
There is a large number of config files for LG TVs, although no-one appears exactly 42LH30. However, almost all appears to be NEC1, device=4, so chances are your device will too. There is a LG master list on this site.
To use with IrScrutinizer, there are tons of different possibilities. For example:
In Import->RemoteMaster, enter http://www.hifi-remote.com/forums/dload.php?action=download&file_id=6325 in the File/URL text field (do no forget the "http://" so that is a valid URL. Press Load File/URL. Press Import all. Go to "Scrutinize remote -> parametric remote" for example by pressing "OK" from previous step. These commands can now be e.g. exported to LIRC format, or sent individually to a (patched, as per above) LIRC server. |
|
Back to top |
|
|
csete
Joined: 09 Jun 2005 Posts: 131
|
Posted: Sun Jan 26, 2014 5:24 pm Post subject: |
|
|
This RMIR file is what I was using to control my gear until recently (http://www.setera.org/ir/20130310_familyroomnew.rmir). That file should have my other gear listed in it, with the exception of a Dish Network Hopper With Sling DVR. If there is a good LIRC file for any of the gear in that remote definition that I should be trying, I'd be willing.
The LIRC file I've been using is at http://www.setera.org/ir/lircd.conf. I was testing "raw" codes recorded via irrecord as well as a "NEC1" protocol in that same file. My coded remote was modeled on another LG LIRC file I found with additional discrete codes I picked up. (In the end, that is my primary goal is to drive the discrete codes via Raspberry PI).
I continue to be confused with why IRScrutinizer seems to be happy recognizing my PI with the correct codes, but my TV won't. Is is possible that minor differences in the waveform will cause problems with my TV, but not StreamZap/IRScrutinizer?
Thanks again for any insights
Craig[/url] |
|
Back to top |
|
|
Barf Expert
Joined: 24 Oct 2008 Posts: 1417 Location: Munich, Germany |
Posted: Mon Jan 27, 2014 1:29 pm Post subject: |
|
|
The linked files all decode to NEC1 D=4. So you have the right signal.
There have been some discussion on the LIRC mailing list recently on problems on imprecise timing of generated signals. See also http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=62063&p=465102#p465102. For example the RPi driver is based on the "serial driver". It does not appear to be that carefully tested for timing precision etc. For example, the RPi supports hardware PWM on at least some pins, but the driver does not take advantage of this.
Quote: | Is is possible that minor differences in the waveform will cause problems with my TV, but not StreamZap/IRScrutinizer? |
I would rather say "timing" than "waveform", but that appears as the most plausible theory right now.
One more thing: As I understand it, by design, LIRC cannot send the correct NEC1 repeat (so-called "ditto") correctly. But I doubt that this is the problem.
Sorry. |
|
Back to top |
|
|
csete
Joined: 09 Jun 2005 Posts: 131
|
Posted: Mon Jan 27, 2014 1:48 pm Post subject: |
|
|
Well, that's an incredible bummer. I don't suppose you are planning to build a new LIRC driver that will work better? |
|
Back to top |
|
|
Barf Expert
Joined: 24 Oct 2008 Posts: 1417 Location: Munich, Germany |
Posted: Mon Jan 27, 2014 2:19 pm Post subject: |
|
|
Writing a RPi LIRC driver that utilizes hardware-PWM is on my TODO-list since around a year,,,
But getting IrScrutinizer 1.0.0 out, including a lot of supporting stuff and documentation, is my absolute priority right now... |
|
Back to top |
|
|
|