Index
RSS

Welcome Guest [ Log In | Register ]

 
Reply to this topicStart new topic
> Controlling LED sequence with switches
Xacyl
post Mar 7 2013, 01:38 PM
Post #1

Joined: 7-March 13
Posts: 4




I'm a total newbie at programming but a part of my university project requires me to control a sequence of LED's with switches. My supervisor suggested I use labjack with labview.
My problem seems simple compared to the other posts i have seen in this forum so i hope someone can help. I have to install 4 LED's into the a sectioned cylinder of an engine to be put on display, i have 2 switches which are triggered on or off each time the piston hits them, hence giving me 4 inputs, i need a specific coloured LED to come on with each input, something like so:

Switch 1 On, Switch 2 off: White LED (Intake stroke)
Switch 1 On, Switch 2 on: Blue LED (Compression Stroke)
Switch 1 off, Switch 2 on: Red LED (Expansion stroke)
Switch 1 Off, Switch 2 off: Green LED (Exhaust stroke)




This happens in all 4 cylinders but if i can get it working on just 1, i can connect the rest of the cylinders in series or parallel accordingly. I have made a basic logic circuit in labview for this:



The 4 LED's also require 3.9 V at 350 mA to work at their optimum, and I'm having a hard time trying to figure out how/what functions to use as well as what channels to use. I did go through some the examples given (which i downloaded from this site) and it seems i can adjust voltage on the DAC channels to 3.9 Volts but i dont know how to get it to on 350 mA or to turn off when the switch is pressed etc

I'd really really be grateful if you can help.

PS. I have a Labjack U3-HV
 
Quote Post
LabJack Support
post Mar 7 2013, 01:50 PM
Post #2

Joined: 9-June 03
Posts: 7527




You can read a switch by connecting it to a digital input:

http://labjack.com/support/u3/users-guide/2.8.1.3

In LabVIEW check out the easy function example "U3 eDI Example.vi".


Normally you power small LEDs with a voltage source and put some resistance in series to limit the current:

http://labjack.com/support/app-notes/led

Your LEDs, however, need a lot of current. A current source would be better, but you should be able to use a voltage source as long as you use a current limiting resistor than can handle the power it is dissipating.

The control methods from the LED app note will not work for a 390mA LED. Rather you need some sort of switch that can handle the 390mA (SSR or transistor for example), and then use a digital I/O from the U3 to control that switch. If you want to buy something check out the PS12DC:

http://labjack.com/support/ps12dc/datasheet
 
Quote Post
Xacyl
post Mar 7 2013, 01:55 PM
Post #3

Joined: 7-March 13
Posts: 4




Thanks for the quick reply, I will look into these notes :)
 
Quote Post
Xacyl
post Mar 13 2013, 03:10 PM
Post #4

Joined: 7-March 13
Posts: 4




Hey thanks to your help i got the software part working, the only problem now is the voltage. Regarding the PS12DC extension, does it work like a relay, using the same output signals (as control voltages) but using power from the external source?
And I suppose i can use just 1 battery to power all the 4 outputs, as no two LEDs light on simultaneously, right?
something like so with a 3.9 volt battery:


 
Quote Post
LabJack Support
post Mar 13 2013, 03:47 PM
Post #5

Joined: 9-June 03
Posts: 7527




The PS12DC does work like a relay, but with some limitations. The PS12DC is rated for minimum of 5V. So you would want to connect a 5V battery to the system, then put a current limiting resistor, in the 100s of Ohm range, between S0, and LED1, S1, and LED2 etc. If you have a powered USB hub, you may be able to just use VS on the LabJack. I would try Figure 4: Multiple Items, Single Supply of appendix A, and if that doesn't make your LEDs bright enough, you could try the battery.

http://labjack.com/support/ps12dc/datasheet/appendix-a

As a side note, 350mA LEDs must be very very bright? 350mA seems well above average...
 
Quote Post
Xacyl
post Mar 13 2013, 04:59 PM
Post #6

Joined: 7-March 13
Posts: 4




Thanks, I think I will order this :), and yes I'm using Cree MC-E Colour LEDs and they were meant to light up the sectioned engine cylinders and needed to be really bright (430 lumens):

http://www.ledsupply.com/creemce-rgbw.php

I'll see if I can find a 12V 350A ac/dc adapter and use that instead of a battery, and then connect 4 colours in series instead of parallel, 3V across each should suffice.

Thanks a lot for all the help, you guys are great :D
 
Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
RSS