Arduino Forum

Using Arduino => General Electronics => Topic started by: funkyguy4000 on Jun 16, 2012, 09:51 pm

Title: Placement of resistors.
Post by: funkyguy4000 on Jun 16, 2012, 09:51 pm
Hello, So I have this image

(http://ledcalc.com/g.php?code=3e06d96c8a741dc9bb40376443980c19&k=2&r=16&l=1&y=null)

The supply voltage is 3.8v, the led forward voltage is 3.3v, the current is 20mA each and each resistor shown is 27 ohms.
Would I be able to put a resistor before any of the branches?  Like immedietly after the battery so that it would properly limit the current for each led afterwards so I don't need a billion resistors?

Would it be the same value?  (My brain and everything says yes)
Title: Re: Placement of resistors.
Post by: majenko on Jun 16, 2012, 09:53 pm
No, you cannot do that.

Every branch needs its own resistor.  Otherwise, slight differences in the Vf of the LEDs will result in differences in brightness, and some LEDs not lighting up at all.
Title: Re: Placement of resistors.
Post by: Docedison on Jun 16, 2012, 10:51 pm
Also that each additional led added will dim all the others too, that's why the resistors all million of them are there...

Doc
Title: Re: Placement of resistors.
Post by: dkl65 on Jun 16, 2012, 11:59 pm
I always did one resistor for multiple LEDs. Usually, it isn't much of a problem for me.
Title: Re: Placement of resistors.
Post by: The-Owl on Jun 17, 2012, 12:51 am
You need a separate resistor for each LED.

A very simplified way of thinking about this is like this...

If you had 10 LED-resistor combinations, you would take 200 mA from the battery.

If you took one of these resistors and connected it to 10 LED's in parallel you would only take the same 20 mA that the one LED would consume, but this would cause all the LED's to be very dim because they would only have an average of 2 mA each ( but as a previous member mentioned this would not be shared equally due to tiny differences in the Vf of each LED ).

If you swapped the resistor for one that would take 200 mA from the battery, then in theory you would have an " average " of 20 mA for each LED, but this also would not be shared equally.
The LED with the lowest Vf ( needs to only be a couple of milli-volts lower ) will take more than its share of current and will burn out long before its rated lifespan; this could be as short as a few minutes ( seconds if you are using cheap LED's with a large difference in Vf ) or may last days or even weeks.
Your 200 mA is now shared between 9 LED's, so the LED with the next lowest Vf gets more punishment than its predecessor and burns out even quicker.
Repeat this until all of your LED's are cooked !

Resistors will only cost you pennies, and leaving them out is not worth the risk.
Title: Re: Placement of resistors.
Post by: majenko on Jun 17, 2012, 12:59 am
This is exactly why I created my LED breadboarding modules with integral resistors (see my eBay shop), so you don't have to faff around with all those resistors.
Title: Re: Placement of resistors.
Post by: Docedison on Jun 17, 2012, 01:09 am
I had a techie trainee do just that once... he asked me what I thought of that and I replied that he hadn't given it much thought, why should I?. He did as his thoughts directed and powered it up... it took about a minute for it to be over, was interesting to watch... much like popcorn they went off each brighter than the one before randomly (they were in a circle), I had his check ready for him when he went on break... because he plugged in 10 more led's and tried it again. I asked him why and he replied that he thought he had some defective led's... the first time, he hand't an answer for the second attempt.
Insanity can be defined as doing the same thing repeatedly, expecting different results.
I see a lot of that here too... LOL

Doc
Title: Re: Placement of resistors.
Post by: winner10920 on Jun 17, 2012, 01:41 am
The only way to save on resistors would to raise the supply voltage and put some leds in series and one resistor for them
say 12v supply, put 3 in series for a total 9.9v led vf
then limit it to 20 ma by 12-9.9 =2.1v/.02=105 ohms
so you would have 5 strings of 1 resistor and 3 leds and one string with one resistor and one led(need to recalculate for the new supply voltage, so about 400 ohms)
so you save 10 resistors at the cost of using a 12v battery/supply

And btw I've got cheap leds from ebay (white) that vf ranges from 2.9 to 3.3 so especially on cheap ones its common to have off vf
Title: Re: Placement of resistors.
Post by: pwillard on Jun 17, 2012, 04:07 am
Resistors are like the cheapest component you can buy.  Don't be lazy and cheap.
Title: Re: Placement of resistors.
Post by: dkl65 on Jun 17, 2012, 04:17 am
Okay! I will use my 330 ohm resistors that came with the Sparkfun Starter Kit with every LED! It is just annoying for me to take many resistors out of the bag, bend them, etc. I used to think that one resistor is okay, because I thought that it doesn't matter where in the circuit I put the resistance. I now know more about electricity. I experience that LEDs not lighting up properly before. I was wondering why I had to put 3 resistors on a common cathod RGB LED. I tried using one resistor on the cathode only, turned on all the LED pins, and only the red light came on. I switch back to 3 resistors, and it worked properly again (showing white).
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 17, 2012, 04:54 am
Okay good thing I asked

Quote
slight differences in the Vf of the LEDs will result in differences in brightness, and some LEDs not lighting up at all.


Had not thought about that at all.

Quote
Don't be lazy and cheap.


Its not about laziness or cost, I have limited space on my board.
Title: Re: Placement of resistors.
Post by: clvrmnky on Jun 17, 2012, 05:14 am


Quote
Don't be lazy and cheap.


Its not about laziness or cost, I have limited space on my board.


You can get a whole whack of resistors in various DIP package sizes. So, if you have room for one or two more ICs, you have room for all the resistors.
Title: Re: Placement of resistors.
Post by: Docedison on Jun 17, 2012, 05:47 am
yes and did you know that an 805 size resistor solders neatly between 2 .1 in Ctr pads or traces???, even with pins in the holes???.

Doc
Title: Re: Placement of resistors.
Post by: RedSquirrel on Jun 17, 2012, 09:06 am
This brings an interesting point, if making a project with lot of LEDs finding tons of resistors of a specific resistance can be quite hard.

Would pencil led work well as a resistor, or is it not resistive enough?
Title: Re: Placement of resistors.
Post by: Osgeld on Jun 17, 2012, 09:23 am
1% resistors are cheap, and more than good enough

that being said, yea you can get away with just using a single resistor, do it all the time, though it will look like crap (at the least of your problems) but if you just want to barf something on a breadboard and dont care about astethics then it will work
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 17, 2012, 05:18 pm
Well I just am not the best surface mount solderer.  Also my traces are at the minimum spacing for dorkbotpdx right now.  Its a small prototype but I will be ordering custom boards for it.
Title: Re: Placement of resistors.
Post by: Grumpy_Mike on Jun 17, 2012, 06:05 pm
Quote
Would pencil led work well as a resistor, or is it not resistive enough?

Think how much is pencil led it must be ten times more expensive than a resistor.

Quote
Well I just am not the best surface mount solderer.

Good chance to get some practice in.
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 17, 2012, 06:11 pm
I did  buy some scrap boards from sparkfun and got a few samples to practice with.
It was awful.

I did purchase Sparkfuns Heaterizer XL-3000 knowing that it wasn't entirely capable of solder rework and such, although this guy did all this with it.
http://bodger.dreamwidth.org/17113.html (http://bodger.dreamwidth.org/17113.html)

I'm hoping that it'll be able to help me out with the soldering a bit, especially with the QFN tlc5940
Title: Re: Placement of resistors.
Post by: winner10920 on Jun 17, 2012, 06:52 pm
Using the right tool helps alot, but alot of it is practice
id suggest practicing on similiar size smd parts before you go for broke with the ones you bought
I collect all sorts of scrap boards, some of it very dense smd boards
I wipe them entirely clean with a toaster oven and sort out the smd parts, then when I want to practice I take the newly cleaned board and try to resolder the parts, its great practice
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 17, 2012, 07:01 pm
oh wait....can't I just make a reflow oven?  I have an older toaster oven in the basement that we don't use any more.
Title: Re: Placement of resistors.
Post by: winner10920 on Jun 17, 2012, 08:59 pm
Yes you could, just need to control the power to the elements, have a high temp sensor, and maybe a little display to make it all official
im planning on doing it with my toaster oven, but not yet as im only using it destructively to remove parts not put them on and so I don't care if the temperature is as 350 or 400 or 450, just so long as the solder melts
In a reflow oven the temperature is quite important, as well as following a proper temperature curve which is pretty easy once your controlling the heating element
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 17, 2012, 09:12 pm
Okay, I think I'll just do that.
Title: Re: Placement of resistors.
Post by: lefstin on Jun 18, 2012, 06:48 am
If you don't want to do SMD and you can tolerate 0.1" spacing a bussed resistor network is handy:

http://www.mouser.com/Passive-Components/Resistors/Resistor-Networks-Arrays/_/N-e89lZscv7?P=1yzu5aiZ1yzs1g7Z1yzu5ah (http://www.mouser.com/Passive-Components/Resistors/Resistor-Networks-Arrays/_/N-e89lZscv7?P=1yzu5aiZ1yzs1g7Z1yzu5ah)
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 18, 2012, 07:16 am
I've always been unsure about those bussed networks.  Say I connected them to a number of ICs that don't have diodes.  What would stop the electricity from going through the network and then have a signal at some random ic that is connected to the bus.
Title: Re: Placement of resistors.
Post by: Osgeld on Jun 18, 2012, 07:18 am
I wouldn't give up on SMD totally though, I absolutely hated it for years, now I can solder it down without even holding the components. I still dont use it for 1 off stuff, its too much of a pain for me to make PCB's since I dont always have the right stuff on hand, but have plenty of perf board

though as someone else mentioned you would be pretty suprised how much SMD stuff can actually fit on .1 pads, like 805's plcc 4's SMA/SMB stuff etc
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 18, 2012, 07:30 am
Well I know they are much smaller and I don't hate SMD, I just am not good at it.  I wish I was better because then I could get the parts, throw it together, and it would work just as well as my through-hole projects and they would be so much smaller.
Title: Re: Placement of resistors.
Post by: majenko on Jun 18, 2012, 10:53 am
I used to be scared of SMD - now I use it all the time, even on my own home-etched (toner transfer method) boards.

Fore anything smaller than SOIC pitch I tend to use a breakout board of some form (I have some very nice ones specially designed for 100-pin TQFP PIC chips that include all the bypass caps and an ICSP header), because it's more reliable than using TT.

0805 SMD capacitors at 100nF make fantastic bypass capacitors - they just solder directly between adjacent power/ground pins on a DIP chip.  They don't take up any room at all then.  22pF ones also make good load capacitors with a crystal between two outer tracks and a central ground track.  Again, no room.

Yes, it takes a bit of practice to get it right, but if you always shy away from it then you'll never get that practice.  And SMD passive components are so cheap I don't even worry about dropping some on the floor.
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 18, 2012, 06:26 pm
Quote
0805 SMD capacitors at 100nF make fantastic bypass capacitors


Whats a bypass capacitor?
Title: Re: Placement of resistors.
Post by: majenko on Jun 18, 2012, 07:26 pm
bypass - decoupling - they're different names for the same thing.
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 18, 2012, 08:41 pm
Ohhh okay.

On a side note, has anybody used the Heaterizer XL-3000 Heat gun and had success doing solder rework?
Title: Re: Placement of resistors.
Post by: winner10920 on Jun 18, 2012, 08:45 pm
No, but I have used a 12$ butane hot air pen successfully so I imagine that would work
tho for smd ics with more pins than a few I prefer to use the solder drag and wick method, hot air took a while
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 19, 2012, 01:31 am
I've tried the solder drag method before.  I ended up with all the pins connected to eachother.  I stopped there.  Was I supposed to wick away the excess after that?
Title: Re: Placement of resistors.
Post by: winner10920 on Jun 19, 2012, 04:27 am
Yes, bridging is normal before that, the solder wick takes off the bridges leasving just enough under the pins for a good connection
Title: Re: Placement of resistors.
Post by: Osgeld on Jun 19, 2012, 05:54 am
its funny, every time I try that theres never enough solder and I have to go back and reflow a pile of pins ... but if I want to remove an IC with wick, not one pin will pop loose.

not saying the method is invalid, just saying I must be the only one not doing it right
Title: Re: Placement of resistors.
Post by: Grumpy_Mike on Jun 19, 2012, 08:32 am
Quote
but if I want to remove an IC with wick, not one pin will pop loose.

That is telling you that you did have enough solder in the first place.
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 19, 2012, 05:24 pm
MMkay, well I think  I definatly have enough solder on there, haha.  I'll try to wick sometime.
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 20, 2012, 12:01 am
Btw, since we are on the topic of resistors, can anybody explain what pull-up and pull-down resistors are?  I knew at one point although since I've been broke, I haven't been able to really make any of my concepts and I've just forgotten.
Title: Re: Placement of resistors.
Post by: dkl65 on Jun 20, 2012, 12:10 am
Pull up and pull down resistors set the pin at a logic HIGH and logic LOW respectively. They are used for inputs. You get it?
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 20, 2012, 12:30 am
No, Say I have a Vcc connected to a load, which also has a connection to ground at the same terminal.  I would put pull down resistors above the ground to make sure the Vcc doesn't go through to ground but rather my circuit?

Is that correct?  I think i'm getting confused with NMOS and PMOS transistors.
Title: Re: Placement of resistors.
Post by: dkl65 on Jun 20, 2012, 12:34 am
Pull up/down resistors have nothing to do with that. I will try to find a link. I have to leave now. Try searching for more info.
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 20, 2012, 12:37 am
Yea I mean more so the logic i'm getting confused.  There aren't any resistors in a CMOS dealio but you get me.

still confused though, haha.
Title: Re: Placement of resistors.
Post by: majenko on Jun 20, 2012, 12:43 am
When an input is not connected to anything it is known as "floating".  This is when there is no signal on it, so the input cannot know what logic level it is at.

When you connect the input (via a button, say) to either Vcc or GND, you are placing the input into either the HIGH or LOW logic state.

You want to avoid a floating input at all costs.  They can cause strange results in programs.  To avoid them you place the input into a "default" state - the opposite of the way you want your button to connect the input to Vcc/GND.  For instance, if your button connects the input to Vcc (HIGH), then you need to set a default state of LOW.  So you need to connect the input to GND for when the button isn't pressed.

However, you can't just connect it straight to ground, because then when you press the button there will be a direct connection between Vcc and GND, and that will basically be a short circuit.  The whole system will die, and in extreme cases batteries will blow up and wires / traces will melt.

So, you create the default state through a resistor.  The resistor can be quite high as you don't want much current to flow through it when you press the button, but at the same time it needs to be low enough that not too much voltage is dropped across it.  10K? is a typical value.

Now, when the button isn't pressed, the pin is connected to GND through the resistor and reads LOW.  You press the button, and the resistor is connected between Vcc and GND, and the input is connected to Vcc, so it reads HIGH.  No more floating.
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 20, 2012, 01:32 am
Hmmm I think I get it.  That would explain why there is a 10k ohm resistor on the IREF pin of a TLC5940, b/c you don't want your 5940 pulling unlimited current based off of the 0 resistence IREF. 
right?
Title: Re: Placement of resistors.
Post by: dkl65 on Jun 20, 2012, 03:47 am
majenko made my tiny descriptions seem useless.... There is one more thing to add: if the resistor value is too high, the input may be suspectable to noise, and if it is too low, it will draw a lot of current, and waste power.
Title: Re: Placement of resistors.
Post by: funkyguy4000 on Jun 20, 2012, 06:49 am
So how would one figure out what is a good medium?  Just use 10K for now?
Title: Re: Placement of resistors.
Post by: majenko on Jun 20, 2012, 09:56 am
There are calculations you can do revolving around the Rdson of the mosfets in the chip, but 10K is usually "good enough" to work reliably.
Title: Re: Placement of resistors.
Post by: Grumpy_Mike on Jul 04, 2012, 10:59 pm
Yes.
Title: Re: Placement of resistors.
Post by: foxbat on Jul 05, 2012, 02:40 pm

I've tried the solder drag method before.  I ended up with all the pins connected to eachother.  I stopped there.  Was I supposed to wick away the excess after that?


It depends a lot on the type of flux. I have just about every type you can get; no-clean liquid, rma223 and others. All will leave bridges except this dark brown gunge I've got that burns really easily. It's ability to completely destroy the surface tension of solder is uncanny and not once has it caused a bridge even on 0.4mm pitch parts.

It will even eliminate other bridges if I paste a bit on the bridge and touch it with the iron. I'd like to know what it is, maybe it's plumbers fluxite or something like that.
Title: Re: Placement of resistors.
Post by: Osgeld on Jul 05, 2012, 07:45 pm
Ruby Flux brand has that ability as well, its meant for terminals and turns solder into a super flowing material. Never used it on SMD stuff but I use it all the time to tin wire. just a little bit along the length, and wipe a blob of solder and it perfectly tins ribbon cable into breadboard jumper with no lumps or missed spots.

leaves a nice red mess when I have used it on boards, though its easy to clean.