Shop OBEX P1 Docs P2 Docs Learn Events
12 V battery to BS1 — Parallax Forums

12 V battery to BS1

MRM100MRM100 Posts: 24
edited 2011-09-03 20:51 in BASIC Stamp
I have a small project using a BS-1 to drive relays for a linear actuator. I would like to use the 12v car battery for the supply voltage. I know there is a voltage regulator on the BS-1 project board, but I have read conflicting information regarding Vin: in one paragaraph, it is stated it is ok to use up to 15v, but if using battery supply (presumably dry cell), limit Vin to 9v.
So I was thinking of using Zener diode to bring voltage down to 7.2v - is this necessary?
Also, do I need to limit the input current or will the circuit in the BS-1 project board take care of this?

Thanks for any help.

MRM

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-29 10:59
    First of all, a car battery normally supplies 13.8V when fully charged, not 12V.

    The issue with supply voltages over 9V has to do with heat dissipation. The BS1, like the BS2, has a voltage regulator built-in. This voltage regulator dissipates as heat any voltage in excess of the 5V needed by the BS1. The amount of power dissipated depends on this voltage and the amount of current drawn through the regulator. The BS1 itself draws little current, but anything connected to its I/O pins contributes to this. When you drive relays, you normally use a switching transistor to actually control the relay (see Nuts and Volts Column #6 here). This transistor usually takes about 10mA to 20mA to turn on fully. Say you have 3 of these plus two LEDs that each draw 10mA to 20mA. That's a total of 50mA to 100mA. With a voltage drop of 13.8V - 5V = 8.8V, that could mean as much as 8.8V x 0.1A = 0.88W of heat. That's a lot under the circumstances. The voltage regulator would probably shut down very quickly to protect itself from overheating.

    It's much better to use some kind of external voltage regulator to bring down the input voltage. You could use an LM7808 to reduce the 13.8V to 8V. It's cheap and reliable. Just be sure to use a heatsink with it as well as a 0.33uF input capacitor and maybe a 1uF output capacitor rated at 10V or higher (see the datasheet for details). Alternatively, you could use a Dimension Engineering adjustable switching regulator and adjust it for 7-8V. With a switching regulator, you wouldn't need a heatsink.
  • MRM100MRM100 Posts: 24
    edited 2011-08-29 23:19
    Mike,
    Thanks for your reply. I will be using only 1 output at a time to a transistor for 7-8 seconds. I think heat will be low, but will incorporate the 7808 just to be sure. I have appended a circuit diagram. If it's not too much trouble, please let me know if you see any problems.

    Thanks again,
    MRM


    Circuit.jpg (77.8 KB)

    PS I don't know how to change this to "Problem Solved"...
    921 x 420 - 78K
  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-30 00:22
    The only thing I would suggest is to use a 22K or higher resistor in the line from the sensor instead of the 1K resistor. Leave out the Zener diode and the capacitor. The built-in protective clamping diodes in the Stamp will limit the voltage on the input pin to a diode drop (0.6V) above 5V as long as the current is within the diode's current capabilities (about 500uA or less). 13.8V - 5V - 0.6V = 8.2V. With a 22K resistor, the current is 372uA. You could use a higher value, like 33K to reduce that further and, depending on the sensor, you might want to use a small filter choke in the lead from the sensor to help filter out noise spikes. A Zener diode is too slow to use to protect against short noise spikes.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2011-08-30 08:46
    To set a message as solved, simply edit your original message, select Adavanced Mode and change the thread prefix. Let me know if you have any problems getting that to work and I will look into it. :)
  • MRM100MRM100 Posts: 24
    edited 2011-08-30 21:35
    Thanks again for taking the time to review my project. I got the idea for the Zener and Capacitor on the input pin from Nut and Volts Vol2 Column 53; so, it was not my original idea, but I am willing to learn the whys and hows...

    Anyway, to further describe the way the project works, The Sensor will be a lead taken from the output from the receiver (of an automobile's remote control) that unlocks the door. The Stamp will activate the output pin if the remote is pressed 3 times within 5 seconds.

    Okay- more answers lead to more questions: "small filter choke" is simply not specific enough for me to understand. I have no real experience using these, but I presume they are placed in parallel (like a capacitor). By small, do you mean 2.2 uH, 100 uH, ? Do they require a Diode to protect against collapsing magnetic field (like a relay)?

    Thank you,
    MRM
  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-30 22:36
    The remote control is going to have a pretty clean output, so you should only need the series resistor. One big question is what's on the other end of wire from the remote. If it goes directly to a relay or to the door lock solenoids, does the remote output have a snubber diode (protective diode)?
  • bsnutbsnut Posts: 521
    edited 2011-08-31 01:12
    I would suggest you to try a ULN2003A, which is transistor driver chip. The BS1 pin gets connected to the input side of the ULN2003A and one side of your relay coil gets connected to the output side of the ULN2003A and the other side of your relay coil gets connected to the positive supply voltage. The ground on the ULN2003A gets connected to your circuit ground, same as the BS1's ground.

    When the BS1 puts 5V on the input side of the ULN2003A, it causes the relay that is connected output side of the ULN2003A, to connect to ground, which causes the relay to operate.

    I will provide you the datasheet that I have for the ULN2003A as an attachment.
  • MRM100MRM100 Posts: 24
    edited 2011-08-31 05:22
    Yeah, I was thinking about this last night and, of course, right now that is the unknown. I am waiting for schematics, but if worst comes to worst (ie no schematic) do you think I can get away with: taking the input to the lock actuator and driving a transistor which then sends the signal to the Basic Stamp Input... ?


    Mike Green wrote: »
    The remote control is going to have a pretty clean output, so you should only need the series resistor. One big question is what's on the other end of wire from the remote. If it goes directly to a relay or to the door lock solenoids, does the remote output have a snubber diode (protective diode)?


    Addendum: Hmmm... I withdraw the question. Let me get back to you when I have more information...
  • MRM100MRM100 Posts: 24
    edited 2011-09-01 19:30
    bsnut wrote: »
    I would suggest you to try a ULN2003A, which is transistor driver chip. The BS1 pin gets connected to the input side of the ULN2003A and one side of your relay coil gets connected to the output side of the ULN2003A and the other side of your relay coil gets connected to the positive supply voltage. The ground on the ULN2003A gets connected to your circuit ground, same as the BS1's ground.

    When the BS1 puts 5V on the input side of the ULN2003A, it causes the relay that is connected output side of the ULN2003A, to connect to ground, which causes the relay to operate.

    I will provide you the datasheet that I have for the ULN2003A as an attachment.


    Yes, I see how it works, but what is the advantage? Comparing the Datasheets, both the 2n2222 and the ULN2003A can handle 500 mA and 40 V or 50 V respectively.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-09-01 20:59
    The 2n2222A is a standard bipolar switching transistor. The ULN2003A is a Darlington transistor array. There are several identical Darlington transistors and the Darlington transistors have very high gain, thus require very little drive current. For the 2n2222 to saturate, it may need as much as 20-25mA of base current. I'd have to look at the ULN2003A datasheet for a specific number, but the current needed is much less by several orders of magnitude.
  • MRM100MRM100 Posts: 24
    edited 2011-09-01 22:33
    I see. If I am reading the datasheet correctly, it looks like the Max input current is 1.35 mA @ 3.85 V.

    So, it look like all I have to be concerned with is Input Pin1, Output Pin 1, and GND Pin. Do I need PIN 9 (Common Free Wheeling Diodes) for anything?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-09-01 22:44
    You need to connect pin 9 to the power supply for the relay. Remember that any coil like a motor or a relay or solenoid will produce a voltage spike of the opposite polarity of the supply voltage when the current to the coil is turned off suddenly. The faster the current is turned off, the higher the voltage. This can destroy any device attached to the coil. The diode (one for each Darlington transistor) prevents / limits this voltage spike. Look at the Wikipedia article on "snubber diode" for a discussion.
  • MRM100MRM100 Posts: 24
    edited 2011-09-03 20:51
    Mike Green wrote: »
    You need to connect pin 9 to the power supply for the relay. Remember that any coil like a motor or a relay or solenoid will produce a voltage spike of the opposite polarity of the supply voltage when the current to the coil is turned off suddenly. The faster the current is turned off, the higher the voltage. This can destroy any device attached to the coil. The diode (one for each Darlington transistor) prevents / limits this voltage spike. Look at the Wikipedia article on "snubber diode" for a discussion.

    Yes, i understand a diode needs to go across the coil to allow a path for the induced current caused by the collapse of the magnetic field... It's just that I was unfamiliar with this Darlington circuit design and got confused by the the way the diodes were hooked in series. After I looked at it some more and thought about hooking it up the way you said, it makes perfect sense.

    Thanks.
Sign In or Register to comment.