LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Anyway I can simulate a square wave in ultrasonic sensor

Where a person passes by for t period of time and the graph will show a pulse of the period. I’m trying to make the graph look like the sensor HC-SR04 when it detects some one passing by produce a 1 amplitude square wave against time.

0 Kudos
Message 1 of 3
(1,812 Views)

Hi ehanpaul,

 

mind to attach an image of the expected output signal?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(1,804 Views)

@ehanpaul8 wrote:

Where a person passes by for t period of time and the graph will show a pulse of the period. I’m trying to make the graph look like the sensor HC-SR04 when it detects some one passing by produce a 1 amplitude square wave against time.


Are you trying to get a graph that looks like this? (Using a HC-SR04)

isThisYourOutput_JoB.PNG

 

 

Or are you trying to simulate what the HC-SR04 actually outputs? (The ECHO Pin graph, below)

HC-SR04 graph.png

The amount of time that the ECHO Pin is HIGH is used to calculate a distance, based on the speed of sound (it's an Ultrasonic sensor, after all).

 

If you're trying to make the first graph, in LabVIEW, while using LabVIEW to control a HC-SR04, you'll need to

  1. decide "how close" the person needs to be,
  2. repeatedly test to see if the person is "there" or "not", and
  3. output a 1 to the graph if the person (or other object) is found. 0 if not.

 

If you've never used a HC-SR04 - keep in mind that their sensing capability is not robust - I've gotten a lot of failed reads while using them (where the sensor never saw the return signal, so it reported a distance further than it can reasonably detect).

 

-joeorbob

0 Kudos
Message 3 of 3
(1,781 Views)