i have an external battery and when i try to let the 9 volts through the transistor it only lets out 3? its just the normal 2n2222 transistor so i dunno? can it not handle 9 volts?
You need to give us more information. What's connected to what and how. The 2n2222 can certainly handle 9V depending on how it's connected and how much input current it's seeing (transistors are current amplifiers). When you want specific help, you have to give complete information, not "I hooked something up and it didn't work". What's the rest of the circuit? What are you trying to do?
thats all im trying to do right now, i was told to get one part working and move to the next.... basically the stamp cannot provide enough Current to power 3 relays at a time so they told me to use an external power source. so im connecting the external power source to the transistors C 1k resistor to the base then to P15 and the emitter to a voltmeter... then im testing it and its pumping out 3 volts....
You did not mention whether or not you have tied the emitter and the Stamp's Vss (Ground, GND) together. And trying to connect "through" a voltmeter (what it sounds like you are doing) is not the right way to measure voltage. Using just what you have listed, add one resistor (1K should be "safe" enough) between your collector and the "positive" side of your external power source. Next, tie your emitter to the "negative" (Ground) side of your external power source. Then connect the emitter to the Vss (Ground) side of the Stamp's circuit. Now, attach your voltmeter's probes on each side of the resistor connected to the collector. Lastly, attach the base of the transistor through an appropriate resistor (1K is fine) to your Stamp's pin.
Now, making the following assumptions:
1. You have correcxtly interpreted the transistor's data sheet and your circuit is set up according to the above description
2. Your external supply is providing 9V
3. Your Stamp is functioning correctly (i.e. not damaged due to previous miswirings)
4. I have not knocked this off too quickly for my morning tea to kick in (and I accept no responsibility for that possibility and the possible smoke escape pertaining thereunto...<g>)
A HIGH on the attached Stamp pin should result in a reading of ~8.3 V on your voltmeter and a LOW should result in a reading of 0 V.
Now, the above having been said (written, whatever...)...
All of this should have been relatively straightforward and simple if you had, indeed, read through and performed the experiments in the "What's a Microcontroller?" as you earlier claimed to have done. Do not continue with your own misguided (because of a lack of basic theory understanding) experimentation until you can answer the following questions about this circuit:
1. What is the value of the base current?
2. Why was your voltmeter not reading what you thought it should when you had things hooked up "your way"? (Exclude the effect of not having a "common ground".)
3. Why does your voltmeter only read 8.3V instead of the 9V you expected?
4. Why would you put a resistor between the collector and your external supply instead of just hooking it up directly?
The following is not a condescending statement:
Try not to skip steps in the excitement of this journey of discovery...I know that it can be very tempting, if for no other reason than "actually doing something" or "making your vision come to life" is (and should be) such an exciting prospect...but it's that whole "walk before you crawl" thing...we've all been there...
<teaching_mode=OFF>
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
Post Edited (Tom Walker) : 8/9/2006 2:13:26 PM GMT
alright but everyone says that but the mistakes im making have nothing to do with the WAM book... where in the book does it state anything about external powersources? where in the book does it state anything about making sure theres resistors from an external power source. You all say this but show me where in the book it says anything about that. Im making mistakes only once, due to the lack of knowledge on my behalf not because i dont understand...but because i have not read anything about it. you dont learn how to fix an engine without understanding how it works, if you dont read anything about pistons but understand how it works... you cant possibly fix it. i feel like im being pressured to read that stupid book over and over and theres nothing in there about the stuff im trying to do. theres one page on a transistor in the entire book so i dunno, correct me some more because i dont understand, but like i said.. i only make the mistake once.
·· You keep referring to a lack of information in the "What's A Microcontroller?" kit, but I am failing to see how what you're trying to do is related to a specific experiment in the book.· By all means if you feel we are lacking on material covered let us know and we will attempt to address it if necessary.· Thank you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support csavage@parallax.com
Thats exactly my point people keep referring me to the book WAM because i dont know how to get a transistor to be used with an external power source, there is no where in that book thats related to that. What this company lacks is sufficiently cought up by this wonderful forum which im grateful for, ive never had one account that i can remember on this forum where i was treated rudely regardless of my lack of knowledge and my failed attempts to understand the material presented to me. Regardless i was pointing out people say "Read the WAM" you lack basic electronic fundamentals.... but i dont understand where the fundamentals gained in WAM will come to part my answer for why the transistor is putting out 3 volts from an external power source.
This company makes alot of dreams acheivable by the great prices and thats why im still here! Its a hard life for a working 16 year old going to school and a job [noparse]:)[/noparse]
I think you may have a very valid point in that this problem was not specifically addressed in the WAM book., but it's been a while since I went through it and I'm not going to re-read it right now just to be certain.
Anyway, just to help you out, I think the Nuts and Volts column that comes closest to explaining what you are trying to do is this one:
I've found the Nuts and Volts columns to be a huge help when trying to figure out how to do something with one of the Parallax Stamps. But after reading through all 100+, it can be hard to remember where you saw what.
Please remember, we cover what we can as it relates to the purpose of the material.· Whenever it comes to learning more about the exact components used in a device you will have to do more research or takes classes on the given subject.· While we're very generous with our educational materials and making it freely available, there are limitations to how much we can cover.· Google will help you find more detailed information.· Forum Members can help guide you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support csavage@parallax.com
It is admirable to see a young fellow trying to accomplish something worthwhile. Without sounding critical, you were given numerous links to study that were packed with fundamentals on npn and pnp transistors. I am no EE, but I can turn on transistors and can offer some simple advice. I would suggest you re-read the earlier posts, and even the ones that I directly included simple schematics for transistors that you could not mess up! A transistor is (A). Cheap, and (B). only has a minimum of combinationms of hookup, so even if you had NO pin out, you'd still get one to work right in a few trys. In your case, only think of the transistor as a switch. Your pin from the Stamp is the singal to turn the switch on. Here is a hint: On the 2n2222, you put the Stamp pin to it via a 1k resistor to the CENTER PIN(base) on the 2n2222. That leaves ONLY 2 possibilities remaining for how to connect the GROUND and the relay. See the link below, the LOAD shown is the relay.
Rather than stay on the the path of searching for some elusive info that you think you have yet to come across, please go back and trace your steps, as the info is already there to run your motors. Save up $5 and get a breadboard, stop soldering until the breadboard works. Tie all GROUND together from multiple supplies.
There are 27,400 hits on google for 2n2222 relay driver . In most examples they are used as a SWITCH to take one side of the motor to GROUND, NOT to supply the +V, although that can be achieved as well. In a swiitching scenerio, you are either going to switch the +V OR GROUND to the motor. In an Hbridge, there are switchs for both +v and GND sides as the polarity needs to be reversed as desired, and thats why the NPN and PNP transistors are used, the PNP is usually shown switching the +v side, and the NPNs are usually shown switching the GROUND side. Someone please correct me if I am wrong, but I think this explaination will help you grasp why you use both types(npn/pnp) on an Hbridge. For now though, breadboard the schematic attached and tell us the results. I for one would be glad to hear that you got that much to work. ANOTHER HINT: WHEN YOU PUT A HIGH FROM THE STAMP TO THE CIRCUIT SHOWN
the transistor will read GND. Why? What happens if you bought a regular light switch that is found on a typical wall, and you put one side of the switch to GND, and you meter the other side.... as you switch flip the switch, you read ground in one position, and nothing in the other--same as the transistor, EXCEPT that when you put +V on one side of the relay, then when the Stamp is low, the +V goes THROUGH the coil, and to the one side of the transistor, making you read a HIGH when the Stamp is at LOW. But when the transistor is turned on, the transistor reads LOW. The opposite is true if switching a PNP transitor on the +V side of the coil. Stamp is High = Transistor output is HIGH.
Many are willing to help, but you must first at least show some progress and grasp of what has already been shown. At this point, you don't need WAM or anything else, you have been given the answer here to study and apply.
okay so your wanting me to breadboard that and post the results of what? that i got it done and it works correctly? i have one 2n2222 but i think its mixed in with the other crappy ones i bought from radio shack! hopefully it wont matter so i dunno ill definantly make this and post results for you guys, yea orginator ive never seen one used that way, the only way ive seen was using one either positive or negative not both, im curious to see how this one works out
Post the results if you can make the relay click ON when Stamp is High, click off when Stamp is Low, using that exact circuit. If it doesn't work, flip the transistor around the other way, but have the 1k in series to the Stamp!
If the Radio Shack ones are NPN use them, it doesn't matter.
originator, this in fact does work to drive the relay. i established this last time around but i did figure out when i try to drive three transistors to run three relays the microcontroller cannot give a continous ammount of current to controll all three. anyways ignore all that yes it did work!
Again, use pin 2 for the Stamp pin via 1k, leaving you only 2 possibilities for the transistor if you don't have a pinout.
Report the results please, taking note of how the relay works based on the current flowing into the base. You can meter the collector without the relay if you want as well. Getting an understanding is the key.
originator, im not too positive i have any PNP's i know there is one mixed with the 15 others in my case but im looking and because it was a grabbag of NPNs they are different models persay.·I will have to goto rdioshack in the morning and get a PNP resistor to test this, i understand how that transistor was working.
Ignore that comment it wasnt clicking what the load was haha i just hurried at as glance and thought okay? a resistor from the positive to the emitter? i corrected my self before attempting it and continued on. post results back shorly! oh... and i wouldnt neccicarily called it soldered to a PCB because its holes drilled into an electrical tape case haha! there is reasoning for this though, the resistors are micro minis and the positioning of the pins is not what you would consider normal
: :
.
it was like that... so you can see that trying to breadboard that the coils would end up going to the same row and the pins were way to short to bend to different holes.
Thanks for correction Beau. All I want is for Will89 to practice a few ideas to get an understanding. Hopefully he will see thr note before spencing too long on it if he has different supplys. I don't know a ton of stuff but thought that a more step by step approach might get him off the ground. That might be a challenge remotely. Any other corrections are welcome from more the experienced towards this approach. I am sure we'll soon see some progress.
will...89,
Page 265 of the "What's a Microcontroller?" text gives a brief introduction to the use of a transistor and points the reader to the "Industrial Control" text (also a free download) which, on page 86, explains what you are trying to do, albeit with a motor instead of a relay.
As Chris implied, the text is broadly based to allow the reader to get general concepts...not to provide ready-made solutions for them. Sometimes you gotta dig a little. Learning it is the fun part...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
Comments
You did not mention whether or not you have tied the emitter and the Stamp's Vss (Ground, GND) together. And trying to connect "through" a voltmeter (what it sounds like you are doing) is not the right way to measure voltage. Using just what you have listed, add one resistor (1K should be "safe" enough) between your collector and the "positive" side of your external power source. Next, tie your emitter to the "negative" (Ground) side of your external power source. Then connect the emitter to the Vss (Ground) side of the Stamp's circuit. Now, attach your voltmeter's probes on each side of the resistor connected to the collector. Lastly, attach the base of the transistor through an appropriate resistor (1K is fine) to your Stamp's pin.
Now, making the following assumptions:
1. You have correcxtly interpreted the transistor's data sheet and your circuit is set up according to the above description
2. Your external supply is providing 9V
3. Your Stamp is functioning correctly (i.e. not damaged due to previous miswirings)
4. I have not knocked this off too quickly for my morning tea to kick in (and I accept no responsibility for that possibility and the possible smoke escape pertaining thereunto...<g>)
A HIGH on the attached Stamp pin should result in a reading of ~8.3 V on your voltmeter and a LOW should result in a reading of 0 V.
Now, the above having been said (written, whatever...)...
All of this should have been relatively straightforward and simple if you had, indeed, read through and performed the experiments in the "What's a Microcontroller?" as you earlier claimed to have done. Do not continue with your own misguided (because of a lack of basic theory understanding) experimentation until you can answer the following questions about this circuit:
1. What is the value of the base current?
2. Why was your voltmeter not reading what you thought it should when you had things hooked up "your way"? (Exclude the effect of not having a "common ground".)
3. Why does your voltmeter only read 8.3V instead of the 9V you expected?
4. Why would you put a resistor between the collector and your external supply instead of just hooking it up directly?
The following is not a condescending statement:
Try not to skip steps in the excitement of this journey of discovery...I know that it can be very tempting, if for no other reason than "actually doing something" or "making your vision come to life" is (and should be) such an exciting prospect...but it's that whole "walk before you crawl" thing...we've all been there...
<teaching_mode=OFF>
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
Post Edited (Tom Walker) : 8/9/2006 2:13:26 PM GMT
·· You keep referring to a lack of information in the "What's A Microcontroller?" kit, but I am failing to see how what you're trying to do is related to a specific experiment in the book.· By all means if you feel we are lacking on material covered let us know and we will attempt to address it if necessary.· Thank you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
http://www.parallax.com/dl/docs/cols/nv/vol1/col/nv23.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Thats exactly my point people keep referring me to the book WAM because i dont know how to get a transistor to be used with an external power source, there is no where in that book thats related to that. What this company lacks is sufficiently cought up by this wonderful forum which im grateful for, ive never had one account that i can remember on this forum where i was treated rudely regardless of my lack of knowledge and my failed attempts to understand the material presented to me. Regardless i was pointing out people say "Read the WAM" you lack basic electronic fundamentals.... but i dont understand where the fundamentals gained in WAM will come to part my answer for why the transistor is putting out 3 volts from an external power source.
This company makes alot of dreams acheivable by the great prices and thats why im still here! Its a hard life for a working 16 year old going to school and a job [noparse]:)[/noparse]
Anyway, just to help you out, I think the Nuts and Volts column that comes closest to explaining what you are trying to do is this one:
www.parallax.com/dl/docs/cols/nv/vol1/col/nv6.pdf
I've found the Nuts and Volts columns to be a huge help when trying to figure out how to do something with one of the Parallax Stamps. But after reading through all 100+, it can be hard to remember where you saw what.
- Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
http://ww1.microchip.com/downloads/en/devicedoc/41233A.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
It is admirable to see a young fellow trying to accomplish something worthwhile. Without sounding critical, you were given numerous links to study that were packed with fundamentals on npn and pnp transistors. I am no EE, but I can turn on transistors and can offer some simple advice. I would suggest you re-read the earlier posts, and even the ones that I directly included simple schematics for transistors that you could not mess up! A transistor is (A). Cheap, and (B). only has a minimum of combinationms of hookup, so even if you had NO pin out, you'd still get one to work right in a few trys. In your case, only think of the transistor as a switch. Your pin from the Stamp is the singal to turn the switch on. Here is a hint: On the 2n2222, you put the Stamp pin to it via a 1k resistor to the CENTER PIN(base) on the 2n2222. That leaves ONLY 2 possibilities remaining for how to connect the GROUND and the relay. See the link below, the LOAD shown is the relay.
Rather than stay on the the path of searching for some elusive info that you think you have yet to come across, please go back and trace your steps, as the info is already there to run your motors. Save up $5 and get a breadboard, stop soldering until the breadboard works. Tie all GROUND together from multiple supplies.
There are 27,400 hits on google for 2n2222 relay driver . In most examples they are used as a SWITCH to take one side of the motor to GROUND, NOT to supply the +V, although that can be achieved as well. In a swiitching scenerio, you are either going to switch the +V OR GROUND to the motor. In an Hbridge, there are switchs for both +v and GND sides as the polarity needs to be reversed as desired, and thats why the NPN and PNP transistors are used, the PNP is usually shown switching the +v side, and the NPNs are usually shown switching the GROUND side. Someone please correct me if I am wrong, but I think this explaination will help you grasp why you use both types(npn/pnp) on an Hbridge. For now though, breadboard the schematic attached and tell us the results. I for one would be glad to hear that you got that much to work. ANOTHER HINT: WHEN YOU PUT A HIGH FROM THE STAMP TO THE CIRCUIT SHOWN
the transistor will read GND. Why? What happens if you bought a regular light switch that is found on a typical wall, and you put one side of the switch to GND, and you meter the other side.... as you switch flip the switch, you read ground in one position, and nothing in the other--same as the transistor, EXCEPT that when you put +V on one side of the relay, then when the Stamp is low, the +V goes THROUGH the coil, and to the one side of the transistor, making you read a HIGH when the Stamp is at LOW. But when the transistor is turned on, the transistor reads LOW. The opposite is true if switching a PNP transitor on the +V side of the coil. Stamp is High = Transistor output is HIGH.
Many are willing to help, but you must first at least show some progress and grasp of what has already been shown. At this point, you don't need WAM or anything else, you have been given the answer here to study and apply.
Keep at it
Todd
If the Radio Shack ones are NPN use them, it doesn't matter.
Ok great so hopefully that makes some sense to you.
"the only way ive seen was using one either positive or negative not both"
Will, that statement makes no sense in its present form, but lets move forward. If you will do the work, we'll get the car moving.
Please print out the schematic from what you just did and keep it handy.
OK next, will you get out a PNP transistor, and breadboard the schematic below.
It should turn ON the relay when the Stamp is LOW. So, you could make your variable say:
RelayOn = 0 'makes relay turn on
RelayOff = 1 'makes relay turn off`
Again, use pin 2 for the Stamp pin via 1k, leaving you only 2 possibilities for the transistor if you don't have a pinout.
Report the results please, taking note of how the relay works based on the current flowing into the base. You can meter the collector without the relay if you want as well. Getting an understanding is the key.
Ignore that comment it wasnt clicking what the load was haha i just hurried at as glance and thought okay? a resistor from the positive to the emitter? i corrected my self before attempting it and continued on. post results back shorly! oh... and i wouldnt neccicarily called it soldered to a PCB because its holes drilled into an electrical tape case haha! there is reasoning for this though, the resistors are micro minis and the positioning of the pins is not what you would consider normal
: :
.
it was like that... so you can see that trying to breadboard that the coils would end up going to the same row and the pins were way to short to bend to different holes.
Be careful with using that circuit. It will ONLY work if +Vs is less than or equal to the same voltage powering the stamp( in other words ... 5V)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Page 265 of the "What's a Microcontroller?" text gives a brief introduction to the use of a transistor and points the reader to the "Industrial Control" text (also a free download) which, on page 86, explains what you are trying to do, albeit with a motor instead of a relay.
As Chris implied, the text is broadly based to allow the reader to get general concepts...not to provide ready-made solutions for them. Sometimes you gotta dig a little. Learning it is the fun part...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...