Basic calculations, why is there difference between theory an practice? - Page 1
Forum section: electronics / beginners

author: Teza
author_rank: Contributor
timestamp: March 08, 2017, 05:08:08 pm
content: I am starting at scratch with no knowledge, so sorry if this might be a bit too basic.My first project is trying to understand what is going on and beeing able to do some calculations, and this project is a result of many hours on google.I have described my project in the attachment.http://www.terjeandersen.no/forum/evvblog/Project_AAA-Calculations.pdfI have 5 questions from my first project:Question 1:Why is the measured values on the multimeter changing, and not stable?Question 2:How close should the values of the theory and the lab testing’s be?Question 3:The energy conversion efficiency of the circuit’s, shows that the circuit in part 3 is 35,55% more efficient than both of the other circuit’s.Is it possible to get the same efficiency with only 1 LED?Question 4:Is the calculations correct, or have I misunderstood how these should have been done?Question 5:I believe that it can’t be used 3 LED’s in serial circuit, as long as the voltage is kept on 9V.This because 3,2V x3 = 9,6V.Is this correct or is there a work around?Sorry for the long pdf file.

author: JimRemington
author_rank: Regular Contributor
timestamp: March 08, 2017, 06:04:06 pm
content: QuoteHow are they changing? Post some data, including time intervals.QuoteRoughly speaking, they should agree to within realistic estimates of the errorsand tolerancesin the stated component values and errors in the measurements. Where did the value "9 V" come from? It is almost certainly not correct.Specifications for semiconductors often have very large tolerances; factors of 2 or more.Re energy conversion: This is usually calculated for converting one form of energy to another, like electrical to mechanical or light. What do you think "energy conversion" means in your experiment?I don't understand questions 4 and 5.

author: Teza
author_rank: Contributor
timestamp: March 08, 2017, 06:57:05 pm
content: The power supply is adjusted to 9 volt, and checked with the multimeter.The mesurements is taken over a period of 1 minute.The amount of change is posted under the "Lab testing" in the end of each part.Example: 𝐼 = 17,85 mA (17,79 – 17,85)Where I have used 17,85 as my best guess, and the measured values goes from 17,79 mA to 17,85 mA.Values are starting low and climbing over time.I was thinking on energy conversion as how much power that was used to produce light.So 2 leds in series used ~35% less energy to produce the same amount of light as 2 leds in parallel.I might have misunderstood this part, but that is why I am asking if this is correct.Question 4, was ment to if the calculations in question 3 was correct.

author: MrAl
author_rank: Super Contributor
timestamp: March 08, 2017, 09:42:26 pm
content: Hi,Theory is used for things like electronic circuits like a ruler is used to measure distances.The ruler was developed so that we can all make measurements and compare them to other measurements and make other determinations. Often the closer we come to a given measurement the better we are doing.Theory is developed so that we can gauge how well we are doing with a design. The closer we come to getting the circuit to work like theory suggests the better we are doing.When comparing measurements to theory a lot has to be taken into account. There's measurement error, noise, etc., that has to be dealt with. Different applications will also have different requirements as to the accuracy which is really how well they stand up to pure theory. Some applications will require 0.5 percent accuracy while others can tolerate 10 or even 20 percent sometimes. GPS for example requires very high accuracy and knowledge of relativity theory to get right, while the average computer power supply only has to be around 5 percent accurate.

author: orolo
author_rank: Frequent Contributor
timestamp: March 08, 2017, 10:01:51 pm
content: Quote from: Teza on March 08, 2017, 06:57:05 pmAs the LED works, it gets hot, and its forward voltage decreases. This increases the voltage, and the current, across the resistor. If you stop the circuit and let it cool, the voltage should drop to near the initial value.The lab notes are really great, BTW.

author: Hideki
author_rank: Frequent Contributor
timestamp: March 08, 2017, 10:51:37 pm
content: Quote from: Teza on March 08, 2017, 05:08:08 pmTo get a higher efficiency you have to stop wasting power in the resistor. One way to do that is to use a buck converter to drop the voltage. It won't be 100% efficient at doing that, but if you're lucky you might get 80-90%. Typical LED drivers will be constant current instead of constant voltage.

author: james_s
author_rank: Super Contributor
timestamp: March 08, 2017, 10:53:41 pm
content: Theory assumes perfect components, a perfect power supply that puts out the intended voltage stable to infinite decimal points, a perfect meter that gives perfect accuracy to infinite digits. In real life nothing is perfect, everything is compromises. The value of a resistor changes with temperature and age, the voltage of any power supply has some variation, there are many subtle effects that compound each other and make it so that real world measurements will never be quite as tidy as you would calculate. If you tried to calculate *every* variable you would end up with a very, very complex equation for even a simple circuit. Instead we simplify and approximate and then adjust as needed.

author: mariush
author_rank: Super Contributor
timestamp: March 08, 2017, 11:16:50 pm
content: The leds are diodes that produce light.Each LED has a forward voltage, a voltage at which the led starts producing light. This value is different for each led because it depends on the manufacturing process.There is a small region between the point where the leds start producing light to where they're fully "turned on" where they behave like having a resistor inside them, only letting a small amount of current flow through them.For example, let's say that one particular LED doesn't turn on at all at 2.9v, starts turning on at exactly 3.0v and up to around 3.1v, in only lets through 1mA or some similarly low amount of current, and from 3.1v and higher, the LED lets any amount of energy go through.If the voltage is high enough, the leds let so much current go through them that they'll burn up (they get too hot and destroy themselves)If you put more than 1 led in series, you need at least the sum of the forward voltages to make the leds light up and you have to limit the current going through them otherwise they'll be damaged.Very rarely, it just happens that the sum of those 3 forward voltages is in that very narrow range where the leds acts as having a resistance, they're not quite "fully turned on"But most often, the amount of current has to be limited by using a resistor in series with the leds, or by using a led driver which monitors in some way how much current the leds consume and if they consume too much current, the led driver lowers the voltage to reduce the current.Some circuits don't have a resistor in series with the leds simply because the power supply behaves like it has a resistor inside it. For example, you may see a LED connected directly to a 3v button cell battery and it won't be damaged, because the battery itself can't send more than a few mA to the LED, it behaves like it has an internal resistance of a few ohms.Now.... temperature... as the leds heat up, the forward voltage usually decreases, it drifts a bit. This means relying on that narrow region where leds limit themselves to a few mA is highly not recommended, because as they heat up, that region drifts to the left and the led may turn fully on and burn itself out. So for example, if you had 2.9v off, 3.0 start to be partial on, 3.1v full on , when hot the led may be 2.8v full off, 2.9v starting to turn on and 3v full on ... so if you originally assumed that the leds will be only partially on at 3.0v, you're screwed.If one led in the series is better built than the others in the series, it could go full on when it's hot enough and then burn out first (because of more current going through it - it would still be limited somewhat by the other leds in series) and could be stuck as a short, and then the remaining two leds would see more voltage, which in turn may take those leds out of that narrow region and so on .. you have a chain reaction.So as time goes by and the leds heat up, their forward voltage decreases so they'll use slightly more current.When you measure the current, you usually do it with a multimeter, and the multimeter measures the current by placing a low value resistor in series with the string of leds. That small value resistor is usually very quality one with a low temperature coefficient meaning the resistance value of that resistor won't vary a lot as it heats up, but nevertheless it will still heat up slowly.The multimeter measures the voltage drop on the resistor, which is in direct relation with the resistance, but if the resistance value changes slowly with the heat, naturally the measured current will also changed very slightly.This internal resistor in multimeters is also one of the reasons people get confused about Ohm's law ( voltage = current x resistance) and why they don't see on multimeters the amount of current they expect.For example they take a 5v power supply and put a 100 ohm resistor between + and - and expect to have a current of 5v / 100 ohm = 0.05A or 50mA but then they put the multimeter on the mA range in series with that resistor and don't realize that on the mA range, the resistor used by the multimeter could have a value as high as 10 ohm , so in reality the resistance is 110 ohm ... so that's why they see 5v / 110 ohm = 0.04545 A or 45mAAlso, they forget that the resistors they use are much worse when it comes to temperature ... the power wasted in resistor is P = I^2 x R so we have P = 0.045 x 0.045 x 100 = 0.2025 watts of heat in the resistor that will slowly heat up the resistor and make the actual resistance value change, so it slowly affects the current consumed as well.ps Your Fluke 87v has a burden voltage on the 400mA range of about 1.8mV per mA .. the more current you have the more it will affect the reading ... on the A range, the burden voltage drops to 0.03v per A or 30mV per A or 0.3mV per mA , almost low enough to ignore its effect on measurements.ps2. Also, in your case you may also have to take into account the contact resistance of the metal inside the breadboards, how oxidized those metal strips are, and with a 10 digit multimeter may also have to take in account the resistance of those strips, how capacitance between those metal strips may or may not affect measurements etc etc

author: naldo
author_rank: Contributor
timestamp: March 09, 2017, 12:15:38 am
content: Theory and practice are two sides of the same coin. By theory is meant practice, and by practice it is understood that the theory is correct!

author: Brumby
author_rank: Unknown
timestamp: March 09, 2017, 04:11:06 am
content: When theory does not match experimentation, then I would suggest you have one or more of the following to consider:1. Components are not operating at the characteristics used in the theory. For example - a component being out of spec or faulty.2. The theory is incorrect. For example - calculating performance of an AC system from DC characteristics.3. The theory is incomplete. For example - not considering the heating effects on the performance of a component.4. External factors are affecting operation. For example - EMI.

author: Teza
author_rank: Contributor
timestamp: March 09, 2017, 07:00:35 am
content: So basicly as long as my theory and practice is not two very different things, and that the end result is within an accepted range, it is good.I have then learned that there is no reason to chase for a perfect value match.

author: dmills
author_rank: Super Contributor
timestamp: March 09, 2017, 12:25:22 pm
content: The dirty little secret of this game is that nobody out of school calculates to 3 (let alone 4) sig figures unless they really have to.For something like a power on LED the reasoning usually goes something more like "9v battery, so say 6 - 10V depending on charge), led say a couple of volts, so maybe 3 - 8V across the resistor, looks like a couple of k should do it, now what do I already have on the BOM?".The art is to know when the rules of thumb and approximations apply and when you are in one of those rare situations that needs the proper math.For run of the mill stuff 3.5 digits is more then enough in a multimeter, and my AVO model 8 does not even manage that.Generally if the measurements are within 5 or 10% of theory, then things are fine, but remember that things like transistor Hfe is usually given as a minimum and typical, it has a huge variability even within a single part number and single manufacturer (And having purchasing change manufacturer on you can be a most unwelcome surprise if you did not think it thru).73 Dan.

author: rstofer
author_rank: Super Contributor
timestamp: March 09, 2017, 05:20:16 pm
content: Quote from: dmills on March 09, 2017, 12:25:22 pmWhich is why the slide rule was entirely adequate, way back when. We didn't need 14 digits on our calculators because we could never measure anything to that precision.This deviation from theory is also why we need to do sensitivity analysis. Every component has a tolerance and some components cause more of an error than others. When you see a transistor with an hFEthat varies between 100 and 300, you have to wonder about the effect on your circuit. Tolerance stacking is another area that needs study.

author: dmills
author_rank: Super Contributor
timestamp: March 09, 2017, 09:08:03 pm
content: Quote from: rstofer on March 09, 2017, 05:20:16 pmThis is the true usefulness of simulation, you can monte-carlo a circuit with dozens of components and complex interactions a few tens of thousands of times over night and come in the next morning to data that provides reasonable confidence that some unexpected pathological situation is unlikely to exist.Far more then 'does it work' questions this is where simulation shines.Regards, Dan.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 09, 2017, 09:55:47 pm
content: The only difference between theory and [a sufficiently simple] reality, is an incomplete theory.That stipulation is necessary, because complex dynamic systems exhibit chaos, which isn't to say their outputs are random -- they must still obey underlying physical rules -- but the exact results, within those bounds, are a lot harder to predict. (This is fundamentally why accurate weather forecasts beyond a week are, not impossible, but intractable. Also, understanding the kind of errors they make is important: you might blame the weatherman for incorrectly forecasting rainon your town, when in fact they quite correctly predicted that some total amount of rain fell within a 50km radius of your location, and that your town was possible, but not guaranteed.)For simple electronic circuits, it is relatively easy to predict behavior, but you must be aware of all properties of all components used. This is best absorbed through years of careful study and experiment.The most common cause of slow drifts over time: temperature changes. Temperature sets the voltage drop of a diode or BJT. Temperature sets the resistance of a pure metal or semiconductor. (Some metals happen to have nearly zero tempco around room temperature, making them useful as resistors: i.e., a component whose ratio of voltage drop to current flow (R = V/I) is largely independent of the voltage, current, temperature, humidity, strain, etc. it is exposed to.) Temperature sets the capacitance of a type 2 ceramic capacitor (but not a C0G capacitor, or the better film types), or the resistance of an NTC thermistor (also a type of ceramic).Unintended consequences pop up all the time. You may think that you've connected the components together, following the schematic; but the schematic is an incomplete description of the real circuit. A real wire has voltage drop, equivalent inductance and equivalent capacitance. So do all the other wires in the circuit. You can very easily get an oscillator from what you wanted to be an amplifier, or vice versa. Or, to end up with a digital circuit that spits out gibberish, or chatters or oscillates, because of delays in the signals.These properties are inseparable from the fact that a wire has length, that its path takes up space. Signals only travel at the speed of light, and this is the electrical consequence of that (cool, huh?).So keep reading, apply as many theories as you can, and learn where they are necessary to apply, and where they aren't so necessary. Keep in mind that, even if a circuit's function might not care much about one phenomena (like signals radiating out of a wire: as long a digital signal arrives at the destination >50% intact, the digital circuit really doesn't give a flip), that phenomena doesn't simply go away because you willed it so, and its consequences will still be around (radiated digital signals are a huge source of interference, and susceptibility to random errors from outside noise!).Tim

author: Teza
author_rank: Contributor
timestamp: March 10, 2017, 07:30:34 am
content: I feel there is an overwhelming amount of knowledge I need to know, before I can even start to learn the basic of electronic.I started with the led diode and the resistor, as there was only two components and should be an easy to understand and calculate circuit.I then spent hours on finding out the difference in how it will change from seriel to parallel, and then some more time by adding an extra led.I thought I had it all figured out, but this thread show that I might need to have another look at my first attemt.I was looking on trying a more advanced circuit, but now might need to reconsider, take a step back and find an easyer project as my next attemt

author: Teza
author_rank: Contributor
timestamp: March 10, 2017, 04:47:25 pm
content: Well, I am not going to do all these calculations for any circuit soonI did an attemt on calculating on only the 2 resistors in parallel, and I can spend a huge amount of time if there is some more components.Tho, it do confirm some of the variations in my first project!But I am not able to find what temperature is ment by "room temperature" in the datasheet, I see that people talk about 20 and 25 deg.C on the web.

author: CraigHB
author_rank: Regular Contributor
timestamp: March 10, 2017, 07:32:36 pm
content: Yeah reality is a bitch. In any case theory just gets you close enough to dial things in on the bench without being too far away from where you need to be. Calculations with pencil and paper are good for understanding how things work, but for practical design it's a pretty quick progression to using a simulator. Though for real simple things like biasing an LED or finding a time constant I might go to a calculator and do a quick manual calculation.Room temperature in data sheets is usually 25C which is 77F, not really room temperature since that would be more like 22C or 72F. For whatever reason it's 25C. It's pretty rare that something actually operates at room temperature. It may have to operate outside in much colder temps and more often it will be running at warmer temps due to power dissipation. You pretty much always have to consider temperature extremes and examine the behavior of your circuit at either end of the spectrum.

author: james_s
author_rank: Super Contributor
timestamp: March 10, 2017, 07:42:41 pm
content: I suspect room temperature is spec'd at 25C because it assumes most circuits will be operating inside an enclosure where the temperature is going to be a bit higher than ambient even for a relatively low power circuit. 25C is probably a reasonable average if you assume it's 18-20C in the room.

author: Teza
author_rank: Contributor
timestamp: March 11, 2017, 10:21:36 am
content: Thank you for all the input for my first project.Based on your input I have updated the project notes with calculations regarding temperature, tolerance and change in forward voltage.I feel there is some more calculations that can be done on the LED's in this project, but did not find an answer to this when googeling on the web.

author: tggzzz
author_rank: Super Contributor
timestamp: March 11, 2017, 11:38:04 am
content: Quote from: Teza on March 10, 2017, 07:30:34 amGood lab notes.Good to see someone thinking about what they are doing and observing.There is so much in electronics that you will never learn it all in your lifetime. You canchooseto think that is goodorbadTolerances are a very important part ofengineeringa design (as opposed to hacking something together). In practice this means choosing a design where the overall operation is dependent on a small number of components that can be well defined.A simple example is how do you make an amplifier with a gain of "exactly" 10 where the transistors have gains that vary from 50-400 between devices and across current and temperature ranges. Answer: negative feedback using resistors. But you might have to be careful about the resistor value varying with applied voltage and or temperature, or the parasitic capacitance/inductance might be important - etc, etc, etcA key value of theory is to enable you to understand and predict ideal operation, then to split non-ideal practical effects down into constituent components, then to find work-arounds for each of the non-ideal components. For example, a resistor's parasitic inductance can be reduced by making the resistor smaller and the interconnections shorter and wider.

author: Teza
author_rank: Contributor
timestamp: March 11, 2017, 01:08:35 pm
content: I feel a bit crazy to make 9 pages for connecting 2 resistors and 2 leds, but on the other hand I already know the learnings from that will be usefull in my next project, as well the posibility to go back and take a look at these notes when I need to do new calculations.

author: tggzzz
author_rank: Super Contributor
timestamp: March 11, 2017, 03:20:44 pm
content: Quote from: Teza on March 11, 2017, 01:08:35 pmYes and no.When you are learning, you don't yet have a feeling for what is significant and what is unimportant. At that stage it is right and proper to do full explanations and calculations to double-check your understanding. Iliketo see people doing that, because I will then have more confidence that what they say isn't due to wilful ignorance.Now, I wouldn't do that with your problem, but I amcurrentlydoing it with high resolution voltage/resistance measurements - because it is new to me. I don't yet have an instinct as to whether what I'm seeing is reasonable or not, or whether there is something subtly wrong with the (old) equipment.Whenever you first start to use a new class of equipment (analogue scope, digital scope, spectrum analyser, signal generator etc etc) it is good practice to sit down and make very basic measurements, just as you are doing. The same is true to a lesser extent when using a different type of instrument in a class you are familiar with, e.g. a DS1054Z after using an Agilent 54621. Why? Because all instruments have their limitations, and you need to understand where you aren't merely "measuring the instrument's imperfections".If you look around in this forum, you will see many examples where people moan about an instrument being "wrong". In some cases they are right, but in more cases they don't understand the instrument and its limitations. (Today's example is about impulsive noise when an oscilloscope's inputs are grounded; the observed results are just what you would expect given the scope's settings, but one person persists in believing his scope is faulty. Maybe he will learn when his soon-to-be-delivered scope shows the same phenomenon!)

author: Dinsdale
author_rank: Regular Contributor
timestamp: March 11, 2017, 04:19:58 pm
content: I fondly remember going to the surplus electronics store to get parts for my first project and proudly asking for some 374.628 ohm resistors.

author: Luminax
author_rank: Regular Contributor
timestamp: March 15, 2017, 04:43:08 am
content: Damn Teza... I need some pointers from you on doing lab notes... I always say to myself "Do lab notes, write down everything"... 9 times out of 10 my brain does all the writing and my paper is happily blank...

author: Teza
author_rank: Contributor
timestamp: March 15, 2017, 10:05:24 am
content: I don't have the faintest idea on what I am doing, I am only doing as you describe "write down everything", and in the end I sort all of those notes.Problem with this is I use way more time on the paper than on the practical project...I guess I will find a middle way in time