yonubear
Posts: 90
Joined: Thu Sep 12, 2013 11:11 pm

IR emitters

Fri Jan 10, 2014 8:43 pm

ok I was not sure where to put this so I figured I would post it in off topic I am looking at driving 6 IR LEDs using LIRC to turn several video screens on and off. and I already have IR emitters affixed to the screens so what I need to know so I don't blow anything is do they connect to the Pi GPIO the same way as a loose LED?


Thanks,
Yonu

drgeoff
Posts: 10643
Joined: Wed Jan 25, 2012 6:39 pm

Re: IR emitters

Sat Jan 11, 2014 10:49 am

I'm a bit confused, especially when you say you have emitters attached to the screens. Don't you want IR receivers attached to the screens?

If you want to drive IR emitters from RPi GPIO pins then yes, you wire them in the same way as visible LEDs. However, depending on the range you need to achieve you may require relatively high currents through the emitters and an extra transistor and resistor(s) between the RPi and the IR emitter may be advisable.

If you want to attach an IR receiver to a RPi GPIO pin, then the 3-legged type sensor can be connected directly.

mba
Posts: 110
Joined: Fri Jun 08, 2012 7:05 pm
Location: Denmark

Re: IR emitters

Sat Jan 11, 2014 1:21 pm

Hi Yonu,

You need a driver to supply the IR leds with enough current and to prevent straining your GPIO pins ultimately frying your Pi. I have put a schematic for a very simple scalable driver on my website here http://www.datscharf.dk/amote/hardware/diy-transmitter/. Just increase the supply voltage when adding extras IR leds. I have made a PCB with six IR leds and am supplying it with 9V. This works perfect and emits enough light that I can turn on all my equipment across the room without fixing the emitters to the IR receivers of the devices like you have done.

Best regards
Martin
AMOTE - a LIRC client for Android. Build your own Android-based universal remote.

yonubear
Posts: 90
Joined: Thu Sep 12, 2013 11:11 pm

Re: IR emitters

Sat Jan 11, 2014 3:48 pm

Thanks I will have a look.
The emitters were already in place I from the ok AMX system that dyed a while back so I figure I may as well use them.

yonubear
Posts: 90
Joined: Thu Sep 12, 2013 11:11 pm

Re: IR emitters

Fri Jan 17, 2014 3:49 pm

does anyone know if it is possible to setup LIRC on the Pi to that you can have multiple emitters with separate codes so that you don't have to send all the codes to every device?

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: IR emitters

Fri Jan 17, 2014 4:34 pm

The irsend command has a "SET_TRANSMITTERS" directive so it should be possible. I'm not sure how you go about setting them up though.

I went for one of these: http://iguanaworks.net/products/usb-ir-transceiver/ which is supposed to have multiple transmitters - not tried it yet as I've no need for the separation.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

yonubear
Posts: 90
Joined: Thu Sep 12, 2013 11:11 pm

Re: IR emitters

Mon Jan 27, 2014 12:09 am

hey question on the IR emitters can I pull the power from the 5v GPIO pin to run through the resister I plan to be limiting the current to each LED down to around 10ma as the spec sheet on the stick on emitters says 10ma. so I was trying to figure if I could safely pull the power from the 5v pin or do I need to split the incoming power from the ac adapter.

Thanks,
Yonu

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5587
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: IR emitters

Mon Jan 27, 2014 8:48 am

yonubear wrote:hey question on the IR emitters can I pull the power from the 5v GPIO pin to run through the resister I plan to be limiting the current to each LED down to around 10ma as the spec sheet on the stick on emitters says 10ma. so I was trying to figure if I could safely pull the power from the 5v pin or do I need to split the incoming power from the ac adapter.
Thanks,
Yonu
The 5V GPIO pin draws current through the Pi's main polyfuse from the PI's supply. So long as you don't have other USB or GPIO connected devices that make the total current potentially trip the polyfuse (ie. much >750mA) then an extra 60mA should be fine. (One of my GPIO test circuits drives an 8 x 8 array of LEDS drawing a similar total current, but on a model A Pi)
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

yonubear
Posts: 90
Joined: Thu Sep 12, 2013 11:11 pm

Re: IR emitters

Mon Jan 27, 2014 11:03 pm

Thanks I need to ask a odd question I found this LED driver Diagram http://1.bp.blogspot.com/-DuyRAT_xH5Y/U ... ansmit.png

but I suck at dealing with transistors can I omit the base resistor or if not with this diagram how can I omit the base resistor the main reason is I am trying to make the PCb as small as possible and I am wiring 8 ir leds on 8 separate channels.

thanks,
yonu

User avatar
Burngate
Posts: 6285
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: IR emitters

Tue Jan 28, 2014 10:40 am

yonubear wrote:... can I omit the base resistor or if not with this diagram how can I omit the base resistor the main reason is I am trying to make the PCb as small as possible and I am wiring 8 ir leds on 8 separate channels
If the resistor wasn't necessary the designer wouldn't have put it in.

The base-emitter junction is a diode, and tries to keep its voltage around 0.6v
The GPIO tries to keep its output at 3.3v
They can't both win, and the loser's going to break

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: IR emitters

Tue Jan 28, 2014 10:55 am

yonubear wrote:...but I suck at dealing with transistors can I omit the base resistor or if not with this diagram how can I omit the base resistor the main reason is I am trying to make the PCb as small as possible and I am wiring 8 ir leds on 8 separate channels.
If space is a premium go surface mount and change to either
  1. Logic FETs like FDV303N
  2. Using a buffer like 74AHC245 in SO package, which can cope with 8 LEDs driven like that as long as each LED is under 20mA drive current
Also use surface mount LEDs in 0805 or 0603 packages
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

yonubear
Posts: 90
Joined: Thu Sep 12, 2013 11:11 pm

Re: IR emitters

Tue Jan 28, 2014 4:13 pm

ok thanks guess I will try to work in a batch of 1k resistors

yonubear
Posts: 90
Joined: Thu Sep 12, 2013 11:11 pm

Re: IR emitters

Wed Jan 29, 2014 10:19 pm

ok dumb question here I got it done however I am assuming I used to high of a resister on the base I used 1k 5%(what I had on hand) resister on the base which is fed to the GPIO pin and on the collector pin I used a 220ohm resister and I am unable to get any reaction from a led I am using a regular red Led for testing so that I have a visual check
oh and for a side note the size of the LEDs i use is irreverent for the size of my board as I am using external stick on emiters.

Thanks,
yonubear

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: IR emitters

Thu Jan 30, 2014 12:02 am

yonubear wrote:ok dumb question here I got it done however I am assuming I used to high of a resister on the base I used 1k 5%(what I had on hand) resister on the base which is fed to the GPIO pin and on the collector pin I used a 220ohm resister and I am unable to get any reaction from a led I am using a regular red Led for testing so that I have a visual check
oh and for a side note the size of the LEDs i use is irreverent for the size of my board as I am using external stick on emiters.

Thanks,
yonubear
Without knowing the transistor used and wired up correctly and exactly what the circuit you have made difficult to say.

Assuming you are powering the LED from 3V3 and the RED LED has approx 2V voltage drop that leaves 1V3 across the resistor, which means 1V3 / 220R = 0.0059 mA approx 6mA which depending on LED will be visible but dim. Depending on the LED how dim is a relative observation.

If powering the LED fropm 5V (a better option as more current available there) same calculation gives 3V across resistor meaning 3V / 220 R = 0.0136 mA. Approx 14mA nearly 3 times brighter.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

yonubear
Posts: 90
Joined: Thu Sep 12, 2013 11:11 pm

Re: IR emitters

Thu Jan 30, 2014 12:23 am

ok lets see if I can write this up so it makes sense

here is what I have I have a 5v source to drive the led feeding through a 220ohm resistor network IC connected to the collector port on the 2n3904 transistor the emitter leg is tied to ground and the base is connected to a 1k resister on the 3.3v GPIO pin.

Here is the diagram i used the only difference is I have 8 of them on the board and i am pulling the collector from 5v http://1.bp.blogspot.com/-DuyRAT_xH5Y/U ... ansmit.png

Thanks,
Yonu

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: IR emitters

Thu Jan 30, 2014 12:40 am

I would expect with 3V3 through 1k resistor to base for LED to be permanently on and LED powered from 5V to be visible.

It sounds like either a wiring mistake (like LED reversed or wrong pins on transistor) or blown resistor pack.

What voltages are you getting at all transistor pins when measured to a GND on the Pi?
Check your voltages and with power off the impedances where possible, check with meter on resistance you can light the LED one way and not the other.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

yonubear
Posts: 90
Joined: Thu Sep 12, 2013 11:11 pm

Re: IR emitters

Thu Jan 30, 2014 1:25 am

ok since our power is out now I did what I could by oil lamp which is check the resistors they are all good as best I can tell all the transistor connectors are right I will check the voltages tomorrow when I startup the generator to run the freezer.

thanks,
yonubear

P.S. I love cellphone internet :) and hate winter weather

yonubear
Posts: 90
Joined: Thu Sep 12, 2013 11:11 pm

Re: IR emitters

Fri Jan 31, 2014 1:40 am

well power came back on and I found my issue I had not soldered the collector pin on the transistor so now that I feel totally stupid I just have to figure out why I get no reaction from the led when it comes on fine if I manually turn on the gpio pin.

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: IR emitters

Fri Jan 31, 2014 11:15 am

yonubear wrote:well power came back on and I found my issue I had not soldered the collector pin on the transistor so now that I feel totally stupid I just have to figure out why I get no reaction from the led when it comes on fine if I manually turn on the gpio pin.
Those sorts of things happen to us all, when you have done many thousands of solder joints you still miss a few. Amount of times I have gone over a board to find a missing or bad joint is more than I would like to say ;)

I would suggest you explain more about what you mean by "no reaction" as we don't have your setup in front of us.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

yonubear
Posts: 90
Joined: Thu Sep 12, 2013 11:11 pm

Re: IR emitters

Fri Jan 31, 2014 4:31 pm

Ok by no reaction I mean that if I use webpio and turn on the pin the red led I am using for testing comes on. If I use irsend and tell it to say send power I get no blink/from the led.

Thanks,
Yonu

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: IR emitters

Fri Jan 31, 2014 5:27 pm

Sounds like configuration of irsend to use the correct GPIO pin not familiar with irsend myself
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5587
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: IR emitters

Fri Jan 31, 2014 7:09 pm

techpaul wrote:Sounds like configuration of irsend to use the correct GPIO pin not familiar with irsend myself
Likewise. I've only tinkered with the "receiver side" of LIRC, but I was using a different GPIO input to that of the original blog.
That (input) was changed via the lirc_rpi module's loading parameters:

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

snd-bcm2835
i2c-dev
lirc_dev
lirc_rpi gpio_in_pin=23 gpio_out_pin=24
I'm guessing that changing gpio_out_pin=24 to something else will "re-direct" irsend.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

yonubear
Posts: 90
Joined: Thu Sep 12, 2013 11:11 pm

Re: IR emitters

Fri Jan 31, 2014 10:03 pm

ok I checked my code as best I can tell I have it configured correctly here is I what I have in modules based on the GPIO diagram I have the led I am testing with on GPIO17

lirc_dev
lirc_rpi gpio_in_pin=23 gpio_out_pin=17

Yonu

Return to “Off topic discussion”