Electronic – Can sending correct data via UART qualify as valid manchester encoding

laser-diodeledmanchester-codingphototransistoruart

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.

Best Answer

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.