Jump to content
  • 0

Wire Connections on USB-2416


metalhouse

Question

Hello!

 

I have 2 questions about the wiring for the digital output on the USB-2416-4AO.

 

I have a 5V SSR that needs to actuate a valve (connected to an external 24 VDC power supply) based on a sensor value. As I understand, I need to connect the +5V on the DAQ to the positive input on the SSR and the negative input from the SSR gets connected to the digital input on the DAQ. (Similar thing for the connection to the valve). What I don't understand is, do I also need to connect the +5V with anything else (like the GND on the DAQ, which would mean 2 wires are connected to the same +5V port on the DAQ)?

 

Secondly, since I am using Python, I also want to know what is the thing that I should be coding for to energize or de-energize the valve. For me its a pressure value, but lets say I want to energize the valve after a time delay of 15 seconds, and then de-energize it when the pressure reaches a value X, what do I code for? An example of a code would be highly appreciated!

 

Thanks,

T.

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

There needs to be more clarity about how to wire an SSR to an output on a USB-2416-4AO. Imagine the digital output as a switch that, when turned on, will allow current to flow from a power source to the ground through the output. 

The maximum current per pin and total per 8-bit port is 150mA. Typically, a separate +5v power supply is used for the SSR control. Connect the SSR (+) control input to +5v. Connect the (-) control input to the digital output. Connect the +5v power supply ground (negative) to the USB-2416-4A0 GND (ground). 

The +5v pin on our device is rated at 10mA, so if you use it, please check the specs on your SSR to ensure it will not exceed 10mA.

If you use our +5v, connect it to your SSR (+) control. Connect the SSR (-) control to our output - that's it. 

Here's a Python example:

from __future__ import absolute_import, division, print_function
from builtins import *  # @UnusedWildImport
from time import sleep
from mcculw import ul
from mcculw.enums import DigitalIODirection, DigitalPortType, InterfaceType
from mcculw.device_info import DaqDeviceInfo

try:
    from console_examples_util import config_first_detected_device
except ImportError:
    from .console_examples_util import config_first_detected_device


def run_example():
    board_num = 0
    board_index = 0
    find_device = "USB-2416-4AO"

    board_num = -1
    ul.ignore_instacal()
    dev_list = ul.get_daq_device_inventory(InterfaceType.USB)
    if len(dev_list) > 0:
        for device in dev_list:
            if find_device in str(device):
                print(f"Found {str(device)} board number = {board_index}")
                print(f"Serial number: {device.unique_id}")
                print(f"Product type: {hex(device.product_id)}")
                board_num = board_index
                ul.create_daq_device(board_num, device)

            board_index = board_index + 1

        if board_num == -1:
            print(f"Device {find_device} not found")
            return
    else:
        print("No devices detected")
        return
    # **********End of Discovery************

    try:

        # set all eight lines high to turn off SSRs
        ul.d_out(board_num, DigitalPortType.FIRSTPORTA, 0)
        sleep(1.0)  # example of delay

        for i in range(0, 8):
            bit_value = 2 ** i
            # turn on SSR
            ul.d_bit_out(board_num, DigitalPortType.FIRSTPORTA, i, bit_value)
            sleep(1.0)  # example of delay
            print('Setting line', i, 'to', bit_value)

    except Exception as e:
        print('\n', e)
    finally:
        ul.release_daq_device(board_num)


if __name__ == '__main__':
    run_example()
 

Link to comment
Share on other sites

  • 0
  • 0

According to your datasheet, the SSR control input requires ~10mA of current, which is the limit for our +5v terminal. You must use an external power supply if you're using more than one SSR. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...