Pulse to m/sec

Hi all ! i have arduino UNO and sensor TCST2103. I need some help to make my programme... I have a pulse that gives me 0-5 V pulses and I will turn it into speed m/sec how can i do this? i will use it for my anemometer.

Thank a lot!

Your sensor is a Photointerrupters... so, you will need a wheel with slots to act as the interrupter.

I did an advanced search on the forum just now and got lots of info using the two terms interrupter counter

Start with the search, narrow down some questions.

Ray

That looks like your garden variety photo interupter like they use for Home flags with stepper motor driven X/Y tables and wafer-lifts with worm gear shafts for lifting the picking and placing wafers in the chamber of a processing tool.

if the values are non-linear you can use - Arduino Playground - MultiMap -

i take a foto :

i need this form i think "measure the frequency of the pulses and scale the results"

JohnLincoln:
You will need to measure the frequency of the pulses, and then scale the result to give you the air speed in m/s.

The scaling factor will be dependent on the geometry of your vanes and the number of slots in your disc etc.

example: if my signal was analog 0-5V the arduino will gives me 0-1024 that i can make it measure to m/sec right ? that was easy and fast. But now what can i do ?

Thank you guys very much for the answer ! and sorry for my english, is hard to me to explain right...

When the beam in the detector is broken by one of the black blades it will change the output from on to off 5v to 0v (or vice versa). There will be no variable voltage and no need for analogRead().

Your program will need to count how many highs and lows occur in a fixed amount of time.

How fast (RPM or RPS) will your disk be turning and how many black stripes are on it?

...R

That's will make my programme slow ? i think the speed of disk will be 3-4 / sec MAX, has 16 black stripes. Is that difficult to be?

Your program will need to count how many highs and lows occur in a fixed amount of time.

can you show me something about it ? how can i find the libraries and syntax ?

Hi All,
Is that not a slotted opto switch, in which case, it will not work at all with a SOLID disk! it emits IR from one half and receives it on the other!! What is needed is a refective switch, which is usually a single square or rectangular shaped device, with a common face for both IR emitter/detector... Vishay make quite a few like the CNY70, TCRT5000, etc. these of course you would use with a solid disk and black/white stripes.

Regards

Mel.

Is that not a slotted opto switch, in which case, it will not work at all with a SOLID disk!

This may completely confuse the OP. Although the disk is a solid, it is not completely opaque. In it’s rotation, it will alternately block the IR from the opto interupter’s emitter which will alternately swing the device’s receiver output. It will work.

  • Scotty

orestis32:
That's will make my programme slow ? i think the speed of disk will be 3-4 / sec MAX, has 16 black stripes. Is that difficult to be?

Your program will need to count how many highs and lows occur in a fixed amount of time.

can you show me something about it ? how can i find the libraries and syntax ?

4 revolutions per second and 16 stripes = 64 HIGHs and LOWs per second, or one every 16.67 millisecs.

On second thoughts, counting the stripes in a set period of time is probably not the best way. It might be better to measure the time between stripes. There is a function called pulseIn() that can do this. You can read about it in the reference section. Having fewer stripes might make the job easier.

With more advanced programming skills you could use interrupts to detect the passing of the stripes but that would be a major programming challenge for a beginner. Interrupts can cause problems that are very difficult to debug.

...R

Robin2:

orestis32:
That's will make my programme slow ? i think the speed of disk will be 3-4 / sec MAX, has 16 black stripes. Is that difficult to be?

Your program will need to count how many highs and lows occur in a fixed amount of time.

can you show me something about it ? how can i find the libraries and syntax ?

4 revolutions per second and 16 stripes = 64 HIGHs and LOWs per second, or one every 16.67 millisecs.

On second thoughts, counting the stripes in a set period of time is probably not the best way. It might be better to measure the time between stripes. There is a function called pulseIn() that can do this. You can read about it in the reference section. Having fewer stripes might make the job easier.

With more advanced programming skills you could use interrupts to detect the passing of the stripes but that would be a major programming challenge for a beginner. Interrupts can cause problems that are very difficult to debug.

...R

It's work ! Thank you Robin2 !!! your solution was exactly that i want !

Thank you all ! for the answers guys ! :smiley: