Shop OBEX P1 Docs P2 Docs Learn Events
Controlling a 12V circuit — Parallax Forums

Controlling a 12V circuit

sylvie369sylvie369 Posts: 1,622
edited 2010-04-09 16:26 in Propeller 1
I want to use the output of five Propeller pins (from a protoboard) to control 5 12V devices. Four of the devices are simple lights, specifically these:

http://www.radioshack.com/product/index.jsp?productId=2062367

The other device is a piezo buzzer:

http://www.radioshack.com/product/index.jsp?productId=2062398#tabsetBasic

I'll need to be able to turn each device on and off separately. If it makes any difference, only two of the lights will be on at a time.

Assuming that the code needed will be just a matter of setting pins as outputs and then setting them high or low as necessary, I can handle the programming part. What am I going to need in the way of hardware? I'd like to keep it simple, of course. I assume that the 12V circuit powering the devices will need to be on the same ground as the Prop that will control them. I also assume that I can wire the grounds of all of the devices together.

This is for my rocket telemetry project. I want two red lights lit while the pull-pins are connected, and then those will go off and green lights will go on when the pull-pins (which indicate that the parachutes have deployed) are pulled. I also want the buzzer to sound briefly when the rocket reaches apogee, and again when each of the parachutes comes out, and then a longer buzz when the rocket lands. Again, the programming part is no problem. This is so I can watch the rocket instead of the little LCD screen where I'm currently displaying those events.

Post Edited (sylvie369) : 4/6/2010 11:09:32 PM GMT
2448 x 3264 - 2M

Comments

  • iQuitiQuit Posts: 78
    edited 2010-04-06 23:21
    Hi.
    It states that the buzzer will run on 4-24V, and will draw 5mA at 12. Try supplying 5VDC to the buzzer to see if it is loud enough for what you
    want to do. If so, run it on 5V, and replace the lights with LEDs. This arrangement would be much easier to implement. Otherwise, you'll have
    to use transistors. You already have 5V; from the supply you are using for the Prop.
    If need be, you could use optoisolators with current limiting resistors on the 12V side, and these would switch things on the Prop side of things.

    Hope this helps. More information would help regarding where the 12Vs is coming from.

    eyes.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "She may not be very pretty now, but she was somebody's baby once." Bugs Bunny
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-04-06 23:55
    Oh, good point. I'll give it a shot. (tries it) Oh, it does seem reasonably loud, though noticeably quieter than on 12V. If it were near the PA system mic it'd work fine. But I'm not going to get 5V from the Prop pins, right? Even if I were running the buzzer at 5V I'd still need some way of interfacing to a Prop pin, I think.

    I'm not that confident that I'll be able to see LEDs in the direct sunlight that we occasionally get out on the rocket range, though I'm not really sure I'll see these either. They're really dim at 5V.

    I still would like to see what the transistorized circuit would look like. If it's just connecting some 3904s, resistors and diodes·to each of the devices·that's not really a problem.

    The 12V will come from a portable battery (a Celestron Powertank, specifically). I'm also using it for a 7.5V input to power the Protoboard/LCD - I've used that out on the field already, on the first flight of this setup. My issue here isn't the power supply, it's interfacing the Prop to devices using 12V.
  • Chuck ThomasChuck Thomas Posts: 39
    edited 2010-04-07 00:18
    Why not try a ULN2803A. From the parallax site:
    The ULN2803A is a high-voltage, high-current Darlington transistor array. The device consists of eight npn Darlington pairs that feature high-voltage outputs with common-cathode clamp diodes for switching inductive loads. The collector-current rating of each Darlington pair is 500 mA. The Darlington pairs may be connected in parallel for higher current capability.

    It's pretty easy to interface.· I think it would work.

    Chuck
  • Mike GreenMike Green Posts: 23,101
    edited 2010-04-07 00:20
    Basically, you need transistor switches. You should have some kind of NPN switching transistor with the emitter grounded and the base connected to a Propeller I/O pin through a 330 Ohm to 1K Ohm resistor. Connect your buzzer or light to the collector and the +12V supply with a reverse connected diode if it's a buzzer (or motor or relay coil). If it's just a (12V) incandescent light, you don't need the diode.

    A 1K base resistor will give you about 3mA of base current. If the transistor has a gain of 33, that'll give you an output current of around 100mA. A 330 Ohm resistor will give you a collector current of maybe 300mA.
  • wyzard28wyzard28 Posts: 24
    edited 2010-04-07 07:04
    A suberb web page which shows what Mike has stated is here: http://www.kpsec.freeuk.com/trancirc.htm#ic . It includes showing how to calculate values for the various components--including picking the proper transistor!

    _richard
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-04-07 10:49
    Okay, perfect. Thanks, everyone. I'll be digging through that page to learn this stuff.
  • FredBlaisFredBlais Posts: 380
    edited 2010-04-07 11:47
    Mike Green said...
    If the transistor has a gain of 33

    I tought that transistor gain was a very varying paramater... is there any transistors that have a low hfe range, so that it is predictable?
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-04-07 19:30
    Some of the large current transistors have a low gain, if it quotes a high gain then it might be a triple diffused type, which is more or less a Darlington.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • w8anw8an Posts: 176
    edited 2010-04-08 02:55
    You can do this quite simply using the attached schematic.

    The drawing shows both the buzzer and lamp on the same circuit because they're both hooked up exactly the same. Of course you would need five transistors and five resistors--for your five 12 volt devices.

    Jameco pricing is $0.02/resistor and 0.05/transistor. So you're looking at 7 cents each, a 35 cent outlay of cash for five such circuits. smilewinkgrin.gif

    --Steve

    EDIT: Oops.. forgot the diode... Add another nickel to the total price

    Post Edited (w8an) : 4/8/2010 3:08:44 AM GMT
    545 x 358 - 8K
  • iQuitiQuit Posts: 78
    edited 2010-04-08 04:58
    The PDF for the buzzer said it was a piezo, so i don't think you need much in the way of switching. Don't think you need a diode, but one couldn't do harm.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "She may not be very pretty now, but she was somebody's baby once." Bugs Bunny
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-04-09 16:26
    An FYI, I've breadboarded an NPN circuit that seems to be working fine, following the help I got here. Thanks. I learned something as well.
Sign In or Register to comment.