Hello everyone, I would like to create a program which let me counting how many things move next to my sensor. I want use for it IR Transmitter and receiver modulated on appropriate frequency. Is that good idea or should I use other kind of sensor to achieve that? (thought about ultrasonics). IR Transmitter will be ~1m far from Receiver
Do you want to implement kind of a light barrier? Or do you want to know in what distance the "things" in front of your sensor are? Please describe what you want to achieve.
This what I want to implement is ...
when something(some thing) break the light beam, the counter will be incrementing. I don't need to know how far this thing is. And I'm not sure which sensor will be the best for this kind of task.
What distance do you need to cover with the beam? Red/IR LEDs are good for about two meters (depends on where you want to use it), for bigger distances I would choose a laser. The sensor is a simple photodiode/phototransistor.
Thank you for your patience
indoor usage, the object may be reflective but wont be transparent (some kind of liquid possible inside[or fullfilled by something non liquid]). I can place sensors or Transmitter / Receiver on both sides so I thought to place IR Transmitter on the opposite site to receiver. If IR is the best options, what frequency should I use to make it the most noise proof?
The best frequency for IR is 38kHz because you'll get the necessary receiver without any difficulties (it's the same frequency used for most remote controls), which has the filter already included. As a sender a simple IR LED is sufficient, use one with a narrow beam and attach it to the Arduino as any other LED. The IRremote library includes the routines to generate the 38kHz signal.
I bought TSOP4838 and want to make this break beam detector by using this device. However I'm not sure what max time and minimum gap should I generate to let it work with highest frequency?
Datasheet said: Minimum burst length 10cyces/burst
After each burst of length a minimum gap time is required of 10 to 70 cycles (>=12 cycles)
So the minimum gap is 70 cycles which means 70 * 13us = 910us (microseconds), how long can I emit 38KHz frequency to let receiver rest and keep good beam frequency?
I also don't understand what this magic word burst mean? Is burst mean the time of 38 KHz freq generation?
I think it must be packed signal: 01010101010101....010101 where 0 means 38KHz wave and 1 means Gap time without 38KHz signal
Ok, i bought TSSP 4038 This what i need now is to make sure i make proper calculations for transmitter which won't be based on arduino (it will be attiny 13a)
If you're only going 1 meter of distance you won't need a transistor. A good IR led like what you have will probably do about 5 meters at the 20ma limit of an AVR pin. You might actually mess things up if you go full power on the IR LED and it starts reflecting off of objects.
Also I recommend you start with a visible red or white LED. Much easier to see things working that way / common sense kinda thing.
Transmiter will power up the Receiver on distance 1.5 meter. Its becouse wire must be longer than direct length between transmiter and Receiver. Is my calculation ok?
You would subtract the Vf of the LED from 5V and use that to calculate Rc.
With respect to Rb most people just grab a 1K to 4.7K resistor and call it good. You always want a few times more current reaching the base just to make sure the transistor is saturated so calculating the value with the precision you have done is a bit overkill.
And again with my earlier suggestion you're still thinking 100ma of current. You only need about 5ma. In my project I sent the beam 3 meters with a TSALxxxx LED (don't recall which one, but it was a 100ma max like yours) and only needed 10ma of current.