Shop OBEX P1 Docs P2 Docs Learn Events
Ok I would like to draw as little current as possible from the propeller i/o pin and - Page 3 — Parallax Forums

Ok I would like to draw as little current as possible from the propeller i/o pin and

13»

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-09-08 05:11
    I can't for the life of me figure you out, do you want help or not???. Your sim is obviously not giving you the answers and they don't simulate magic smoke and failure mechanisms, they are like a video game that keeps on working when the real thing would have been smouldering by now, it's not real life. However despite all the emphatic advice heaped freely upon you, you still shrug it off and do your own thing out of a blissful confidence that is inversely proportional to your knowledge and understanding. If you don't want to listen or at least TRY the suggestions then don't ask. All you are doing is going around and around in a circle asking questions and wasting our time. There are 60+ posts (plus similar threads) for what should be no more than perhaps 6 or so posts.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-08 06:55
    well it doesnt help when im getting answers doing them then being told there wrong by someone else.

    the first pic i posted is exactly what you told me to do minus the darlington. i played with the pnps base resistance measuring the ratios of i/o draw to amplification and ended up with a 470ohm tied to the transistor base and the prop pin.. which turned out to be what you said to do... then im told theres all these problems i ask why the values seem in spec and im told why. so all i can do is try it another way test that out then figure out what i should do for myself becuase obviously everyone has there own way and says its right.. just
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-09-08 18:42
    I've read through the posts and it seems that you end up doing your own version of the suggestions and wondering why it's not working. Just before you were asking why do you need NPN transistors for the cathodes. Imagine me sitting in front of the PC reading this and throwing my hands up in the air and on my head. Okay?
    You said:
    1 in your schematic u have npns connected to the cathodes. first of all what is its function? in my head im thinking the current has been applyed to the anode travled through the led and is now going to ground assuming the segment is lit so i dont understand what that npn is there for.

    Yet when we eventually found (misleading thread subject) out that you were using a 4-digit common common anode multiplexed LED it was apparent that the cathodes would NEVER be connected to ground unless you want these displays as static fairy lights. I then posted a schematic that will work in post 31. Don't you need to select a digit at a time, therefore the PNP or whatever to switch on one digit at a time via the anode and then change the cathodes which represent the segments to display the correct pattern.

    The biggest problem so far though seems to be your total refusal to use any kind of current limiting for the leds, even after all kinds of explanations, perhaps this is due to your own confidence and your magical SIM which says this is okay but the SIM will probably still say it's okay if you put 100 volts and 100 amps through it too.

    The kids in my wife's science class do this kind of think when they get the parts to build an LED flasher. They treat it like a lamp and without any further regard connect it straight onto the power-supply. Guess what happens? Certainly not what the SIM tells you, that's for sure.
  • kwinnkwinn Posts: 8,697
    edited 2012-09-08 19:07
    There's more than one right way to build a circuit to drive a LED, and many wrong ways. If the circuit controls the LED current as designed and under normal circuit conditions it is the right way. It may be overly complex and have redundant circuitry but it is right.

    My right way is to make it as reliable, simple, and flexible as possible. For that I use some variation of five simple circuits with components selected to suit the LED's being used. It really doesn't matter if the LEDs are in multi segment digits, an x-y array, single, or series/parallel strings.

    The first four circuits as shown are intended to drive common anode displays but could be used for common cathode displays with some simple changes.

    The low side switch is a basic on/off switch with a current limiting resistor on the collector.

    The low side constant current switch moves the current limiting resistor to the emitter making it a current limited switch. This allows the display to use an unregulated voltage and still maintain a regulated intensity.

    High side switch #1 is used when V+ to the display is the same or less than the voltage of the microcontroller output pins. If V+ is more than about 0.6V higher than the signal driving the transistor the microprocessor will not be able to turn it off.

    High side switch #2 is used when V+ is higher than the microcontroller output voltage. The NPN transistor can be turned on or off by the microcontroller and the current from the NPN collector will turn the PNP transistor on or off in turn.

    The high side constant current switch is intended to drive the segments of a Common Cathode display. It has a zener diode between the base and V+ and the current limiting resistor between V+ the emitter making it a current limited switch. This allows the display to use an unregulated voltage and still maintain a regulated intensity.

    Do keep in mind these circuits are starting points. You still need to select transistors and resistors suitable for the voltages and currents used in your application.

    Of course for some applications it makes a lot more sense to use one of the available LED driver IC's.
    1024 x 226 - 24K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-09-08 19:23
    kwinn wrote: »

    The high side constant current switch is intended to drive the segments of a Common Cathode display. It has a zener diode between the base and V+ and the current limiting resistor between V+ the emitter making it a current limited switch. This allows the display to use an unregulated voltage and still maintain a regulated intensity.

    Do keep in mind these circuits are starting points. You still need to select transistors and resistors suitable for the voltages and currents used in your application.

    Of course for some applications it makes a lot more sense to use one of the available LED driver IC's.

    Kwinn, I know that these suggestion are general but they are not specific enough and only add to the clutter. I think with this thread we need to keep it simple. No point in having a constant current anode driver as these are common anode displays as we finally finally discovered in post #50 and the current needs to be controlled in each cathode.
    1024 x 471 - 44K
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-09-08 20:41
    @Peter,
    I think you would make a great technical instructor. I can tell that this thread is has you about starkers..... but you keep on giving.. for now....

    @RW,
    If you refer to your thread regarding ADCs, you will see and recall my recommendations to you go run, don't walk to your nearest used college textbook outlet etc, and find a text that can take you through the basic material you need. You must have this background to be able to reasonably understand what you are doing as well as appreciate the value in the suggestions of the Peters, kwinns and the host of others who have and are still trying to help you. To not attempt otherwise borders on a selfish abuse of their time. Though I believe that help will still be offered when asked to a point.

    Seriously though when someone on the level of Peter and some others offers a full on circuit I would bet it will be better odds of hitting the lottery than having a bad circuit from them. Build it. See what it does. Meter it any way you think you can or makes sense to you. You will learn far more and faster than watching what a compter "thinks" may happen. I would bet that you will get a more positive response from the members of this forum if you said I tried this, it did that, I could not get the smoke back into the X, but I tried to DO something. Take a page out of Nike's book and JUST DO IT!!! Anything else simply devolves into mental masterba...........

    FF
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-09 01:40
    ok im just going to stop here at least for now. im not trying to frustrate people or waste there time. i like this forum so much becuase its easy going. i think alot of the problem here may be confusion based on my articulation. usually i get pointed in the right direction and just do something read up on it get it done for example my code for this has long been done except the pwm.

    i do understand dc and voltage drop, i know if an led gets isnt limited it will draw current till it burns out i understand all of this stuff. im having a hard time wrapling my mind around the acuall 7 segment i guess and how it draws power. see in my mind sticking something on the cathode is like putting a resistor after a single led. when the segment is lit it draws its current from the anode so this to me would be where u limit the current all the leds are parralell so u can determine the draw by dividing current by segments. i did not put a current limiting resistor in becuase the transiator would not allow the anode to draw more current and the current going to the anode diveded by segments was well in the segments continous current spec. and just clear it up i measured all my numbers on the first working schematic using a meter on hardware not a sim. i built the second schematic after posting it and realized it was wrong and i probably misinterpreted the sim becuase i could clearly see why it didnt work when i built it. the point im making is obviously what im doing is wrong and can lead to the 7 segment drawing to much current even though its in spec now. my mistake as i was told is trusting a transiators gain to stay stable and me not understanding how the cathode works in realtion to current. so i will read this thread a few more times along with other material and see if i can figure out where my logic is flawed becuase obviously it is. i do appreciate the help and will just stay quiet until i have something solid to be checked. i understand the schematics posted will work and have no problem using them my goal is to understand why they work and what im doing wrong though not just build it and go on.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-09-09 10:26
    The purpose of my last note was not to have you drop your project, toss up your hands and walk away. If you do that, then you will have truly wasted everyones time. The point was that you actually need to get to the basic understanding of what you are working with. Just like the bad joke about getting to Carnegie Hall, practice, practice, practice!

    A sim is only a suspect snapshot of what may work. You built and you learned. You simmed and you goofed. That should tell you something about simulation. Just like a calculator, you need to have a good idea of what to expect or you will believe that what comes out is correct. Not always so as you found out when you went real instead of virtual. A sim will not tell you that transistor beta is variable within a batch of transistors, it will not account for thermal effects, it may not account for beta being different in different levels of current. Forget the @#$#@ simulation for now, we used to do this on paper with slide rules. And good fundamentals.

    You need to apply some logic to your analysis which does require some basic understanding and careful thought into how you describe what you are doing. Words mean things. If you are not careful and accurate in your words, neither will your design (the physical embodiment of your thoughts) nor our ability to help you. Also, if you have not already done so, learn some basic trouble shooting methods. This will help you to figure out how to get to the problem in your circuit design when it doesn't work or fails.

    In your last note, you described why you did not put in current limiting resistors on the segments because you believed that would be ok. What you overlooked can be described by kirkofs current law ( sum of currents into a node = 0 ). So here, the current through the anode (out of the node) is the sum of the individual currents of each segment (into the node). So you will have two posibilities while leaving out the limit resistors into the segments. One (unlikely) you correctly designed the anode circuit such that it can never pass more than the segment max current in which case the display will have variable brightness depending on how many segments are lit, or (probable) you designed the anode to carry the sum of the max segment current or worse put the transistor near or into saturation, so that if one segment is lit, it will be able to draw the max current of 8 segments or more, damaging or destroying the segment in question. That is why the limit resistors go in the individual segments. Draw out these two circuit possibilities with only ONE digit for now and follow the current paths. Make the segment currents into the node + and the current out of the anode -, add em up and they should be 0. Then decide which circuit is correct and build; it use dip switches for segment and anode enable until you get it. Did it meet the design criteria? If so, good, then adapt it to the prop chip and move ahead with the rest of the project in the same way.

    @rest y'all....... verbose, habit from to many years as a tech instructor......
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-09 13:44
    no no no im not giving up at all i just meant that id would would read through all this again along with some other stuff and breadboard the schematics peter and kwinn posted exactly as shown.

    i think your post just hit on the head what im having problems with and what i specifically need to look into. i just rely on ohms law, i dont know kirchoffs law so i will make sure to give a it carefull read before i do anything else with this.

    and here is my other problem which your post made me realize i have not been articulating correctly. i do not understand the direction of current flow in a seven segment when the cathodes are tied to a prop. this is why i keep asking how to measure the current of an indavidual segment, when i measure from cathode to ground or prop pin at 0v i get 10ma iirc and that stays the same no matter how many segments are plugged it. in my head i visualize 8 with there anodes tied togather. im pumping current to the anode ande each led whos cathode is at is at 0v draws current from the anode and passes it through the cathode. so after the current has ran through the display how can it be limited?? i mean if i had an indavidual led id put a resistor in series before it to limit current, if i were to put a resistor in series after it, the second resistor wouldnt effect the current the led draws, so in this circuit why does putting a resistor on the cathode have an effect?

    i hope that may make it a little more clear about why im getting tripped up whit this circuit, i just apparently dont trace the current flow correctly i think of each segment as a normal led that either on or off.

    btw when i was an electrician in the unioin we had to do dc theory, but we really only solved circuits with ohms law they were all resistor capacitors mixes only. the point is i got an a becuase i just did what the book said but i remmber the teacher always getting frustrated becuase i always kept asking questions, i just really want to make sure i know how things work so i dont design bad stuff. itd be horrible to make this clock and think its fine then all the led blow up weeks b. Im currently reading through all about circuits and got a copy of the art of electronics. if i could afford it id be in school for this stuff
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-09-09 16:08
    1) It would help to eliminate the shilly-shallying:
    Pick a display, a known-good part, and stick with that -- focus like a laser beam.

    2) Resist any temptation to flail about (reversing components "in case" and that like.)

    3) Start with the simple and progress to the complex.


    This subject is getting kind of beat, it doesn't bring clarity to the Propeller scene, and so I think it ought to be moved over to General Discussion.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-09-09 18:08
    So, back to Hr. Kirchoff and his laws.

    KVL => The sum of the voltages around a loop are = 0
    KCL => The sum of the currents into a node = 0 (alternatively, the sum of all currents in = the sum of all currents out. )
    It's all about the zeros.

    KVL > If you take a battery, a resistor, and an LED and place them in series so that the LED lights, you can measure the voltages across each noting the signs. Add them up and the sum of the drops around the loop should equal the voltage of the battery. Add them and you should have zero. LEDs are not resistance. The voltage across them is a physical property that will not change (*at least until you let the smoke out). So for a 5V source, a 220 ohm resistor you will get around 2V across the (red/yellow) led with the remainder across the resistor.

    KCL > Same loop, open any points and you will measure the same value at any point. Parallel another LED and resistor, now between each resistor and LED you will read about the same if you used same parts. Or not if you chose a Red LED. So, measure the current out of the battery, then see how much in each LED branch, then where they tie together again. The total out of the tiepoint should be the same as the sum of the current in each branch. Put that to effect for segments and the sum for each branch will be out of the point they all come together.

    I also think that you are thinking of LEDs like regular lamps with a resistance to them. On or Off like a lamp which has a resistance and is rated for the supply voltage they are attached to. Not so for LEDs. The voltage drop is a physical property of the materials used to form the junction and will be a fairly constant value for the type you are using. The yellow one in the surprise pack seems to have about a 1.96V drop. Red was close but not the same, while blue and white were quite a bit higher. So, on to the seven segment display.

    Picture 7 red leds in parallel and all tied to one common pin on the anode side. Now it gets interesting. Since they all are about the same physically, they will all be fairly close in there V(forward) 1.8V and as they are all the same at the anode, they will present the anode side with the source voltage - the V(f) or about 3.2 Volts or so. NO MATTER HOW MANY are paralleled. Now, why the anode side is the wrong side to use. So, seven of these LEDs (segments) are all tied to a limiting resistor of say 470 ohms, you will have 3.2V/470= 6.8mA TOTAL which will be nearly equally divided up among the active LEDs causing inconsistent brightness and over current if you have used a low enough resistance to allow max rated current to each segment. All on with .97mA per LED, not good, probably dim with segments showing noticably different intensities. So, KCL total out of anode will be 6.8mA with each loop contributing ~.97mA each into the node.

    For the better way. Use a limiting resistor on the cathode side of EACH segment, you still have the same junction drop (remember invariable physical property of the diode junction) for each LED series connected for each limiting resistor. So if you wanted to have say 10 mA for each segment, you would again take [{source - V(f)} / current] here, [(5.0 - 1.8)/10mA] = 320, so choose the nearest common value and you have 330 ohms for each limiting resistor to the cathode. So one segment on, I total is ~10mA, all on about 70mA. Which you could then enable all via a single transistor as a switch on the anode as long as it can handle 70mA. Therefore, KCL, the total out is the sum of 10mA per segment into the node with the current of N*10mA per segment where N is the number of enabled segments. If you light 4, that means 4*10mA going into the node at the anode, and 40mA going out of the node.

    A seven segment display is just 7 leds placed in a plastic mold to enable forming number segments when lit. The segments are designed to be lit by a source and the common is tied to a return. single digit complete. Your 4 digit works the same way, but since it is intended that only one group be active at the same time, you will have all of the segment cathodes tied to the same limiting resistor you calculated before. All 'a's 'b's etc tied to their respective limiting resistor. Each anode of the 4 seven segment arrays are then individually made available so that they can be switched on separately to enable the return on a specific anode. By cycling through each array sequentially, you can through persistence of vision create a 4 digit display. Set first digit segments on, enable first digit transistor for a few mS. Do the same for the next and so on very rapidly and it will look like 4 simultaneous digits when in reality they are multiplexed. Because of the limiting resistors on the segment side, the display looks uniformly bright regardless of how many segments are active in any digit as long as the switch transistor in the anode side can sink the max current of all segments in a digit at once.

    Hope this helps. Try this experiment with a few LEDs of the same type.

    Hook all up to the anode side via a 470 ohm resistor and run your return through your meter in current mode. note the current for 1,2,4 cathode side to the source. So, +5V jumper wires to cathodes, anodes tied common to 470 ohm resistor, remaining resistor pin to current meter, meter to return. Measure the current. Move meter to cathode side. resistor to return in the meters place. now use the current meter to measure the current through one LED whil enabling two then four of the other LEDs. Note what happens to the current of the single metered diode. Remember that the resistor will always have the same current through it .

    Now, tie all anodes to one point and put the meter back in series from this point and to return. set each cathode with a 470 ohm resister to +5v. Note the current reading on the meter. Now remove the meter and tie the anode tiepoint to return. now undo one of the cathode resistors and insert the current meter. note its reading. Then do the same for each remaining leg. Do they add up to the reading you recorded from the anode side to return? They should.

    Have fun. After you understand what you are seeing, then think how it applies to the rest of the discussion you were trying to have in this thread. It should make a lot more sense to you then.

    Good luck,
    Frank

    @y'all. if any technical goofs or mis-statements on my part please feel free to correct me in this thread so that anyone attempting to learn from it does NOT go down the garden path unnecessarily..... thanks.FF
Sign In or Register to comment.