1
\$\begingroup\$

I'm currently in the process of having a laser beam detected by the phototransistor. While the parts in themselves work, I want to detect when the beam has been detected.

I understand that a 38Khz module exists for detecting IR but I already bought my phototransistors and they are much less expensive and offer me more flexibility.

What I currently have setup in my 8051 microcontroller is a procedure which detects when a laser beam has been sensed by detecting the value 0Fh from SBUF (uart input).

The reason I chose that value 0Fh is because for a standard 8N1 UART protocol The data packet for the UART starts with a logic low for start bit, then the next four bits are logic low then the next four are logic high then logic high for stop bit.

Then the remote unit that controls the beam will operate much the same way by sending 0Fh over its UART (8N1) and both units will run at the same baud rate.

Currently I have the speed set to 1200bps on both units.

My questions are:

  1. Is this a good way to implement manchester encoding to detect when a valid laser beam is sensed (as opposed to interfering light)?

  2. Is the speed too high for the lazer to keep up? I mean some devices take some time to turn on and off. The laser in question comes from those cheap 5mw laser modules you can get off ebay for under $1.

\$\endgroup\$
  • \$\begingroup\$ Those 38 kHz receivers work VERY nicely - it is a well-engineered system (and they're not expensive). Unfortunately, not compatible with those cheap red lasers - you must use an infra-red laser light source. Consider emulating their methods. BTW - the really cheap lasers have only a series resistor to battery power source - these can be switched on-and-off very quickly. \$\endgroup\$ – glen_geek Aug 15 '18 at 19:44
1
\$\begingroup\$

The success of this scheme will be highly dependant on the drive electronics in the laser pointer module, it's impossible to guess the ramp-up and down times, but easy enough to characterise with a scope. Sense the laser supply in parallel as ch1, photodiode as ch2 and compare the on/off edges while driving the laser with a square wave over different frequencies.

1,200 bps is quite slow, but I can imagine receiver clocking problems if the ramp up/down times are not symmetric within say 20%. The photo diode response time will be absolutely fine however.

\$\endgroup\$
  • \$\begingroup\$ Whats ch mean in ch1 and ch2? Channels in a scope? I don't have one. \$\endgroup\$ – Mike Aug 15 '18 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.