Shop OBEX P1 Docs P2 Docs Learn Events
Car switch and BS2px — Parallax Forums

Car switch and BS2px

YoshtiYoshti Posts: 108
edited 2010-07-23 18:22 in BASIC Stamp
Hi all,
I've ordered my Maintenace book for my VAN (for mechanical and electric system).
So before I can get that book, I'm looking at How to (or best way at least) to use the BS2px and to control a switch.

The switch is the FOG lamps.· It is a flimsy switch and I think it controls a relay.

I want to be able to hook up the BS2 to it and turn on and off.·· I'm not sure if a Trans. NPN· can actually act like a switch in this matter.

So while I don't have the details yet of the wiring,· What is the best way to tap into the switch wires and have a PARALLEL switch.·

Most likely it's all 12 volts, and I assume that it's driving couple of amps... but the switch is very very flimsy ...

Any suggestions to what I should look at? in terms of Transistor or other means to SWITCH· ON or OFF.

Cheers

Yoshti

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2010-07-14 14:24
    The NPN transistor is a good choice to act as a switch to turn the relay on and off.

    The transistor will be in the relay coil circuit on the 0 volt side. If the existing switch is installed on the 0 volt side of the relay, the new transistor can essentially be wired in parallel with the switch.

    Before using the transistor, a diode must be connected across the relay coil to suppress back-EMF.

    The Stamp will drive the base of the transistor through a current limiting resitor, about 4.7K to 10K ohms.

    It is important at this stage of the project to know for certain how the wiring is arranged. Hopefully the manual will have the appropriate wiring diagrams.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-07-14 18:09
    ..... then remove the relay and drive them directly with a IRF510 or something, then you can control the two fog lights independently with the stamp via PWM smile.gif

    Ok, maybe I got a little carried away.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • YoshtiYoshti Posts: 108
    edited 2010-07-15 14:57
    Spiral...

    I like your thinking.... ! lmao .. nice idea!

    Now once I know how the wiring is setup.... then can see if doable.

    What if , just what if, there is no relay? just a switch. Then I imaging it would be simple anyway.
    My concern is that, if my wife drive the VAN, and just want to turn them on,· with the switch, not with the BS2 gizmodo.... I want to make sure I don't fry my BS2 when i use the switch manually... :-)

    Cheers...

    Yoshhhhhh...
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-07-15 20:19
    Yea, you'd run power through the switch after the relay.... The BS2 would still operate the relay.... if you happen to have the switch ON though, the BS2 wouldn't have an effect.

    Obviously the switch would have to be big enough. I don't know what the lights pull, but the auto parts stores have 10A lighted and non-lighted toggle switches that I've used in the past.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.

    Post Edited (Spiral_72) : 7/15/2010 8:33:31 PM GMT
  • YoshtiYoshti Posts: 108
    edited 2010-07-21 14:22
    Okay I got my book.

    Now the Electrical part of it, does not show any relay or other means to POWER on lights , other than the switch itself... Ouch!

    Anyway, would this : http://forums.parallax.com/showthread.php?p=924322

    be the best way to do it?·· Looks like this chip would be plenty to drive the lights...

    Though, I need to wait for the answer on that thread. But seems the way I read it, a PIN HIGH from BS2 would be enough to drive the chip ON and switch on the GATE for a 12V car use...·Am·I·reading right??

    CHeers

    Yosh
  • MoskogMoskog Posts: 554
    edited 2010-07-21 14:35
    Hi, why not take a look at Member supported FAQ on top of the BS2 forum. On page one you will find a relay-related discussion.

    Also look at erco's post at the bottom of page two!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    KjellO

    Post Edited (Moskog) : 7/21/2010 2:43:37 PM GMT
  • YoshtiYoshti Posts: 108
    edited 2010-07-21 15:28
    Hi,
    Just love it. YES I've read those post before. THANK YOU very much. Why do you think I'm asking a question OTHER THAN a relay option.

    You guys are not helping at all. You are just a NOOBIE killer environment. I'm quite fed up with this board.
    A student in a class, has question even stupid question.... Not all students will be or will ever be at the teacher's level. Some are born with ease to understand some area , yet other areas will never get it.

    So with that said, electronics for me is a "Can't get it right". Have a hard time to even catch the relation with volt and amps..if there is any.
    I've spent countless hours to read about 101 about it... I'm still strugling. And YES, I've done the What's a microc.. books , exercises, even some of them twice! THANK YOU !

    So, F.It, I'll be looking for other places to expand, "to my limited capacity" in electronics.
    Cheers
    Hope to never ever need to be asking a STUPID question where I get a RTFM again! Why do you think I'm asking... Because I do know, or don't understand it... DHU

    Yosh
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-07-21 19:07
    Sorry you feel that way, Yoshti, since this forum is one of the friendliest and most complete I've ever seen in my 20 years of experience. But you go ahead and try "other places".

    One point -- blaming others who are trying to help you, when you can't get it right, is not the most productive attitude.
  • YoshtiYoshti Posts: 108
    edited 2010-07-22 02:04
    ~S!~
    Heu, Where do I blame others for my limited little brain??? please re-read.... cause I do not say so...! Wow...
    Other places ...well there is a lot... I do take time to read. And I've been some places where a NOOB is more welcome than here.

    That friendly, hum.... not 100% for sure...but pretty good usually.

    Its those with a cocky attitude of know it all, and others should know the same that gets to me. Really not helping.
    I do understand however I have to do my part , and that's for sure.

    Anyway, nothing aiming at those, that are really guiding and helping others. \not even you allanlane5, I see your replies here and there, with great help. Usually I follow your comments, and I fix my problems... But do I understand them all .. nope, just its working after.. and I'm quite happy with that.

    So, in all it is a great place here, but sometimes it lacks the point of view of a noob. "Get me going and I will figure out later what I did..."so to speak...
    Cheers
    Yoshti. Not mad ... just saying ... 8-}
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-07-22 14:33
    "You guys are not helping at all. You are just a NOOBIE killer environment. I'm quite fed up with this board."

    Sounds like blaming the board for your own shortcomings to me.
  • YoshtiYoshti Posts: 108
    edited 2010-07-22 14:53
    Hi,
    That is not the way I read it...anyway... darn texting... does not come out the way you want it...

    Ho well...
    Cheers
    Yosh
  • YoshtiYoshti Posts: 108
    edited 2010-07-22 15:33
    Ok,
    Now question about the subject:
    If using a 2N2222 Trans to drive the relay, why do we need to put a diode across the coil?
    Would not the Transistor protect the BS2 pin?

    (from Erco suport FAQ page : http://www.kronosrobotics.com/Anotes/Relays.pdf
    on the Original Support page: http://forums.parallax.com/forums/default.aspx?f=5&p=2&m=326822 )

    Yosh

    OK never mind, I've re-read the doc. It does state, that the diode will protect the TRANSISTOR.

    So the DIODE is to protect any devices that drive the realy.. GOT it... takes me a while... but I get it sometimes.

    Y.

    Post Edited (Yoshti) : 7/22/2010 3:45:25 PM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-07-22 15:56
    Yup. When you turn the coil on, it creates a magnetic field around the coil that pulls-in the relay. When you turn the coil off, that collapsing magnetic field generates a current. You need to provide somewhere for that current to go. Now, a diode placed across the relay so that it is 'reverse biased' when you energize the relay. When you turn the coil off, the current from the collapsing of the magnetic field goes through the diode. It's not very much current, and it's not running for very long, so you don't need to protect the diode from over-current.

    If you don't have the diode in place, that small bit of current can short through the transistor in the "wrong direction", destroying it after only a few activations.
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-07-22 15:59
    Yea, ya got it.... keep in mind that 2n2222 can only switch around 100-150ma, so it MIGHT benefit you to put an ammeter in the power side of the coil (if it's possible) to make sure you can drive it with that transistor.

    If you can't check it, the wost you'll do is smoke a 50 cent transistor..... then step up to something bigger.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • YoshtiYoshti Posts: 108
    edited 2010-07-22 16:37
    K,
    Like your signature says... I've smoked many chips so far.... and LEDs too... Smells really bad...
    I'll check the ones I have and experiment with it...

    And REED or Solid state etc... I'm not sure which would be best. Since it is switching fog lamps... the way I understand it, I should go with general purpose relay or the low signal Relay, REED is out of the question and Solid state has too much resistance (which I don't understand the impact)

    Yosh
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-07-23 14:49
    Ah, go through DigiKey or Jameco or Mouser and look at their relay selection..... You don't have to buy anything, but it's good research. Jameco has a nice layout..... coild voltage / current, switching times, contact voltage / current ratings, etc, etc.... WAY more info than you need [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • sumdawgysumdawgy Posts: 167
    edited 2010-07-23 15:14
    Yoshti said...

    And REED or Solid state etc... I'm not sure which would be best. Since it is switching fog lamps... the way I understand it, I should go with general purpose relay or the low signal Relay, REED is out of the question and Solid state has too much resistance (which I don't understand the impact)

    Yosh
    Going solid state would avoid the need to have a damping diode.. (no coil & plunger to generate unwanted reverse voltage when de-energizing.)

    However, the resistance inherent in the design.....causes it to heat up but GOOD in high amp situations.· But the automakers are using them for most of the cars these days so you WILL find usable units that can take 10amps ..... on a hot day while near a hot engine... (hint hint)·· oh never mind.... I got to say it!!··· "PUFF!!" (I really tried not to say it.)·· Obviously, cost is the issue for durability.

    One issue I had, my fog lights were tied to ONE standard 10amp automotive relay.· When replacing my third heat failed relay...I added another so that each light drew from it's own relay....problem solved...(BTW, these were mechanical relays.)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Before you criticize someone, walk a mile in his shoes. That way if he gets angry, he'll be a mile away and barefoot. - unknown
  • YoshtiYoshti Posts: 108
    edited 2010-07-23 18:22
    Thank you all,
    With all this info, I'll hopefully - choose the right one(s). Will also see, how to add a BS2 controlled, cargo electric windows .
    They used the same type of switch to open or close them. smile.gif

    Cheers..
    Off I go to add VB2008 coding for it...!

    Yosh
Sign In or Register to comment.