1N4004 is fine. Don't use an LED. The diode is to clamp the induced voltage caused by turning off the relay. An LED probably wouldn't survive the surge. Then the transistor would get taken out too.
Originally Posted by jasonsjwou
Are you using the standard NI drivers with this? How does your software read/write to the card?
I used the NIDAQ legacy driver before. All you have to do is include the library file in the VB project setup, and you can call the DIO card specific functions.
First, on the InitDiag routine, I setup Inputs and Outputs. What channels are used as inputs and outputs.
Then I used a OnTimer to periodically monitor any activity on the input channels. There is a NIDAQ function that periodically returns an array (Index is CH number) with 0's and 1's. I call this timer every 20ms or so, so the response appears to be instantaneous. If none of the channels are being triggered, this array contains something like
IF the array is
Then CH4,8,9,10 are trigerred. Then there is 20 or so IF-THEN statements that calls some other function that does something else.
On Output side, there is a function that's like CHANNEL(CH,STATUS).... if I call CHANNEL(21,1) then it turns on the channel 21.
It's pretty simple. I am not a computer programmer, and it took me a day to write a complete application. Jimmy you sound like you are an electrical engineer, it'll take less than 2 hours for you to figure it out. :)
Thanks for the circuit info. Really appreciate it.
There is one MAJOR problem though. The ISA version's driver does not support WinXP. It works with NT, 2000 and below, but not with WinXP.
Thanks, Jason. I have one of those cards in my drawer. I just may have to see what I can do with it.
How is this project going? Also could that circuit that you guys posted work with other usb controller boards too? Such as the IO-Warrior and Phidgets?
IF those USB controller provides logic level output (something like 5V 2mA which is nowhere enough to pull a relay) then you MUST use this circuit to pull the relay.
I've wired up one channel on a breadboard and it's working fine.
ok so this will be able to drive any other usb controller? i.e. IO-Warrior, Phidgets, etc...
Yes, it should be able to drive any USB controller whose output is only a very low power logic-level output.
That circuit will work off any positive output of a couple of volts or more. It will work with parallel port lines also.
Ok, I know you guys have said that it works with everything that outputs a few volts etc... but just to make sure before I order it can it work with IO-Warrior?
I just want to make sure before I waste 50 bucks. Thanks