Pins and LEDs (hopefully this is a stupid question)
firestorm.v1
Posts: 94
One more post, then I promise I'll shut up.
I am going to be designing a series of circuits for my BS2 that i can plug into the breadboard and have it show me via LEDs what the pin states are. If this works, I'll post a schematic and pictures as this might be really useful for some, myself included. :P
I'm thinking that something like this should work:
Vdd
(resistor)--LED--(data pin)---(LED)---resistor---Vss
+
^v^v^--|>|
()
|<|
^v^v^v----Vss
LED 0 LED 1
The idea being if the pin is HIGH, that the LED 1 will light, LED0 will be off, and that if the pin is LOW, the LED0 will light, and LED1 will be off. If the pin is floating or not bound, both LEDs will be off.
Does anyone else see a problem with this, assuming that the resistors are of correct value to prohibit blowing the IO pin or the LEDs?
Thanks yet again!
I am going to be designing a series of circuits for my BS2 that i can plug into the breadboard and have it show me via LEDs what the pin states are. If this works, I'll post a schematic and pictures as this might be really useful for some, myself included. :P
I'm thinking that something like this should work:
Vdd
(resistor)--LED--(data pin)---(LED)---resistor---Vss
+
^v^v^--|>|
()
|<|
^v^v^v----Vss
LED 0 LED 1
The idea being if the pin is HIGH, that the LED 1 will light, LED0 will be off, and that if the pin is LOW, the LED0 will light, and LED1 will be off. If the pin is floating or not bound, both LEDs will be off.
Does anyone else see a problem with this, assuming that the resistors are of correct value to prohibit blowing the IO pin or the LEDs?
Thanks yet again!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Why didn't I think of THAT!!!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Thanks again for your help, Back to the ol' drawing board and rolling pennies for parts.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
I have been wanting to learn more about TTL and electronics components in general. I'm also thinking about getting an SX development kit so I can start learning assembly as well.
One concern is that the formulas involved ask a lot about the SMD LEDs I don't know, like minimum and maximum voltages for visible light/no visible light. Am I correct in guessing that the forward voltage for both LEDs would be +5v? What do yall recommend as far as electronics online courses that I could pursue for learning circuit design?
I would recommend doing the projects page by page in the "What is a micro controller" book available free in the downloads section.
I started with a radio shack electronics kit and made circuits from the manuals using all of the major components you would typically use in a circuit.
Learn hands on what each of the components can do.
Buy "The Art of Electronics"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
V1 through V4 are typically pulled from datasheets, since you bought them surplus this may not be an option for you, in which case you will need to test this yourself.
Since they are surface mount you will need to make contact with each side to do the test, you can dead bug it (solder bits of wire to each side), or if it is large enough you could solder it between a couple header pins.
If you have a bench top supply, you can use it in current mode and adjust it's current where it is just off (for V1 and V2 measurement) then increase it until it reaches a reasonable brightness (for V3 and V4 measurement). If you bench top is digital you can grab these measurements straight from the Voltage display, else use a multimenter to record the voltage across the LED.
If you dont have a bench top supply you'll need to get a 10K linear potentiometer, preferably the multi-turn screw adjust kind and place it in series with the LED and a voltage supply (like the VDD output of the Stamp). Start off with the highest setting for the potentiometer and adjust it down until the LED just starts to light then back down to just off. Now use a multimeter to record the voltage across the LED this is your V1/V2 measurement. Now continue to adjust the potentioment until it iluminates to a reasonable brightness and record the voltage across the LED again, this is your V3/V4 measurement (also called Vf or forward voltage drop).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 5/16/2007 5:54:22 PM GMT
It just so happens that Fortune has smiled at me, I ordered a bunch of 10K pots for LCD displays that I already have. Unfortunately, I don't have a digital benchtop supply like you describe, but I do have a lot of regulated computer power supplies. I am hoping that will work just as well. If not, then I will use the stamp's Vdd per your suggestion.
If I am understanding you correctly, (thanks for your patience BTW) the V1, V3 measurements are in front of the LED, and V2, V4 are after the LED?
Ex: (Vdd)
10kpot---(V1/V3)---|>|----(V2/V4)
(Vss)
I'm also going to re-do some of the exercises in the WAM book, apparently it's been longer than I remember since I've done some of the exercises. Specifically ohm's law, etc.. :P
Thanks again!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
The 20mA sink / 25mA source limitation on the IO pins, is that per pin or across the entire device?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
I do have a couple of questions about the Ohm's law section of the book, but it's probably more common sense that hasn't just clicked in yet and would appreciate clarification (assuming I haven't chased you away with my odd questions)
1: on Page 320: it says that if I have multiple LEDs on P0-P7 that I need to use "bigger resistors" so that I don't draw too much current, I am assuming that means higher in ohms rating, like 1k instead of 440, etc...
2:On page 321, the book mentions "Diode Forward Voltage". The value associated with that term is "1.6V" Was that value obtained from the LED manufacturer or is that a known constant? I tried this on my homework board using the green LED and a 470 ohm resistor and got some different values. My Vdd shows as 4.97VDC, when I put the meter on each side of the resistor, it shows 2.988VDC and on the LED shows 2.005VDC. Is that correct?
3: On page 325 figure F4, it says that the total current for this device is 14.5mA, Doesn't the LED also draw current?
Thank you for your insight and suggestions, It's definately making more sense. [noparse]:)[/noparse]
Each color of LED is a different semiconductor, each semiconductor has a different band gap value. For Gallium Arsenide (red) it's 1.6V, for green it's a different value, as you've noted its around 2V, blues have even higher band gap voltage. The diode forward voltage is the band gap value when it starts to conduct and will raise slightly higher at higher currents.
A current of 7.23 mA is flowing through each LED, hence 14.5 mA is flowing from the I/O pin since it must supply 7.23 mA to each LED (the currents add).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Given that information about the LEDs, it sounds like with 4 LEDs would be over the 20mA limit, and that would be disasterous. [noparse]:([/noparse] If I used an inverter would the inverter supply the current for one of the LEDs? Would using a pair of transistors or an optoisolator work for moving where the current is supplied from?
If push comes to shove, at the very least, it looks like I can make a poor man's logic probe and use that for one or two pins at a time. I guess we will find out when the parts get here in a few days..
Thanks again for the information, I'm learning a ton more than I initially thought I would and I'm getting more and more excited about making other projects with the BS2.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
On another note, I just checked the electronics goldmine site, and they shipped my order. So it's only a matter of time now. Now to find an inverter or 2.. [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Looks like I'm going way above and beyond here with what was initially a simple circuit. What I might do then is have a self-contained 9V power supply that goes into a regulator, then to the inverters/LEDs, etc. Do you think that this is still a cool project to merit this work?
So checklist for this project: 74HC04 inverter (2) some manner of 5v regulator with a 9vdc input.. I already have the LEDs and the PCB headers for plugging into the breadboard.
Does Dallas or fairchild make regulators?
My concern is that if I create a tester 8 pin or 10 pin wide and all pins go high, the inverters won't kick in because they aren't turned on and the BS2 will then be driving all 10 leds and poof!....
On the upside I'm looking for a good 5v output voltage regulator that I can use where I don't have to make a monster-sized heatsink.. [noparse]:)[/noparse]
So are you using different colors or the same color for the 2 LEDs of each circuit?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 5/19/2007 2:47:17 AM GMT
As far as a regulator goes, shouldn't a 1A regulator definately have enough current available to drive the LEDs? I found this one: http://www.fairchildsemi.com/pf/KA/KA7805E.html The only question is output voltage. I know that +5v is the ideal voltage, but the regulator puts out between 4.5 and 5.5, Would that be a problem or is that still within the +5v tolerance?
This is getting even more exciting with every post! I can't wait to get the parts and start putting this together!
Now for a really stupid question, does Parallax have a minimum order? I thought they had $100 minimum but it would appear that is for PO orders only. Are you aware of a minimum for single-person orders? I might be able to get fairchild to send me some samples for the inverter, but the regulator is made by Nat Semi and they don't do samples. I would rather Parallax get my money if I have to pay for it rather than Nat Semi charging me a monster fee for a single regulator.. Although, if a lot of people like this idea, I might start building kits.. [noparse]:)[/noparse]
There is no minimum order w/ Parallax.
I haven't fully grasped what you are attempting, are you creating an I/O indicator for BS2 applications under development?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 5/19/2007 5:30:16 AM GMT
That's pretty much the gist of what I was hoping to achieve. If I had the money I would replace teh homework board with a BOE-Bot along with the USB Logic Analyzer and the USB o-scope for debugging and learning more. I had the bizarre desire to take a Netburner and figure out how to do some home automation with that and some BS2s, but that's some high-dollar stuff that might be better off being done with a SX chip. I think my next major purchase will be the Programming SX Plus kit on the website.
Heh, stating that there's no minimum order with Parallax is a very dangerous thing.. I wonder if I can convince my wife that we don't need a grocery budget for the next four months.. :P J/K, I have been seriously considering biting the bullet and enrolling in some EE courses at the local college here in town. It's more than just a fascination with me I want to be able to do both ends of the electronic jungle, build hardware to perform certain tasks, then write the software that makes the hardware do that task.
You have helped me so much with this project and I was hoping that we could have gotten this to work. I genuinely appreciate the efforts that you and the other commenters have put into this. Thank you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Again the inverter will be powered by a seperate regulator, D1 will light when the I/O pin is low and D2 will light when the I/O pin is high. R1 sets the brightness of D1 and R2 sets the·brightness of D2. I looked at the·74HC04 and it cant provide enough current for all six, let me look at other logic·families to see whats better at delivering power (likely LS or ACT).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.