Hi,
I would like to get some help in the laser modulation issue, which i'm not realizing how.
I did see this youtube video How to really build a Laser pointer security system - YouTube, and became interested in making it with arduino, so, the main question would be how to modulate the laser and the ldr receiver. Programming is not the issue, but the logic in making the modulation.
Is there any expert who could give me a help?
Best regards,
PW
P.S. If there are also suggestions in how to make a bullet proof laser security fence, imune to light condition, rejecting tampering (flashlight ilumination, for example) and others, i would like to discuss about.
Don't use a LDR. They respond too slowly to light changes.
Selection of the IR receiver is critical as most do not allow a continuous signal. The only part I recommend is Vishay TSSP4838; it's under $1 at Newark / Mouser / etc. Also, you do not need to use an IR LED; a laser module will work fine.
Hi Chagrin,
thank you for the answer.
I could not find the TSSP4838, but found VISHAY TSOP4838, 38khZ IR RECEIVER. Would this one be the right one?
Best regards.
PW
Chagrin:
Don't use a LDR. They respond too slowly to light changes.
Selection of the IR receiver is critical as most do not allow a continuous signal. The only part I recommend is Vishay TSSP4838; it's under $1 at Newark / Mouser / etc. Also, you do not need to use an IR LED; a laser module will work fine.
Thx Chagrin,
i ordered the TSSP58038, and will wait some weeks to arrive. I could not find it in Brazil, so i ordered it from the UK.
In the meantime, i looked at the link you sent, and realized that the the IR library is used with an IR led and an IR receiver, modulating the led at 38khz. I also understood that the IR led can be replaced by a TTL laser module, modulated to 38khz by the IR library, and the TSSP58038 as the receiver, so it would be imune to constant light (sun, flashlight, lasers, etc.).
So, calibration to different light conditions would not be necessary. Am i right?
Thx for helping.
PW
You're correct. However it's still best to make sure the receiver is shielded from direct sunlight as you can get sporadic, false readings when the receiver is saturated with bright light and no beam is shining on the receiver.
Considering that 38khz is a fixed rate (38.000 times per second), i have another question.
My idea is to rate the pulse from 300 to 500 times per second, changing the rate every 5 seconds, randomly. The laser will surely do it, but will the TSSP58038 be able to get it?
The inicial idea is having laser and receiver in the same sketch, in one board.
TIA
It sounds like you want to turn off your beam ~400 times/sec to verify that someone else hasn't inserted their own 38KHz beam to block it? That should be fine, but be aware that the receiver needs six consecutive pulses before it starts outputting a "beam detected" signal.
So, if i modulate the laser at ~400 hz (400 times on and off per second), the receiver will need six consecutive pulses before outputing the detected signal. It means that on start, i will have to calibrate it, making sure that the it's detecting the laser pulses. Once done, i can variate te pulse rate from 300 to 500 with no problem. Correct?
Of course it is still theory now, because i'm waiting for the components to start it, but developing the initial logic.
The datasheet recommends (on page 2) you use pulses of at least 10 cycles "for optimal function". If you are using square wave modulation, then that implies a maximum modulation frequency of 38Khz/20, which is almost 2kHz. So modulating it at around 400Hz should be no problem.
dc42:
The datasheet recommends (on page 2) you use pulses of at least 10 cycles "for optimal function". If you are using square wave modulation, then that implies a maximum modulation frequency of 38Khz/20, which is almost 2kHz. So modulating it at around 400Hz should be no problem.
I did not understand. At least 10 cycles for optimal function? 38kHz/20? Could you please educate me?
The datasheet recommends you send bursts of at least 10 cycles of the 38kHz signal. Assuming you use square wave modulation (i.e. equal on and off times), that means at least 10 cycles on and 10 cycles off. So the modulation period must be at least 20 cycles. Hence the maximum modulation frequency is one twentieth of 38kHz.
i would not use the 38kz. its a standard that is used for about anything that controlled or controls something through infrared. your security system could be defeated by a learning remote. generally i dislike the security through obscurity model, but it might be your best bet here. just write a function that loops through your own defined patterns of off and on that can be detected and predicted by the device on the other side. kind of like morse code spelling out a phrase, but dont use morse code.
if you want to be very fancy, you can use the HOTP token based one time password generating/authenticating algorithms using a base32 shared secret. the algorithms can be difficult to understand, but are just a series of math operations so not too hard to implement.
as far as hardware, ive had good luck with old garage door blockage sensors or whatever, that keep you from closing the door on top of an obstruction.
pyrotuc:
i would not use the 38kz. its a standard that is used for about anything that controlled or controls something through infrared. your security system could be defeated by a learning remote. generally i dislike the security through obscurity model, but it might be your best bet here. just write a function that loops through your own defined patterns of off and on that can be detected and predicted by the device on the other side. kind of like morse code spelling out a phrase, but dont use morse code.
if you want to be very fancy, you can use the HOTP token based one time password generating/authenticating algorithms using a base32 shared secret. the algorithms can be difficult to understand, but are just a series of math operations so not too hard to implement.
as far as hardware, ive had good luck with old garage door blockage sensors or whatever, that keep you from closing the door on top of an obstruction.
hope this helps
You got the point. On/off cycles in random patterns, varying from 400 to 600 Hz (maybe from 500 to 1500), changing every 15 seconds. Which receiver for that? A photoresistor, a photodiode, a ldr? The device will be the same, having the transmitter (laser beam) and receiver on the same arduino board.
A sketch example?
The idea of transmiting a OTP generated token and validating is really good, something to think after i get the concept running
Thx!
The advantage to using IR receivers is that they automatically adjust their sensitivity to the ambient light. There's a decent amount of effort figuring out how to do that yourself using a bare photoresistor or phototransistor.
...and a phototransistor would be the proper choice, btw. Photoresistors (AKA LDRs) are too slow to respond to changing light levels and would force you to slow down your modulation frequency or bit rate (if using some sort of encrypted beam).
Hi,
back again. Yesterday i received the ordered parts: Vishay TSSP58038 IR sensor, BPW96C NPN phototransistor and green laser 532nm 50mW.
To build the receiver, i have the choices of the IR receiver and the phototransistor.
The IR receiver i will connect a 0,1 uF betwenn GND and Vs (capacitor + to Vs), a 330 Ohm resistor from Vs to 5V and OUT to a digital input of arduino, so when laser detected i read HIGH and no laser i read LOW. According to the experts, will it work, the IR sending HIGH with a 532nm wave length?
With the phototransitor, the receiver would have 5v to C, from E to a digital input of arduino, and a 10k resistor to GND.
Would it also work and being fast enough to read modulation between 200 to 900 Hz?
Thx in advance for your valuable hints
Paulo
Thx Chagrin,
but the hardware interface would work as described?
6000 Hz max? So, between 200 and 900 Hz would not be a problem....
Will wait until the red laser arrives to begin the set up.
Thx