01-16-2014 10:48 AM
I am new to Labview. I hope someone can help me to finish my final year project. I has been built two temperature sensor using arduino, xbee and labview. Then I plan to integrated by adding condition which when temperature exceed 40 degree celsius, buzzer and led will light up. My question is, how should I build condition loop in the while loop? Your help will be much appreciate.
01-16-2014 11:36 AM
You should be able to simply use a conditional (greater than) and a case structure. In the true case, put the code that lights up the LED and turns on the buzzer.
Also, you need to have all your Arduino VIs in a single line to prevent a race condition (i.e. each Arduino VI should use the resource wire that leaves the previous Arduino VI). Therefore, there should only be a single instance of the Close.vi. For example:
01-17-2014 08:56 AM
thanks Nathan for your kidn reply.. I just try on it, I don't know how to lead the output of the result to the case structure.. can u show me?? thank you so much..
01-17-2014 05:22 PM
Here is an example of what I was describing:
The "Volts to Celsius" subVI is simply what ever you need to convert between volts and celsius.
01-17-2014 10:44 PM
thanks for reply.. i actually having problem on construct the led indicator circuit. From the led example, we control the led to switch on or off. I try modify it to become led indicator. any idea how to construct the circuit?
i try to use analog pin example, i set 5v. when more than 5v, the led will switch on automatic. but i get wrong result..
01-18-2014 02:23 AM
For a basic LED you can simply use a digital pin. Hundreds of websites can be found online that describe how to wire LEDs. There is also one on the Arduino website.
Also, if a digital pin will always be used as an output (or input), you should set the pin mode before the loop (it's much more efficient). The other thing that I notice is the maximum analog input voltage is only 5 volts so it will never exceed that (and you should avoid applying any more than that to the pin).
01-18-2014 10:37 AM
i have been try on this circuit very long time i don't know where goes wrong. when temperature more than 32 degree celsius, the boolean function correctly, but the pin 13 in my arduino that i set didn't function well and light on all the time only. anywhere wrong in the circuit?
01-18-2014 05:45 PM
You are probably having issues because you are setting the pin mode with a voltage (which is not good). You need to set the pin mode before the loop starts because you never need it to change.
Also, the following two expressions are the same and will always give the same result.
Attached is how I would do it using the my previous suggestions. Also, I've removed most of the options on Init.vi because they are the default values.
01-18-2014 11:32 PM
thank you so much!! i got it finally~
01-19-2014 03:08 AM
sorry.. one more thing.. i want to put buzzer on the circuit, i use the arduino buzzer block. The result is not correct.. it switch on all time also.. how should I modify it? I have been try few times but not success. hope to see your reply..