I am looking at a light barrier project that will need to have a simple way to sequence around 25 IR LEDs in a vertical line from top to bottom with the fastest refresh rate possible in the simplest way possible.
I will drive them at 38KHz, which is done via a 38KHz module which is no problem.
They need to be:
Lit one at a time
Lit in sequence
able to be synced with the Receiver bank on a separate pole.
I am thinking of having a method to start the sequence on a command, so that the command can be sent at the same time to the receiver so they sync.
Anyone know how I would control the LEDs and also sync the Tx and Rx?
Please specify how "38kHz" and "lit one at a time" and "fastest refresh rate" and "sync to Rx/Tx" fit together. Can you provide a sample timing diagram to make that more clear?
Why do you want to have 25 separate IR LEDs when one of these will already illuminate the entire room?
You normally would use 3-pin IR receivers to demodulate that continuous (or interrupted) IR signal.
From memory, they need at least 500us-1ms to detect a beam interruption.
Tell us why you think you need a curtain of 25 IR LEDs.
Switching between LED/receiver sets would seriously slow down object detection speed.
Leo..
You don't need 38KHz IR do you?
Will there be ambient near-IR to tell led signal apart from?
25 IR LEDs in a vertical line
Can you restrict the view of a 10 cent IR phototransistor (black bulb, 2 leads) to just the line of leds? It would look through a slit from a distance behind to give a narrow view that cuts everything else out. If you set the strip back into a groove there won't be ambient IR on the strip that doesn't come from the direction of the detector.
If you can and don't need slow IR-remote then this should be easy.
The leds would be wired in a 5x5 pin matrix. To light any led, a row pin is set HIGH and a column pin set LOW while the rest are set INPUT which is electrically neutral and the led at the junction lights up and the detector is checked to see if the beam from led# row*5+col is blocked or not before switching to the next led, perhaps run a micro or two worth of count-loop between turn led on and read detector and that's how fast you can switch leds if you use direct port manipulation and wire the led rows and columns on 5 pins of 2 AVR ports.
You may be able to scan in 4 or 5 microseconds per led. All 25 leds, 1 at a time, 8 or 10 scans each millisecond sound good?
Perhaps a bit slower if you do much with the data but for light work that is within reach.
38K wave period is over 25 micros, how many waves to get IR-remote to acknowledge? Many! Difference in scan rate? Huge!
I do need 38khz as it needs to work with daylight.
I have made a barrier with a series of 38khz sensors with restricted views and corresponding LEDs with their outputs restricted through tiny holes. It works but even at 1.2m I cannot have the sensors closer than 125mm to each other because of LED beam overlap (SFH4545 has 5 degree spread). I thought about lasers but they are too expensive and tiny variations in their builds would make lining them up a nightmare unless I defocused them. I need to have minimal spacing between LEDs and sensors because I need to detect objects down to 30mm without error.
So I have figured out a way that it might work:
Divide the 1m barrier into two 50cm sections. Top to middle, middle to bottom. Address them two at a time - top & middle, 2nd from top & second from middle etc. This will halve the refresh time. And I can still spread the posts 4m apart without LED overlap. At 4m the LEDs theoretically spread 34cm which is 17cm either side of the sensor it is aimed at.
Do the same for the receivers. TSSP58038. Have all of them powered on and receiving at all times, only enabling the outputs in time with the LEDs on the other side with a transistor to invert the output. This should work.
Using 36 or 38kHz sensors and 56kHz sensors might halve your problem further.
Reducing power to the IR LEDs might also help.
A 5degree IR LED only needs a few mA to bridge 4meters.
Transmit until a LOW on the 3-pin sensor is detected.
That means no beam break, and you can instantly move to the next pair without waiting for a fixed amount of time.
Leo..
Quoll:
I do need 38khz as it needs to work with daylight.
That's only a problem if sunlight reflects from the areas visible to your detectors that should see little but the target. If the target is shaded, sunlight is not a problem when you can engineer it out of the way.
I put a 5mm black bulb IR detector in the back end of a narrow tube (5mm ID) and the length of the tube sets the cone of view. With a 10cm tube the cone should be 50mm wide at 1m. The light source could be a florescent tube or white strip brightly lit if all you want is to detect beam break. All light is beams, you only care about the ones in certain places.
Remember that a small enough aperture will cause light to diffract, spread weakly. Don't pinhole.
You could use lasers with detectors very close next to them, and a good retroreflector on the other side. Makes lining up (and wiring) a lot easier.
An LED with a bit of a tube in front of it would also give a very focussed beam.
When you narrow the detector view you really really do not want to make the light beam also narrow.
With a restricted detector, only light from a very narrow cone will reach it. The beams that do are completely straight already, no need to make led with so-many-degrees of beams going out any harder to aim at the detector spot than necessary is it? Because it's not going to make the detection any more positive while a slight misalignment makes it impossible.
PS - when the detector only sees one led you don't have to narrow the led angles.
I spent a good bit of time on this long ago, beam and detector make a good X-Y problem.
As for lasers, while I love the things and can get modules for less than 50 cents I don't put them where by chance accident or asshat maneuver the beam goes into someone's eye, even spread off a wide-view mirror you or someone can find themselves wondering how long before or if that eye will see again. For a buddy of mine it was a bit over 2 hours. If that was my laser (he did himself) and someone else I could end up in court and hit with a hefty fine.
Never use a laser when a plain light will do. Collimate a led with a spyglass if you need a beam, it could be brighter.