Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Object Counter Using Infrared Sensor

Solved!
Go to solution

I am currently a final-year student doing my project and I need help with it. I want to use myRIO SHARP GP2Y0A21YK0F Infrared Proximity Sensor to count the objects while reading data. How do I achieve this?

0 Kudos
Message 1 of 5
(5,230 Views)
Solution
Accepted by syakirin

First connect the sensor to an anlog input and supply it with 5V

Depending on counting speed and object length or pulse length , choose a meaningfull samplerate.

Now you can capture the voltage reading.

If you look at the datasheet you can expect a voltage waveform for your object. (Better choose a min distance to avoid the foldback at the near end 😉 )

depending on the needed samplerate and your setup you now just have to use the threshold detection or do a window detection, like has to be higher than v_h and then lower than v_l to have an item counted.

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 5
(5,188 Views)

Thanks! 😊

0 Kudos
Message 3 of 5
(5,173 Views)

Hi, can you show me the VI of it? I would be gladly appreciate it!

0 Kudos
Message 4 of 5
(5,162 Views)

Hi, Henrik

 

I don't understand what you mean by "counting speed and object length"...

Can you give me the VI snippet on it?

 

Thanks!

0 Kudos
Message 5 of 5
(5,104 Views)