10-09-2013 02:14 AM
I am doing a project using LabVIEW 8.5, N6221 DAQ card. The project deals with switching on and off LED lights using LDR as a sensor. When there is light available the Led should be off but at night it should be on. Im trying to in-cooperate some more sub vi’s to control the intensity of the LED light with different lighting level. For example if the voltage across the resistor is 4V then the program should send 0V via DAQ card to LED, for Voltage of 2v the program should send 4V to the LED. Infact the lesser the ambient light falling on thr LDR the brighter the LEDS get. Attached please find the VI Im currently using and the circuit diagram. Any help will be very much appreciated.
10-09-2013 02:29 AM - edited 10-09-2013 02:31 AM
Hi kasamaneka,
so you decided to open a new thread instead of continuing your original one. What's the reason for that decision?
Infact the lesser the ambient light falling on thr LDR the brighter the LEDS get.
So you have an analog input and you need an analog output. You connect both by simple math, in the beginning something like "AO = 5 - AI" should do the trick. Instead of using ExpressVIs you should use simple DAQmx functions as demonstrated in all those example VIs coming with LabVIEW...
You should keep in mind you cannot connect a LED directly to a voltage source. You should also keep in mind the current limits of the AO pins of your DAQ card, they are given in the manual/spec sheet. That's pretty basic electronics knowledge, you should have learned that in school by now...
10-09-2013 02:43 AM
The circuit diagram has a 1k ohm resistor attached to the LED.
I am new to this software and for this simple Vi idid a lot of research and finally i managed to only switch on and off Led light, but now i need to change its intensity with varying ambient light. I tried DAQ max but made a big blunder and nothing was running well. How can I modify my program?
10-09-2013 07:35 AM
Any example VI would be very helpful.
10-09-2013 07:56 AM
10-09-2013 11:06 PM
Tried whole day to match one of the example vi's could not find. Thought someone from this powerful forum might help me modifying my current project.
10-10-2013 02:12 AM - edited 10-10-2013 02:13 AM
Hi kasamaneka,
so you're not able to learn from example VIs like "PID Control-Single Channel", that uses one analog input to control one analog output? Come on!
You will find that in the DAQmx section of the example finder...
10-25-2013 03:57 AM
I think its kind of complicated thing to do of what you have suggested. Attached please find of what i was expecting as help. Thanks for couple of tips you gave.
10-25-2013 07:13 AM - edited 10-25-2013 07:14 AM
Hi kasamaneka,
so it took you two weeks to create a VI with a race condition? You don't need a property node in there:
The point is:
That basically is the same as the example VI i mentioned earlier: you used DAQ-Assistent expressVIs instead of the plain DAQmx functions shown in the example. If you would have used that example you only needed to change the "PID"-control VI to use your simple control algorithm with all those comparisons and add functions...
But well: "learning by doing" is acceptable! 😄
10-25-2013 04:10 PM
Do you mind sending me the VI, you modified. I think it looks better than mine. But I am using Labview version 8.5.