LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting solar panel strings in parallel using relays

 Hello all,

I am working on a project for my Mechanical Engineering class on Mechatronics. The project is based around solar panels, my team needs to use the MPPT 150/70 – MC4 VE.Can, the DAQ-6212 and control 2 relays that will connect 2 panels that are in series with 2 other panels in parallel (i will provide a drawing). I have no idea how to program this, or if i can even control and use the relays with the DAQ. The Voc for each panels is 43.4V,  the Isc is 12-15A. I would appreciate any help and tips possible 🙂

 

IMG_0233.jpeg

0 Kudos
Message 1 of 13
(361 Views)

Can one use USB-6212 to control relays? yes, absolutely, some additional circuit needed however.

 

Once you connect USB-6212 with relays, can you develop a program to control the relays in a manner to mix-match the connections? yes, some program has to be developed in a language (LabVIEW, C, .NET, Python, MATLAB etc.,)

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 13
(353 Views)

My suggestion would be to use the DIO outputs from the DAQ-6212 to control the low side of both relays.  Connect the +Supply to the +side of the relay coil (If these relays do not have a flyback diode, it is a good practice to add such as close to each coil pins as possible).  Now connect the negative side of the relay coil to the high side of the digital output.  Lastly, connect the negative side of the digital output to the -supply.

 

The DAQ-6212 can provide up to 2 mA using the Analog Outputs or 16mA max using the Digital Outputs.  Get two 6V relays with contacts that can handle the necessary current produced by the solar cells.  The coil impedance needs to be within the parameters of Digital Outputs.  Looking at a 600-ohm coil would give 16mA * 600-ohms per relay.  As there will be two relays in parallel, the coil resistance would be halved.  [16mA * 300-ohms = 4.8V] The 6V relays would need to be able to operate with a supply voltage of under 4.8V or you need to find relays that have a higher coil resistance in order to remain below the 16mA max current of the Digital Outputs.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
Message 3 of 13
(345 Views)

From Chat GPT 

To use digital I/Os (Input/Output) on the NI DAQ-6212 to actuate relays, you'll need to follow these general steps:

1. **Setup**: Make sure your NI DAQ device is properly installed and recognized by your computer. You should have the necessary drivers and software installed (like NI-DAQmx).

2. **Connect Relays**: Connect your relays to the digital output channels of the DAQ device. Typically, relays have two connections: one for the signal (control) and one for the load (the device you want to control, like a light or a motor).

3. **Power Supply**: Make sure your relay board has its own power supply if required. Some relays may need separate power especially if they are driving higher loads.

4. **Configure Channels**: In your programming environment (such as LabVIEW or Python using NI-DAQmx library), you need to configure the digital I/O channels as output channels. This can usually be done using the DAQmx Configure Digital Output Task function.

5. **Write Data**: Once configured, you can write digital data to these output channels to control the relays. For example, you can write a digital high (1) to turn the relay on and a digital low (0) to turn it off.

Here's a basic example using LabVIEW:

- Open LabVIEW.
- Create a new VI (Virtual Instrument).
- Add DAQmx functions to configure digital output channels and write data.
- Wire these functions together.
- Specify the channels you want to use and the data you want to write (0 or 1 for turning the relay off or on).
- Run the VI to control the relays.

Here's a basic example using Python with NI-DAQmx library:

```python
import numpy as np
import ctypes
import time
import nidaqmx

# Define your digital output channel
channel = "Dev1/port0/line0"

# Create Task
with nidaqmx.Task() as task:
# Configure the digital output channel
task.do_channels.add_do_chan(channel)

# Write data (1 to turn the relay on)
task.write(np.array([True], dtype=np.bool), auto_start=True)

# Wait for some time
time.sleep(1)

# Write data (0 to turn the relay off)
task.write(np.array([False], dtype=np.bool), auto_start=True)
```

Remember to replace `"Dev1/port0/line0"` with your actual digital output channel name.

Make sure to check the documentation provided by National Instruments for detailed information about your specific DAQ device and its supported features and functions.

Message 4 of 13
(321 Views)

Thank you for the fast reply! My professor mentioned that I can use the analog output of DAQ 6212 which has an output range of 10V and I can use a relay such as IM601-60A Latching Relay (https://www.ivy-metering.com/ev-solution/IM601-60A%20Latching%20Relay.html). Is this really possible without an external power source for the relay? Also i will be using LabVIEW to program and control them.

0 Kudos
Message 5 of 13
(296 Views)

Be cautious.  Your professor is correct, but you need to understand the capabilities of your DAQ and Relays.

  1. The Analog out is capable of +/- 10V at up to 2mA max which would not be sufficient for most relays.
  2. The Discrete Out is capable of handling up to +/-20V at up to 16mA max which would be sufficient for many relays available.
    • Actuation voltage of the relay
    • Coil Resistance
  3. If the relays used do not have a diode across the coil, one should be added to prevent Inductive voltage spiking (See Flyback diodes).
  4. The relays selected should have contacts that exceed the maximum solar cell sourcing requirements.
  5. An external power supply to drive these relays will be needed that does not exceed the 16mA max current limit of the Discrete Out.
    • Use the Discrete Outputs to connect the negative side of the coil to power return rather than on the power supply side.
  6. Control of the Discrete Outputs to control the actuation of the relays falls within the capabilities of LabVIEW.
Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 6 of 13
(284 Views)

Be more than cautious actually! Unless you use small PCB mounted low power relays, connecting a relay directly to a digital output is a pretty sure way to fry your digital outputs, even if you use flyback diodes. And not every diode is a good fly back diode. It needs to be pretty fast switching to be able to really protect the digital output. As they are operated in reverse mode until the relay is switched off, there is quite a large electronic charge in the diode that first needs to be depleted and in that time the relay coil can easily build up several multiple of its operating voltage as reverse voltage and that can break down your digital output transistors before the diode is able to carry the current from the coil and limit its reverse voltage. It may not fail immediately but continues switching that exceeds the safe reverse voltage of the output transistor in the digital output will eventually weaken it to the point where it will break down.

 

Basically trying to directly drive relays that are not specially designed with logic level control inputs with a digital output is almost never a safe idea in the long run.

Rolf Kalbermatter
My Blog
Message 7 of 13
(274 Views)

You need a contactor (not just a relay) rated for at least 100V DC and 20A; these are typically available for Solar applications.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 8 of 13
(258 Views)

The easiest way to drive DC relays with a DIO is to use an open collector driver IC or a small MOSFET.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 13
(222 Views)

@RTSLVU wrote:

The easiest way to drive DC relays with a DIO is to use an open collector driver IC or a small MOSFET.


It depends what you consider a small MOSFET. The typical SMD types such as SOT-23 may actually be a little small for a 100VDC 20A contactor relay just as the simple TO-92 based MOSFETS may not be enough.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 13
(211 Views)