How to use BS2 to control motors, lamps, etc
EliTe
Posts: 6
Hello everyone,
··················· this is my first forum so i hope i get a few responses.· I have been trying to desing an RKE ( Remote Keyless Entry) system.··So far I have successfully encoded, transmitted·, receieved, and decoded my signal.··I wanted to take the outputs of my decoder ( roughly 20mA ) and feed it into the BS2's input pins.··Next have the BS2·start the correct device based on the switch inputs.· I was hoping to·drive a motor and lamp.· I know the stamp doesnt provide enough current to drive these devices.··I know I·will probably need something like a relay but I am·still a·little uncertain because·I am not familiar in this area.· I would appreciate any help or suggestions I can get.· Thanksss.
p.s Would the BS2 be damaged if I provided 20mA current on 4 input pins simultaneously?
··················· this is my first forum so i hope i get a few responses.· I have been trying to desing an RKE ( Remote Keyless Entry) system.··So far I have successfully encoded, transmitted·, receieved, and decoded my signal.··I wanted to take the outputs of my decoder ( roughly 20mA ) and feed it into the BS2's input pins.··Next have the BS2·start the correct device based on the switch inputs.· I was hoping to·drive a motor and lamp.· I know the stamp doesnt provide enough current to drive these devices.··I know I·will probably need something like a relay but I am·still a·little uncertain because·I am not familiar in this area.· I would appreciate any help or suggestions I can get.· Thanksss.
p.s Would the BS2 be damaged if I provided 20mA current on 4 input pins simultaneously?
Comments
Post Edited (Paul Baker) : 4/12/2005 10:00:59 PM GMT
·· The 1K resistor to the 2N2222 applied for the type of load in the message.· Let me clarify...If you are trying to drive a 5V-24V Relay, 5V-30V Lamp,·Super Bright LED/LCD Backlight, Speaker·or Small motor, small signal transistors such as the 2N2222 and 2N3904 are a cheap way to drive them.· And you should always use a resistor between the base of the transistor and the Stamp pin.· I always recommend 1K because it provides more protection in a fault situation than a 220 ohm resistor does when switching more than 5V.· The emitter of these NPN transistors go to ground, and the collector goes between the load device and it's positive voltage.· Your application may require a protective diode (Such as driving relays).
·· Now, if you need to drive a high-current device, you would need either a MOSFET, Power Transistor or Current Driver chip, such as the ULN2xxx series.· Some of these are safer choices to use when in doubt.· I don't want anyone to see all these posts and think 2Nxxxx transistors are the solution to all problems.· Jon Williams will often recommend the ULN chips, and others will recommend the FETs given a particular application.
·· When in doubt post your intended devices here and people will recommend the various drivers for handling the given load.· There's no one solution that covers everything, although there are several that come close.· Take care!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Thanks for the advice. I looked at the Nuts and Vol Column #6 where they discussed using the ULN2003 ( as you suggested). Seems like it's what I need. So just to make sure, I should insert the output of my BS2 into ULN2003 and have a motor ( most likely a stepper motor but any will do at the moment ) connected to ULN2003's output. Should I still use resistors on the input and output BS2 pins just to be safe? Also a quick question about the motor connection. Will I connect the output of the ULN2003 as the motors ground and ULN2003 power supply ( pin 9 ) as the motor's power supply? Thanks again for the advice. Really appreciate it.
·· You don't need resistors between the Stamp I/O pins and the ULN2003.· Also, the ULN2003 connects outputs to ground, so you will still need to supply the positive voltage to the device.· So, to answer your second question, yes.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com