Shop OBEX P1 Docs P2 Docs Learn Events
BS1 Going Bad? — Parallax Forums

BS1 Going Bad?

Kirk FraserKirk Fraser Posts: 364
edited 2005-05-10 14:30 in BASIC Stamp
Hi,

Recently I took an old BS1 Rev. D·purchased in 1994 off the shelf and based on advice given in another thread soldered in two TIP120's and supporting resistors and diodes to flip-flop 12 volts based on inputs from two other pins connected through limit·switches to the·BS1·5+ supply.· The BS1 was programmed and tested ok on my desk then I wired it in to control a hydraulic valve for testing.·

Unfortunately it didn't switch so I brought my voltmeter and found most everything looked OK most of the time but sometimes the BS1 would act up so only 1.2 V was comming out of the 5+ pin.· That disappeared when I reset the power.· Then I took it back to my computer to double-check my program and it couldn't detect any Stamp for many tries then it finally detected it but said to check the wiring for several tries then back to no Stamp detected.·

Questions:
1) Do BS1's often go bad or can these problems be fixed?
2) Can the Stamp 5+ supply enough juice·so pins will sense·switches 10-14 feet away through 20 Ga automotive wire?
3)·Should I abandon the BS1 for a BS2P or try a hardware only circuit?
4) I noticed the transistor on the BS1 was rather hot -- should I have something other than 12+vdc running the Stamp?
5) Any other questions I ought to ask?
«1

Comments

  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-05-01 07:06
    PS: If there was a way to enter a forum search, I would hope some of my questions may already be answered.
  • HansHans Posts: 12
    edited 2005-05-01 08:40
    There's a search button at the top of the page Kirk.
    Right in between 'calendar' and 'member list'.

    Cheers,

    Hans
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-01 15:52
    Hello,

    ·· What size resistor did you use on the TIP120's base?· The TIP120 is a Darlington Power Transistor and can't have a voltage higher than 3V on the BASE relative to the EMITTER, so you need to calculate your resistor value according to that.· Earlier discussions here on resistor sizes on a transistor referred to small signal transistors such as the 2N3904, 2N2222, etc.

    ·· In retrospect, I wonder if it wouldn't be better for those unfamiliar with using transistors to perhaps use a chip such as the ULN2803 or similar, which not only requires no resistors, but has the clamping diodes built-in as well.




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-05-02 07:03
    The resistors I used were 220 ohm.

    I'll order a ULN2803 and try it out. Thanks.
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-05-02 07:16
    Opps! I opined too soon... The ULN2803 is rated at 50V 500mA. I need max. 24V at 1A. In terms of power my need would be within tolerance but I'm not confident enough of my electronics knowledge to say the ULN2803 wouldn't act up under a higher current draw. Are you pretty sure that chip will do the job for me?

    Thank you.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-02 14:16
    Kirk,

    ·· In all honesty I think 220 is too small a value for the TIP120.· You're probably drawing too much current from the Stamp I/O pin.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • KenMKenM Posts: 657
    edited 2005-05-02 14:35
    If running only 1 TIP120 I don't think 220 ohms will exceed the stamp output current limit.

    (5-1.2)/220 = 17 mA. The limit is 20 mA, or am I incorrect?

    In any case though......220 ohms is waaayyyyyyyyyyy overkill. The TIP 120 has an hfe of 1000 at room temp.

    1 amp / 1000 = 1 mA

    3.2 v / 1 mA is 3200 ohms......Theorectical base resistor value for a TIP120 to drive 1 amp at room temp with 5 volts applied to the base via 3200 ohms.

    A 2.2k ohm base resistor should suffice.

    And then another option is to save yourself all this trouble and go to www.glitchbuster.com and get yourself a handfull of IRL520's at $0.67 each, $1.87 for shipping in the USA.

    Some use 10k on the gate to ground instead of the 100k I have shown.

    $0.02

    k



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ken

    Post Edited (KenM) : 7/24/2005 7:06:30 PM GMT
    869 x 555 - 53K
  • Tim-MTim-M Posts: 522
    edited 2005-05-02 14:49
    Hi Ken,

    In your example of using the IRL520, wouldn't it be best to protect the Basic Stamp pin with a small series resistor between it and the gate - say 220 to 1000 ohms - assuming·a worst-case failure scenario?

    Tim
  • KenMKenM Posts: 657
    edited 2005-05-02 15:16
    Tim,

    Yes, for a worst case failure.....gate shorted to drain or source....which is hard to do, but you are correct. I have never had a failure as described, but a 0.25 cents of protection for you $39 BS1 or $50 for your BS2 is not at all a bad idea.
    Tim-M said...

    Hi Ken,

    In your example of using the IRL520, wouldn't it be best to protect the Basic Stamp pin with a small series resistor between it and the gate - say 220 to 1000 ohms - assuming·a worst-case failure scenario?

    Tim



  • Tim-MTim-M Posts: 522
    edited 2005-05-02 16:13
    Thanks Ken,

    I haven't had a lot of experience using MOSFETs, so can anybody recommend the best resistor value to use in this case?

    Tim
  • KenMKenM Posts: 657
    edited 2005-05-02 19:59
    Tim,

    A resistor between the mosfet gate and stamp pin would be for Stamp protection only, a value of 330 ohms· should work.

    Using 10K ohms from the gate to ground will consume a little current, and in turn will drop some voltage across the 330 ohm resitor, leaving less than 5 volts at the gate to drive the mosfet. The gate voltage however will still be well over 4.5 volts, so I see no concern....on paper at least.

    The mosfet is a "charge" driven device, needing voltage to turn on, unlike·a typical bi-polar transistor that requires current to turn on.
  • Tim-MTim-M Posts: 522
    edited 2005-05-02 20:16
    Ken,

    Makes sense. The resistor from the gate to ground is simply a pull-down to make sure it turns off when not being driven and to eliminate false triggers due to stray noise, right?

    Tim
  • KenMKenM Posts: 657
    edited 2005-05-03 02:07
    Tim,

    Perfect!!!!!!!!!!!!

    Easy to prove it to yourself also......without a pull down resistor, activate some load by holding a 5v wire to the gate....then remove the wire, the load stays on !!!

    The first time this happened to me I was going nuts...then somebody explained it to me.
    Tim-M said...
    Ken,

    Makes sense. The resistor from the gate to ground is simply a pull-down to make sure it turns off when not being driven and to eliminate false triggers due to stray noise, right?

    Tim
  • Tim-MTim-M Posts: 522
    edited 2005-05-03 04:48
    Thanks for your respose Ken, I'm pleased to·know that I understand those details·correctly.· This is good.· I understand the two resistors forming a voltage divider and how that relates·to reduced voltage·driving the MOSFET gate, but I appreciate that being pointed out to remind me.· Also, thank you very much for your comments about a MOSFET being a "charge" driven device... I haven't had that explained before, and that really did a lot to help clarify several things in my head.· The best part is.... that these things are going to help me·from here on, and that's what I like the most.· Sharing brain power is definitely a good thing!

    Tim
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-03 14:52
    KenM said...
    If running only 1 TIP120 I don't think 220 ohms will exceed the stamp output current limit.
    (5-1.2)/220 = 17 mA. The limit is 20 mA, or am I incorrect?
    Ken,

    ·· Where are you calculating that voltage drop?· If it's from the 2 diodes forming the darlington pair, I don't believe that's going to be accurate since the diagram isn't necessarily exactly how this device is implemented.· Without a resistor the TIP120 will draw 120mA.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-03 15:02
    Tim-M said...
    Thanks for your respose Ken, I'm pleased to·know that I understand those details·correctly.· This is good.· I understand the two resistors forming a voltage divider and how that relates·to reduced voltage·driving the MOSFET gate, but I appreciate that being pointed out to remind me.· Also, thank you very much for your comments about a MOSFET being a "charge" driven device... I haven't had that explained before, and that really did a lot to help clarify several things in my head.· The best part is.... that these things are going to help me·from here on, and that's what I like the most.· Sharing brain power is definitely a good thing!
    Tim
    Perhaps the original poster could benefit from this thread going slightly astray?



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Tim-MTim-M Posts: 522
    edited 2005-05-03 20:27
    You bet Chris, we all can benefit I would hope, and yes, the thread did go astray!

    Tim
  • KenMKenM Posts: 657
    edited 2005-05-04 02:47
    Chris,
    To continue our topic astray......
    I·calculated the voltage drop assuming it is from the 2 diodes forming the b-e junctions of the darlington.
    I agree with your statement that the diagram isn't necessarily exactly how the device is implemented. I believe that is why the spec sheet reads "Equivalent Circuit."
    Out of curiosity I constructed the circuit shown below. I measured approximately 1.2 volts on the base lead with respect to ground. I attribute the result to 2 diode drops.
    In addition, this yields a base current of 17.2 mA. (5 - 1.269)/216.1 ~~ 17 mA(R1 measured 216.1 ohms)
    If there is another explanation for the ~1.2 volts on the base I am all ears. I love to learn new things, especially with micros and electronics yeah.gif
    Chris Savage (Parallax) said...


    Ken,

    ·· Where are you calculating that voltage drop?· If it's from the 2 diodes forming the darlington pair, I don't believe that's going to be accurate since the diagram isn't necessarily exactly how this device is implemented.· Without a resistor the TIP120 will draw 120mA.·
    Post Edited (KenM) : 5/4/2005 2:50:47 AM GMT
    219 x 396 - 10K
    710 x 505 - 32K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-04 14:36
    Ken,

    · No, I believe you were accurate if you tested it.· I've noticed on the TIP120 that there are a few datasheets which do not provide complete specs, and I didn't have one here to test.· When I suggested it I remembered the maximum BASE/EMITTER voltage, as well as the default current draw of 120mA, but couldn't remember what size resistor I had used, and as I said, without one to test I didn't want to be liable for recommending a part without an adequate circuit description to connect it, which you have kinly provided.· Thanks!· wink.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-05-05 19:11
    Ok, I appreciate the side discussion but now back to the original topic. I think my BS1's act up because of too much current draw from the 5v output on the Stamp. Is there a slightly beefier 12vdc to 5vdc power converter you'd recommend? Thanks!
  • KenMKenM Posts: 657
    edited 2005-05-05 20:04
    Kirk,

    My recomendation to turn on a "12 volt load' using your BS1 is·with a·IRL520.

    www.glitchbuster.com··· $0.67 each, $1.85 shipping in the US.

    I consider this recomendation a "no brainer", you hook it up and it works !!!!!!!

    No messing with calculating base resistors etc. I have used this device many times with success every time.

    The on resistance is low.....much less drop across this device than any bi-polar transistor I have used.

    Stamp pin0 high, your load is "on," stamp pin0 low, your load is off.
    Kirk Fraser said...
    Ok, I appreciate the side discussion but now back to the original topic. I think my BS1's act up because of too much current draw from the 5v output on the Stamp. Is there a slightly beefier 12vdc to 5vdc power converter you'd recommend? Thanks!
    869 x 555 - 53K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-05 20:28
    Kirk,

    ·· If you look back you'll see that I mentioned that I hoped this off-topic stuff would help you.· The information you need is there.· A few alternatives were given.· Good luck.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-05-05 20:56
    While I appreciate the off-topic discussion, to get back on to the original topic, I believe the problem with my BS1's is that my long lead wires to my limit switches draw too much current from the 5v chip supply. Does anyone have a slighlty beefier 12vdc to 5vdc converter circuit to share?

    Thanks,
    Kirk Fraser
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-05-05 21:05
    Opps, somehow I missed your last two replies do to my browser being in "off line" status. I ordered the IRL520 and 100K resistor from www.hobbyengineering.com and the delivery was prompt. I'll see if that solves the problem. But I'm betting my analysis on needing more 5vdc current is correct because another BS1 did the same thing when hooked up to a relay cascade starting with a 5vdc relay.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-05 21:16
    ·· Perhaps we should confirm your exact hardware connections one more time.· I'm not sure what you mean by a Relay cascade?· If you're using one relay to power another, that's probably going to be an issue, but I will wait for your reply to draw that conclusion.· wink.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • KenMKenM Posts: 657
    edited 2005-05-06 01:36
    Yeah, exactly with Chris's last post.

    Can you tell us exactly what you want to do?·· i.e.· " I want to energize a solenoid that is hooked up to a 12 volt supply and I want to use my BS1 to do it" or .....?

    Can you download the FREE program from www.expresspcb.com, and make a schematic?

    Are you trying to turn on a load/solenoid as shown in my previous post (about 4 messages ago)?

    K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-06 01:52
    ·· What I would like to know, exactly, is what all is being connected to each I/O pin.· Lately there has been a rash of people trying to control relays with other relays, when in almost every case they could control 1 relay.· Also it matters sometimes what exactly is being controlled in case of noise issues, which I have also seen a lot of lately.· Just trying to be accurate and complete.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-05-08 01:18
    Thank you all very much! The circuit with the IRL520 and 100K resistor works great!

    In the process of learning to use it I chose to use a Flip/Flop instead of a Stamp to eliminate sources of problems -- no internal 5v to drain, no program to do or go bad, no reprogrammable pins. I found I had to add 220 ohm resistors to ground in order to eliminate the float on the SR inputs to get reliable results. I burned one IRL520 out in my early testing but the circuit now is very reliable in my simplest application - testing a hydraulic unit.

    Now it's time to ramp up the circuit to use the BS1 for a little more complicated application to control the heat and air conditioner in my room to maintain 70degrees to improve my health. Since I have TIP120's installed already I'll try adding the 100K resistors as your diagram suggests and see if I can toss the 220's or if see if I have to use them to ground the pins to get rid of float errors. If that doesn't work I'll upgrade to the IRL520's since I know they work. I'll need to drive 12v relays to control my heat/AC units.

    The results of the second application will inform my use of TIP120's or IRL520's with my BS2P40 to run my most complicated and time-sensitive application to remote control my brother's farm equipment.
  • KenMKenM Posts: 657
    edited 2005-05-08 16:34
    Kirk Fraser said...
    Thank you all very much! The circuit with the IRL520 and 100K resistor works great!

    Since I have TIP120's installed already I'll try adding the 100K resistors as your diagram suggests and see if I can toss the 220's or if see if I have to use them to ground the pins to get rid of float errors.
    100k's with TIP120's ? Is that a typo on your part?

    ·
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-05-10 08:10
    KenM,

    Ok, I guess I misread -- I'm not clear how to make TIP120's work correctly calculating beyond the usual 220 to pin·(I've only taken Digital electronics)·-- I was thinking the similar diagram with 100K between base and·ground might be safer.· If not I guess I should give my TIP120's to my·teacher and just buy IRL520's since they work per your first diagram.· Your second shows 10K instead -- which is correct or best?

    Thanks,
    Kirk



    ·
Sign In or Register to comment.