From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching from positve or negative voltage to zero

Hello everybody. I am using labview with my senior design project and I am running into a few problems. I am using labview to output a positive or negative voltage through the serial cable and ultimately cause an actuator to extend and retract with the simple press of a button. Using the DTR pin and RTS pin, changing them to write, and wiring in an enum to them I got it to where the voltages will switch from positive to negative. Currently if the button is not pressed the output is asserted and reads +5 volts. If the button is pressed the output is unasserted and reads -5 volts.

 

My question is how do you change this to instead of switching from positive to negative it switches from positive to zero or negative to zero. In the end i want to have two different buttons each reading a zero voltage when nothing is pressed. Once you press the button depending on which one then the output will be +5 volts or -5 volts. To offer a better understanding the two different pins coming out of the serial port will go into two diffent relays.  These relays will also have power converters connected to them as well as the actuator itself.

 

My senior design project is assistanting a handicapped individual with their pursuit of finding employment so any ideas you may have will be appreciated. Thanks in advance for any help you can offer. 

 

0 Kudos
Message 1 of 16
(4,184 Views)

I already answered your question in your original thread.

 

However, this message actually gives more detail.  You might be able to use a diode arrangement, or some sort of buffer system to do this.  But I'd leave it up to someone with more of an electrical engineering background to propose how to do this.

0 Kudos
Message 2 of 16
(4,181 Views)

So you want two buttons.  Button one will cause extension of the actuator and Button two will retract the actuator, right?  If neither button is pressed, the actuator is de-energized.  Will the actuator stay energized as long as one of the buttons is pressed?  What happens if both buttons are pressed simultaneously?  How does the actuator behave when de-energized?  Does it maintain its last position or does it return to a neutral position?

 

As in any engineering project, you must get the specifications clearly defined before you begin designing or building the device. 

 

What is the scope of your project? Mechanical, electrical, software, medical?  What is your background and who else is on your team, if any?

 

Lynn

 

MSEE and former teacher of senior projects.

Message 3 of 16
(4,174 Views)

Yes it is two buttons. Its a hold down latch button so If neither button is pressed then I want no voltage coming out of the serial port and therefore nothing to switch the relays to power up the actuator. If i hold down one button I want it to output positive voltage for however long I hold down the button out of that particular pin. If i hold down the other button then I want to output positive voltage for another pin however long its pressed and then return to zero voltage. My problem is I can't get it to stay zero volts but instead its always postive or negative so the relay is constantly switching depending on what position the button is in and thus the acutaor is constently going up or down and not staying in place. To answer some of your other questions, the actuator remians in place when its not energized. You will have to hold down these buttons with your mouse so you should never be able to hold down both buttons at the same time.

 

All your questions about scope of work , background, and team members makes you sound like a former teacher but has little to do with my problem. I am majoring in electrical engineering and our project is creating a computer workstation suitable for a handicapped individual we are working with.

0 Kudos
Message 4 of 16
(4,158 Views)

@Ravens Fan,

 

Sorry for posting on my last thread the same question as on this new post. I am new to the whole forum stuff and didn't know that you would be notified if I replied to your response on a thread from weeks ago. I read what you put on my last thread. So your saying that since I am using a serial port then its not as easy to get it to switch to zero volts? You were the one who told me how to switch from positive to negative and that helped me out alot on the last thread. Is there a way to adjust the voltage output? Maybe I can get it close enough to zero that it doesn't output enough voltage to switch the relay. If this is the case maybe i can make a higher voltage such as +12 volts when its asserted and +0.5 volts when its unasserted. If you have any ideas how I can accomplish this it will be appreciated.

0 Kudos
Message 5 of 16
(4,156 Views)

 


uncc wrote: 

All your questions about scope of work , background, and team members makes you sound like a former teacher but has little to do with my problem. I am majoring in electrical engineering and our project is creating a computer workstation suitable for a handicapped individual we are working with.


Actually, it makes him sound like an engineer. You know, what you're trying to become.

 

 

 


Is there a way to adjust the voltage output? Maybe I can get it close enough to zero that it doesn't output enough voltage to switch the relay. If this is the case maybe i can make a higher voltage such as +12 volts when its asserted and +0.5 volts when its unasserted. If you have any ideas how I can accomplish this it will be appreciated.

You cannot control the exact voltage of the serial port. The serial port is not intended to be used as a DAQ device, and consequently has no "zero" volts. The serial port voltages are a function of the driver that the manufacturer of the computer decided to put on there. You may wish to peruse the Wikipedia page on the RS-232 protocol: http://en.wikipedia.org/wiki/RS-232, with a specific look at the voltage levels. If you need to be able to control the voltage level then you need to use either a programmable power supply or an inexpensive DAQ device, such as the USB DAQ devices that NI makes.

 

0 Kudos
Message 6 of 16
(4,145 Views)

As others have mentioned the serial port is not adjustable.  And because many manufacturers use different circuits with varying degrees of compliance with RS-232, your design must accommodate ranges of voltages.  Zero is not in either range.

 

This is why I was asking you to define the task in terms of desired outcomes rather than in terms of voltages you will not be able to get.

 

I have been both an engineer and a teacher of engineering students.

 

Here is your Forum assignment: Tell us how you will control two relays using the nominal voltages produced by a handshaking line of an RS-232 port.

 

Hint 1: Look up the values specified by RS-232.

Hint 2: While you are looking up the voltages check to see how much current is available.

Hint 3: You will need to design an interface circuit to manage the voltages and drive the relays.

 

You can also buy the whole thing, but you would not learn much that way.

 

Lynn

0 Kudos
Message 7 of 16
(4,140 Views)

I am new to using labview as well as communication through the serial port so bare with me when it comes to answer these questions. I have only used labview once before to communicate to the AtMega board. I am using the relay technique because I wanted to avoid using the AtMega 128 board and having to do more programming. The voltage through the serial port only needs to be enough to switch the relay (5 volts). Each relay will also be connected to an ac/dc converter that will produce enough voltage and amps to power the actuator. By doing this I assumed no physical circuit will need to be created to adjust the output voltage. 

 

From looking up info on the serial communication and from what everybody has been posting, its not as simple as intializing something to zero in labview. I know of a way to make it work but it requires using four relays instead of just the 2. It looks like it would have been easier to use parallel port.  

0 Kudos
Message 8 of 16
(4,136 Views)

Try googling "transistor serial relay".  You should be able to find some example circuits that would work with relays and a some of transistors and resistors.

0 Kudos
Message 9 of 16
(4,133 Views)

 


@uncc wrote:

I am new to using labview as well as communication through the serial port so bare with me when it comes to answer these questions. I have only used labview once before to communicate to the AtMega board. 


You're missing the point. This has nothing to do with LabVIEW, and everything to do with voltages and currents. The kinds of things that an electrical engineer (including someone that's supposed to be majoring in it) is supposed to know about. The issue is that you cannot say with certainty that the "high" voltage of a serial port will be +5V. As noted in the link I showed you, it could be as high as +15V. The "low" could be as low as -15V. Thus, your circuit has to account for this if you wish to use the serial port.

 

 

 


From looking up info on the serial communication and from what everybody has been posting, its not as simple as intializing something to zero in labview. I know of a way to make it work but it requires using four relays instead of just the 2.

 

This is not brain surgery. You do not need 4 relays.

 

 


It looks like it would have been easier to use parallel port.  

Guess again. The parallel port's voltage can be +5V or +3.3V, depending on the manufacturer of the parallel port interface circuitry. The parallel port is also not designed to drive regular relays. You would need to get the exact specifications of the parallel port in terms of what its current source/sink capabilities are, and compare these to the relays you intend to use. This, though, guarantees that you will be restricted to using that exact computer. Do you really want to do this? I doubt it. That's why you need to use an interface circuit between the port and the relays. A simple Google search (as Ravens Fan suggested) will yield tons of information on this.

 

0 Kudos
Message 10 of 16
(4,126 Views)