Jump to content

help in the programmin​g adn wiring of the Hc-sr04 ultrasonic sensor.


nmnerzul

Recommended Posts

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.

Link to comment

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."

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.