I am working on a LabVIEW project. For a part of it (creating a subVI) I want to make use of an IR sensor (SHARP 2Y0A21), in order to measure the proximity of my hand from the sensor. I also have the myDAQ to aid me with the sensor inputs. I want to make a program that lights up an LED boolean when my hand goes out of the sensor's range. Please guide me as to what should i do in order to get it working. A few steps on how to make my program will be highly appreciated!
This DeveloperZone article, Measuring Distance with myDAQ and Sharp Infrared Proximity Sensorshould help you get started. Although the sensor model used in this article is different, the specifications appear to be very similar from a quick glance at the datasheet. If you follow this article, you should be able to acquire the voltage output from the sensor, filter it and convert the voltage to a distance. From here, the rest of your program should be fairly simple to complete. Feel free to post any further questions you may have regarding the article or your application. Hope you find the article helpful!
Joseph S Applications Engineer National Instruments