Getting the most from an LED

Resistance is futile

Yep, probably need a 1/2 watt or at least a quarter watt resistor (LED only takes 210 mW, which was calculated above).

Standard values for 10% resistors are multiples of 10 12 15 18 22 27 33 39 47 56 68 & 82 .

Not sure what you meant by the "collector gets the PWM signal at 50%" but all that is needed is the serial signal driving the base of the transistor. Might need an inverter somewhere, as adding the NPN transistor inverts the serial signal. Maybe : serial signal feeds a PNP, which drives the base of the NPN which drives the LED. The PNP inverts the signal, which is re-inverted by the NPN to go out as it was fed in.Or just NPN to NPN if that is what is in your component box.

Wrong Wrong Wrongety Wrong!

I am not an electronics expert. Analog or otherwise. I have no idea how to bias a transistor. I just learn about this stuff on websites (mostly this one). I realized the misconception is common when I saw the poster make the same mistake as I made only a few days ago.

Thevenin Who? Black boxes? Predicting their behaviour? Wow. Don’t let Frits get wind of this!

wait wait…i don’t get why

wait wait…i don’t get why a quarter resistor is ok…isn’t the power passing through the resistor 0.73 W(as i wrote before)? How come a 1/4 W is ok then?

Sorry for my ignorance :frowning: but i still don’t get what you mean by 10% resistors and their values (unofrtunately i don’t study these things at school). The only thing i can think of is… tolerance (if that is how you call it)

Messed up estimates

Yep, I was thinking of the LED power, not the resistor power dissipation. Both pass the same current, but not the same watts, so a 1 watt resistor would be best. THe only reason a half watt meight be ok, is that you are only passing that current part of the time, and estimating a data stream to be half 0s and half ones would give you an estimated half the power dissipated. But being safe would spec a 1 watt there.

Here is a web page listing what resistors are available according to what toerance they are :

http://www.elexp.com/t_eia.htm

You can see from it that 10% tolerance resistors only are mannufactured in certain values, 5% in more values, 15 even more. So if you want a cheaper resistor (10%) you have to get one close to the value calculated.

Vf
You know I didn’t even realise forward voltage was a voltage drop. I often wondered why LED resistor values were so high (compared to what I expected tehm to be)!!

thanks for the schematic,
thanks for the schematic, really helpful. One thing: where did you get the "in every 500mS period" from? That could be a problem for me, and not only for me i guess, since you sometimes need to send something like 3 or 4 signals per second.

Huh?
Huh?

Periodic updates
The Absolute Maximums section of your datasheet has in Peak Forward Current parameter has some conditions. It shows tp/T = 0.5, which refers to a duty cycle of 50%, on half the time, off half the time. It also gives tp of being 100 us, which means the T would be 200 us for a frequency of 5000 Hz. I was making an estimate that half your bits in a serial data stream would be on, and half off to allow you to drive at the 200 mA level. I finally went back and read your IR-serial tutorial, and realized you are modulating the LEDs with PWM so that the recievers would respond to them. So as long as you have a PWM signal above 5000 Hz (which you are probably running around 40 kHz or so) you should be fine driving the LEDs close to the 200 mA rating.

one thing: instead of using
one thing: instead of using two transistors (PNP & NPN), what about using one NPN like in OddBot’s schematic and use True signals (which means using “T” instead of “N” in the serout command)?

Sounds possible
Give it a shot, just whatever gets you good solid comms.

"lots of really smelly

"lots of really smelly Zauberhafte Rauch)."

:stuck_out_tongue:

/Nick

I think we’re safe from artistic rants now.

Wind blew over his head.

2008_fundraiser_micro_button-en.png

first attempt was a failure.

first attempt was a failure. I followed oddbot’s schematic except for a 10k resistor instead of a 1k and the PWM pin connected instead of the v+ (to the collector). The led flashes but the receiver reads “0”…don’t really know why. According to my calculations it should have received the “opposite” (aka inverted value) of 100 (which is the value i was trying to transmit), like it happened with my previous setup when i exchanged the anode and cathode (pwm to cathode and serout to anode with inverted signal).

(but still, if i am going to use it that way, i don’t think i’ll gain much more power)

One thing: what happens if i setup two NPNs (in order to “connect” pwm signal and serout signal and send them both in the base of the primary transistor)? i mean…the current will be very high, won’t i risk destroying something? Sya the outputs offer 20mA, do i have to stay under that current?

 

but wait, i don’t get one

but wait, i don’t get one thing: if i use a transistor and its hFe (which should be Ic/Ib where Ic is current passing thorugh the collector and Ib current reaching the base) is, say, 100, and i have an output pin that gives out 20mA, what is going to happen?

In other words, these are the things i don’t know about:

- current of the output pin: what is it? is it the max amount of current it can give out?

- when a current of 1mA reaches the base of the transistor (hFe=100) does it mean that 100mA CAN pass through collector-emitter or WILL pass through collector-emitter?

Ohms Law
Yes, it is possible for a 1 mA base current to turn into 100 mA of collector current if the collector resistor is the right size to allow 100 mA. Starting at the voltage source of 5 volts. There is a voltage drop across the CE junction of transistor. maybe 0.3 at 100 mA or so, on up to 1 volt at 500 mA or more. Depends on the spec sheet of the transistor. hFe is a highly variable quantity across the range of currents possible and should only be used to note possible performance… The resistor limits the amount of current delivered.

It works! The problem i had

It works! The problem i had was related to…well…misreading of the datasheet, i thought the collector was on pin 2 whereas it was on pin 1…

Anyways, i’ve used the schematic of the AND gate with transistor and placed my resistor and IR led on its output (on the output of the AND gate) and it works. As for the coding I used T (true) reception on the receiver and it works (notice that i kept N on the sender).

how cool :slight_smile:

Don’t forget the voltage

Don’t forget the voltage drop across the led (most diodes have a drop of 0.7V but I’m not sure about LED’s) So I think it would actually be R = (1.35V-Vdiode)/0.1A.

 

Gabe

Way cool!
Glad you got it working, pretty cool idea of what it’s going into.

i’ve found this schematic.

i’ve found this schematic. It was taken from lasertagparts.com, and wants to do a similar thing, well, actually it is exactly the same, as we are trying to do.

here it is:

question is: why is he using Power Mosfets, or well, let's say field-effect transistors in general, instead of standar bipolar transistors like i am using? Is there something to gain?

FETs and BJTs
The FETs generally will have less of a voltage loss across them than the BJTs will. And will carry more current if that is needed. BJTs have a standard "diode drop" across them typically being 0.3 to 0.8 volts when fully on. Just like calculating the current across a diode, to size a current limiting resistor, the transistor CE junction can be considered too. Note Darlington trnaistors will have 2 "diode drops" across their output. With FETs, the Rds-on value is figured as a resistor when the FET is turned on, so current times the Rds-on would give the voltage lost in a FET.