Shop OBEX P1 Docs P2 Docs Learn Events
Output Voltage — Parallax Forums

Output Voltage

Claire_DrexelClaire_Drexel Posts: 4
edited 2012-07-15 05:55 in BASIC Stamp
I've attached two separate variable DC power supplies to the stamp as part of a double switch circuit with 2 transistors and 2 relays. Each relay/transistor set needs to be separate and associated with the high voltage and low voltage from the two power supplies. I need to know if there's a way to bypass the 5V regulator. I'm getting multimeter readings that have 5 volts added to what I set on the power supply, but one of them is coming out negative and I don't think the circuit is set up correctly. How can I connect my power supplies to get readings that are not adjusted by 5V?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-07-11 13:46
    It's impossible to say what to do without more information. Please make up a schematic of your circuit including marking the places where you're measuring the voltages that aren't supposed to be there. The Stamp has a regulator on the module that's normally used. You provide a voltage between 6V and 9V to Vin and ground and the built-in regulator provides +5V to the internal portions of the Stamp module. It also provides regulated +5V between the Vdd and ground pins. You can bypass the regulator if you can provide your own regulated +5V by attaching that to Vdd and ground and leaving Vin unconnected. It sounds like you've got something else going on though. I'd suggest figuring that out first before taking a chance on destroying the Stamp.
  • Claire_DrexelClaire_Drexel Posts: 4
    edited 2012-07-12 07:49
    Here's a schematic.

    Circuit Setup.jpg

    With this setup (which I copied from a previous researcher and fully understand does not make sense--especially connecting Vin to the grounds for each power source) I wrote a BASIC program to turn on the high voltage then off. Then Low voltage on and off. The high voltage is positive and reads on the multimeter as 5V above what the power source is set to. The low voltage is read as negative on the multimeter, but is also 5V higher than on the source.

    I would like to get an output voltage of about 2.5V from the low voltage and 6-7V from the high voltage, so although my external power sources CAN put 5V in, that isn't the output I want.
    960 x 720 - 63K
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-07-12 09:42
    I don't see any flyback diodes on the relays. Without these, you might have spikes upsetting the BasicStamp.

    Can you retry posting the whole schematic? You provided only 50% and there is no clear way to see where the voltages might double.

    Also, if you are drawing the schematic from memory, please verify it is what you built as there may be actual wiring errors involved that we cannot recognize.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-07-12 10:06
    Your schematic doesn't make any sense to me. There's no description of which relay pins are which and what they do. Please label everything. On the power source, label with the voltage and polarity (+5V,-5V or whatever). If you're trying to drive the relay directly from the Stamp, you need to know the current and voltage requirements of the relay coil since the Stamp can only supply a limited amount of current without damage. As mentioned, you need to have a diode (like a 1N4001) connected backwards across the relay coil. What kind of transistor is used? You may be damaging the Stamp and/or the transistors by not having base resistors (see Nuts and Volts article). If you're using a HomeWork Board, that will have suitable resistors built-in.

    See Nuts and Volts Column #6 for a discussion of how to control relays using a Stamp. Go to Parallax's main webpage and click on the Resources tab. You'll see a link to the Nuts and Volts Columns index and find #6.

    You may need to start all over from scratch. What is this for? What is it supposed to do?
  • Claire_DrexelClaire_Drexel Posts: 4
    edited 2012-07-13 08:20
    This circuit is a small part of a larger research project for designing a high pressure optical cell. This circuit is designed to provide a shape memory alloy spring with high and low voltage. I first want 3 seconds of high voltage and then off for 3 seconds, then three seconds of low voltage. I would think this is pretty simple, but when I am dealing with relays and transistors (and now I'm learning about the importance of diodes) I'm a bit out of my comfort zone as a mechanical engineer. I will read the article #6 and see what I can glean. I haven't read anything about current requirements for the relays I'm using. All I know is the input, output, and ground nodes on them. I'm using two irf520 transistors.

    The starting from scratch idea is sounding tempting. I am still a little confused why you keep mentioning the +5V and -5V from the power sources. I am not setting my external power supplies to this voltage. I'm setting them to my desired low and high voltage outputs of 2.5V and 7V respectively. Am I not supposed to do this? If so, how can I get my desired output voltage if I'm only dealing in +5V and -5V?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-07-13 08:36
    THIS WAS SUBSTANTIALLY RE-EDITED, IGNORE THE ORIGINAL AND READ THIS INSTEAD.

    The 'internal diagrams' of your relays seem to be very much in error. I can understand that the relays are intended to be Double Pole Double Pole relays that are being used as a simple Single Pole Double Throw switches, but it seems that you have connects where none should be.

    As it is, it seems one relay is being powered at 2.5volts and the other at 6.5 volts -- not a good idea. Relays need a correct voltage and adequate amps to properly engage. Standard relay coils are 5, 6, 9, 12, and 24 volts DC or 120 and 240 VAC.

    One relay might be enough to switch between High and Low voltage, so why two? You want the relays to provide an off condition as well. Maybe a redesign of one relay to handle the Power ON/OFF and the other to handle the HIGH/LOW as a single output would make your life simpler.

    It seems as if you have the High voltage and the Low voltage going to the coils (at 7 and 8) and the relay switches. But Grounding the switches in an off condition is not necessary and may be unwise if power is available. This may cause a short circuit condition.

    The relay coils might be adapted to be powered by 6.5 volts and controlled via the transistors going to the Basic Stamp. But are you going to have to reduce the voltage to drive the coils at some other specified voltage (6 Volts or 5 volts are usual - read the relay lables). 12 and 24 volt relays need a voltage near those levels.

    Are you using one power supply with 2.5 v and another with 6.5 v and a common ground to get 6.5 V in HIGH and 2.5 volts in LOW? What is powering the BasicStamp and at what voltage?

    http://en.wikipedia.org/wiki/Relay

    Your transistor diagrams offer no information as to whether they are PNP or NPN or where the Collector, Base, and Emitter are connected. Leaves much to the imagination. Polarity may be all wrong. What are the transistors 2n3904 or 2n2222 or ????

    Where are you going to get 5 volts regulated for the BasicStamp from if you by-pass the BasicStamp's regulation?

    Only half of the multimeter circuit is shown. The dashed line makes no sense in the way it is used. Do you really want to seperate outputs to provide 2.5v to one location and 6.5v to another; or could just one output shifting from High to Low be appropriate?

    If you are using an adjustable dual bench power supply, life is easier --- BUT you may have to drive the relays at some other proper voltage. Where you get that other voltage from needs consideration. The relay coils are isolated from the switches and can have a independent power source controlled by the BasicStamp.

    A complete redesign would make your life much easier than relying on something nobody understood after the other person left.

    You might consider to re-program the Basic Stamp for one pin to toggle High and Low and another pin to toggle on and off. That would be more conservative and logical than having one pin High and the other pin Low as you can get a simultaneous 'on' condition if both pins go High due to a code error. Or do you really require a simultaneous condition on two separate outputs?

    Before you get to far into this.....
    Test the High/Low circuit without the BasicStamp - just provide 5 volts to the transistor base. Do the same with the On/Off
  • Mike GreenMike Green Posts: 23,101
    edited 2012-07-13 08:50
    I mention +5V and -5V because the Stamp has to get power from somewhere and all power supplies have a + and - terminal even if one of these is connected to the circuit's ground. Normally the Stamp uses a 6-9V power source and regulates that down to 5V for internal use. Whether you can use your 7V power source or not for this depends on the current needed for the memory alloy device and how much current the 7V power source can supply without the voltage dropping significantly. Remember that the relays will need some power too and the voltage requirement depends on the relay, so you'll need to find out what the relays require for coil voltage and current.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-07-13 09:37
    Re-edited my posting above several times as it got very awkward. Please take a look at the revised version and consider a redesign. You may not like my redesign, but some serious redesign will be required as there are significant flaws in what you have provided.

    @Mike
    A clear explanation of all the available power supplies from Claire_Drexel would help all of us.

    The bad readings on the multimeters with 5 volt offsets is likely due to having the transistors wired improperly. She is lucky if there is no real damage as a negative voltage to the BasicStamp output pins would be fatal.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-07-15 05:55
    Assuming that the BasicStamp is programmed correctly, The attached image can be duplicated twice to generate a low and a high voltage output.

    Since one relay or both relays would be off, the two outputs can be connected together and drive for motion.

    The only thing I would change is the 10K resistor between the BasicStamp output and the transistor, that is way too high. Some would say 240ohms, but I would use about 1000ohms and 2n2222 transistor with a 5 or 6 volt relay. Actually any value between 240 and 1000ohms would likely work well, below 240 might damage the BasicStamp I/O
    244 x 206 - 7K
Sign In or Register to comment.