nmnerzul Posted April 30, 2012 Report Share Posted April 30, 2012 Hi im new in labview, i have to connect the HC-SR04 ultrasonic sensor to the SensorDAQ, and i have to measure the distance betwen the sensor and an object, I have done a little program but the distance is very erratic, and i have seen an example but i dont underestand all the code in the example, so i dont know how to change it to do what i need, later today i will put the links to vi's, the one i did and the one i have found, my code is very short and the code I found is terrible long. If my program is bad, can you tellme where and why? or is not the code the sensor requieres please tell me. If the example i add the code i really need can you explain me all the parts, and how to change it in order to function with the sensordaq. Can you tell me how to wire the sensor to the sensor daq? i will add my connection diagram and photos so you can help me. http://jaktek.com/wp-content/uploads/2011/12/HC-SR04.pdf I add the link of the information of the sensor, the sensor is almost the same, mine is blue, not green, at night i will add the vi´s codes, the photo of my sensor, and the photo of my conenction to the sensorDAQ card. Thanks for your responses. PD: I'm a neeby to labview, but i whant to learn, so if you can tell me the answer and explain me how it work would be the best. Quote Link to comment
nmnerzul Posted May 1, 2012 Author Report Share Posted May 1, 2012 I don't know how to edit the other post so here i put the 2 vi´s, the one i do and the one y find. The sensor is connected in this way: the vcc to chanel 5 of sensor daq the trig to chanel 7 of sensor daq the echo to chanel 11 of sensor daq and the gnd to chanel 10 Plase help me sensordist.vi distance sensor counter85 (1).vi Quote Link to comment
asbo Posted May 1, 2012 Report Share Posted May 1, 2012 It looks like there's a lot of resources on the web for the HC-SR04 and components like it to be used with Arduinos - like this one - that you should use for reference. You didn't link to a real datasheet, but it did itself link to a library. You should use these to better understand on how you have to interface with the sensor in LabVIEW. It looks like you'll need to apply power from a 5V+ pin, ground via a ground pin, and then a digital input and digital output pin for echo and trigger, respectively. The distance sensor counter85 VI requires two counters - having skimmed the SensorDAQ manual, it looks like you have two counters, but you download a copy of Vernier's LabVIEW toolkit to use it. "The SensorDAQ has two counters as part of the hardware. One counter is available on the screw terminal, and the other is hidden on the DIG Channel. To access the hidden line, connect the DCU to the DIG Channel; line 1 of the DCU is the pulse output line. These counters can be used to provide a pulse output or a pulse train. The examples demonstrate how to do this." Quote Link to comment
nmnerzul Posted May 1, 2012 Author Report Share Posted May 1, 2012 Sorry but i can´t use any Arduino's card, i have to use NI Sensor DAQ with DCU, i found examples of how to doit with arduino's card's but they were useless. Thanks for the reply. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.