LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help in the programming of the Hc-sr04 ultrasonic sensor

Solved!
Go to solution

Could you please explain what is the DCU? I am not familiar with the Vernier hardware and I actually do not know what you mean with that. Or are you refearing to the DAQ as DCU?

Francisco S.
National Instruments
Account Manager
www.ni.com/soporte
0 Kudos
Message 11 of 42
(2,437 Views)

The DCU is another hardware that can be plugged in the DAQ, is a DIGITAL CONTROL UNIT, is for using motors and things like taht witch require more voltage and power to work.

0 Kudos
Message 12 of 42
(2,431 Views)

I was looking to the sensor and I found that the triggering needs to be 10us long. It is not possible to generate this with the digital port, the only way to do this is with the counter. However, if you use the counter to generate the trigger, you are not going to be able to measure the width of the pulse. What I see is that having only one counter, which is the case of the sensorDaq will not let you use this type of sensor since it is a more sophisticated sensor. Is there any chance of you having a different DAQ?

Francisco S.
National Instruments
Account Manager
www.ni.com/soporte
0 Kudos
Message 13 of 42
(2,421 Views)

i know we ahve other DAQ but i dont know the model, what is the fastest speed the digital port can work? because i read 10us is the best but it can work with 40us or 50, can we get this with the digital chanel?.

 

Other thing can we use a port to recive and to send signals, in a loop, because i dont have to measure the distance every 10us, i can wait a second or 2, so can we make the sensor send the signal, then get it back in the same port? i dont matter we have a delay, only if the delay isnt longer than 2 seconds.

 

Wich DAQ can be used to use this sensor? Can we make phisical osilator to generate what we need to turn on the sensor?

 

Again thanks for your help.

0 Kudos
Message 14 of 42
(2,416 Views)

 

I try to open the vi you send me but that one is version 11 and i only have the 8.5 version can you change it to 8.5 version please? thanks

0 Kudos
Message 15 of 42
(2,411 Views)

The problem that I see is that, since we only have one counter, we need to simulate another counter. This counter would need to be simulated by software (LabVIEW) and with the digital port. However, LabVIEW will not let you create a trigger of 10us since the minimum resolution of the PC procesator is in miliseconds and cannot achieve microseconds timming. The sensorDaq is designed to work with less sophisticated sensors since it only has one counter. The ultrasonic sensor that you have requires at least two and at high frequency response.

 

Here is the 8.5 version of the LabVIEW code. Please tell me if you were able to open it.

 

Regards

Francisco S.
National Instruments
Account Manager
www.ni.com/soporte
0 Kudos
Message 16 of 42
(2,403 Views)

 

At night I tell you if I could open the VI, can we conect and sicronize 2 cards?, if I can get to sensor DAQ's can we make the arrengment to use both at the same time? so we use one entrance  to the output and the other to the input?

0 Kudos
Message 17 of 42
(2,397 Views)

It might be possible but it depends on the model of the cards, the speed of each one and the configuration that we give to them. If both are similar, then we can do it with the example that you found and in that case, the counter of the first card should work as the triggering and the counter of the second card should work as the pulse width measurement.

Francisco S.
National Instruments
Account Manager
www.ni.com/soporte
0 Kudos
Message 18 of 42
(2,394 Views)

 

Yea if I use 2 cards, both are going to be the same, what we have to modify to the example to make it work with 2 cards?.

 

And if they are different models, wich models have the chanel we are going to use?

0 Kudos
Message 19 of 42
(2,391 Views)

If they are the same, you just need to specify the channel 7 (which is the counter) for each one on the front panel of the example code. That means that there is nothing to be changed. So you specify the channel 7 of the first card on the Trigger Term option and channel 7 of the second card on the Echo Term option.

 

If they are no the same, maybe there is nothing to change either. However it will depend on the card you are using. Maybe the cards might need to be synchronized on the timing, but that depends on the card you are using. 

Francisco S.
National Instruments
Account Manager
www.ni.com/soporte
0 Kudos
Message 20 of 42
(2,386 Views)