Showing posts with label Laser Modulator. Show all posts
Showing posts with label Laser Modulator. Show all posts

Friday, January 30, 2015

Updated version of the "Simple" PWM LED/Laser modulator

A few years ago, for our friends in the Tucson area, I threw together a "simple" PWM circuit for audio modulation of high power LEDs (but it works just as well for laser pointers) for an optical transmitter - you can read about that here:

A "Simpler" Pulse-Width Modulator for LEDs, Lasers and whatnot and a simpler foam-core enclosure - link
Figure 1:
As-built prototype of the updated PWM transmitter designed to test both
 the AGC and manual gain/tone configurations.
There is currently no circuit board pattern:  If you design one,
please let me know!
Click on the image for a larger version.

As the page describes, this was intended to be comparatively simple and flexible in its operation, providing both modulation of both audio and test tones.  While it worked just fine, it did bother me a bit that it did not have a "manual" gain mode - that is, one could not simply override the audio AGC - which does work quite well - and "ride" the audio level manually, instead.

That was 2009 - so flash forward to 2014 when, at the request of some fellow amateurs in Australia, I finally got the impetus to update the firmware to add the means of selecting a completely manual gain control to the PWM circuit, of so-desired, in addition to various tone modes, all by setting pins on the PIC processor to the appropriate logic levels.  Of course, the original AGC audio mode is still present and may be used exactly as before, if one wishes, and one could even construct the circuit so that it could be switched between manual and AGC mode.

What it's for:

If you have ever been to the Modulatedlight.org web site link  (which I'll admit to having quite a lot to do with...) you will know that it has a lot to do with optical communications - mostly using high-power LEDs, but it also touches a bit on using low-power laser modules as well.

For modulating audio onto LEDs, onto LEDs, one of the easiest ways to do this is via linear current modulation, a process that is explained on the web page Linear Modulator for high-power LEDs - link.

Figure 2:
Examples of waveforms used to generate PWM signals,
from the web page "The Luxeon:  
New Light of Hope for Optical Communications"
by Chris Long

Another way that LEDs may be modulated is by turning them on and off in a manner that simulates linear modulation using a method called PWM, or Pulse Width Modulation - a system that is very easy to do using digital hardware such as counters and is often found in microcontrollers.

For laser diodes such as those found in laser pointers, current modulation is NOT very good for a number of reasons, including the fact that the brightness-current curves of laser diodes isn't particularly linear over a wide range, nor is it predictable at which current a diode will start to laser under a given set of conditions (e.g. temperature, age) or up to what current a specific diode can be safely operated!

For amplitude modulation, it is always preferable that one modulates as deeply as possible to achieve the best-possible signal-noise ratio and if one is trying to current-modulate a laser diode, this becomes problematic as the bounds of safe and reliable operation are difficult to know!  It is more convenient, then, to simply turn it on and off, operating it at a known, safe current when it is on and varying the duty cycle using PWM.

If the switching frequency of the PWM is sufficiently high it will be compatible with a "conventional" analog optical receiver that was intended for amplitude-modulated light sources as the PWM waveform will be integrated by the low-pass response of the receiver's front end.  At the very least, the PWM frequency must be at least twice that of the highest modulating frequency of the audio to be carried  and if necessary, a simple low-pass filter could be added to an existing receiver to remove any residual switching components - see Figure 2 for a pictorial of how a "slow", low-pass response can smooth out the PWM frequency components.

How it works:

Figure 3:
Diagram of the version with audio AGC.
Click on the diagram for a larger version.
This circuit uses a PIC12F683, an 8 pin microcontroller internally clocked at 8 MHz.  Using its PWM hardware, it generates a waveform with a clock rate of 31.25 kHz that is pulse-width modulated at a resolution of 8 bits - suitable for voice.

Audio can come from one of two places:  A built-in tone generator, or an external microphone/line-in audio source.

Using DDS techniques, audio sine waves can be generated at frequencies from a few 10's of Hz to several kHz and these are applied to the PWM generator, producing tones with 100% modulation depth.

Audio from the microphone or line input is first amplified and then low-pass filtered to remove high-frequency content and applied to the 10 bit A/D input of processor where it is digitized at a rate of 31.25 kHz and also passed to the PWM output.

"AGC" mode:

In diagram depicted in Figure 3, the circuit is configured to use an audio AGC to assure that the modulation is kept at a consistently-high level.  The audio level is monitored continuously to determine if its level is within 6 dB of clipping.  If it exceeds that level, a counter is incremented, but if it does not, a counter is allowed to self-decrement.  If the counter exceeds a pre-set value indicating that the audio level has been high recently, the processor pins that control the gain on the amplifier stage are adjusted to reduce the gain to the next, lower step.  If the counter self-decrements below a pre-set value indicating that the audio level has been consistently low, the gain is adjusted to increment.

There is also a built-in 12 dB gain adjustment in software:  If the audio has been low and the audio gain is near maximum, a 12 dB gain step can be switched in which is done by first limiting the A/D values in software to ostensible 8 bit values and then shifting the A/D data to the left by two bits and offsetting.

When switched to the "tone" mode, instead of audio being applied to the A/D input, the voltage from potentiometer R220 is applied instead allowing a variable voltage to be used to set the tone mode:
  • <=0.5 volts:  1 kHz tone
  • >0.5 to < 4.5 volts:  Variable frequency audio tone
  • >= 4.5 volts:  Tone sequence
Having a fixed 1 kHz tone is useful if using a computer or other device when setting up end-to-end alignment of an optical path as narrow detection bandwidths may be employed to maximize the overall sensitivity of the detection scheme.  Because this PIC's oscillator is not crystal-based, the actual frequency can vary by several percent, but it should be easily spotted with spectral analysis programs such as "Spectrum Lab" by DL4YHF, Spectran or Argo (to name but a few).

In the variable tone mode the frequency may be set from a few 10's of Hz (below mains frequency) to a bit over 2 kHz as desired.  Finally, the "tone sequence" mode is designed to emit a musically-dissonant series of notes (C4, E5#, F4#, E6) that really stick out of the noise:  By being dissonant, spanning over an octave and non-continuous they avoid "ear fatigue" and are more likely to be heard amongst other sounds that may be being heard from power mains and electric signage that might be intercepted.

Manual gain mode:
Figure 4:
The version with manual gain control
Click on the image for a larger version.

While the audio AGC works quite well to assure that ones voice fully modulates the LED to maximize "talk power" and signal-to-noise ratio, one may prefer to have a manual gain control instead and manipulation of several of the pins on the processor allows the selection of that mode as depicted in Figure 4.

In this version the audio gain is set with R309, but one can effect a "software" gain setting two switch in an extra 12 dB of gain via appropriate strapping of pin GP4.  As with the "AGC" version, there a variable "tone" mode is available but there are also some "fixed" tone modes that may be selected via appropriate strapping of pins GP3, GP4 and GP5 if you don't wish to use a potentiometer.

Minimalist version:
 
Figure 5:
Minimalist version.
Click on the image for a larger version.

Finally, Figure 5 depicts a somewhat minimal approach to the circuit, using only a single op-amp section with no active low-pass filter, manual gain control and the optional selection of a tone mode if you choose to implement switch SW301.

At its very simplest, one would connect GP3 (pin 4) to the +5 volt line to put the PIC into audio mode all of the time, but the triviality of adding just one SPST switch and a resistor would provide the facility of a tone generator, doing so would be hard to resist!

Getting the code:

If you are interested in building a modulator for an LED or laser using this device and are interested in the .HEX file for programming the PIC yourself, please let me know.  If you don't have a way to program the PIC and want a pre-programmed device, I can arrange that, too.


More information:

For more information about Free Space Optical Communications for the amateur, be sure to visit the Modulated Light page - http://www.modulatedlight.org



[End]

This page stolen from "ka7oei.blogspot.com".

Wednesday, September 5, 2012

Voice on a laser beam...


Sending voice over light is nothing new.  The first wireless voice communications system - using light - was the PhotoPhone, demonstrated in 1878 by Alexander Graham Bell - a full 25 years before Fessenden demonstrated the same feat using radio waves.  To be sure, optical communications has certain practical limitations, namely the blinding presence of the sun and the occasional opacity of the atmosphere due to weather, but it's still a fascinating and fun topic of discussion.

I'm one of those people who find wireless communications of any sort to be interesting and I have a particularly keen fascination with optical wireless communications - that is, using "radio waves" that I can see with my own eyes.

For short-range experimentation it's hard to beat a cheap laser pointer - and here is a bit of info on how one might go about this.

Modulating the laser pointer:

The laser pointer consists of a laser diode and like any diode, it has a maximum current rating that should be observed with more caution than its voltage.  What this means is that you cannot connect a laser diode to any sort of battery and expect it to work properly:  Too little voltage and it won't lase while too much voltage, it will never lase again!  What is needed is a simple circuit that limits the amount of current fed into the laser diode to a safe level and fortunately, cheap laser pointers always have something that does this.

Increasingly, cheap laser pointers simply rely on a combination of a simple circuit (or even a single resistor!) and the internal resistance of the battery powering it to keep the laser current at a safe level and since a laser pointer already has the necessary parts, why not use them?

In my opinion, one mistake that I often see on web pages that describe the modulation of a laser pointer is to attempt to modulate by varying the voltage/current of operation - typically using a transformer in series with the power source.  There are several things wrong with this:
  • It's not certain how far down in current one can go before the laser drops out of its "laser" mode or how high one can go before it gets "blowed up."
  • Laser current versus output isn't terribly linear which means that distortion can occur.
  • With the min/max current uncertainty, one can't fully modulate the laser's output safely which means that the audio on the beam will be somewhat "quiet" - something that reduces the efficacy of the link!
The better way to modulate a laser is to simply turn it on and off using Pulse With Modulation (PWM)  and taking advantage of the circuit already present to safely operate the laser from its intended power source - say, a pair of AAA cells (or 3.0 volts.)  While more complicated than simply putting the laser's power supply in series with a transformer, it's pretty much bulletproof and can sound pretty darn good!
 
Figure 1: Laser transmitter/receiver by K7RJ.
For a diagram of this unit, see Figure 4 at the bottom of this page.
Click on the image for a larger version.

A simple circuit to do this may be found in the diagram in figure 4 at the bottom of the page..

I won't take credit for this circuit which was thrown together by my friend Ron, K7RJ.  When built, this circuit was intended to be quick and easy and high performance was NOT in mind - just enough effort was put into it to make it work for demonstration purposes.

Contained within the diagram is enough information to connect your cheap, 3-volt laser pointer - just be sure to pay close attention to its positive and negative battery connections when you take it apart!

Also contained in this diagram is a very simple, low-performance receiver intended solely for across-the-room (or across-the-parking lot) testing of the transmitter to make sure that it works.  It should be emphasized that this receiver is not at all intended for longer-distance use - say, more than a few hundred meters at most, and its performance can be spectacularly enhanced with the careful installation of a small magnifying glass lens with the phototransistor at its focus.  Even when enhanced thusly, other optical receiver circuits will still run circles around it!  A link to a web page describing a far more sensitive circuit may be found at the bottom of this page.

At this point I'll make a few comments about laser safety and legality:
  • Make certain that your "laser range" is end-stopped - that is, when the beam goes beyond the receiver it does not cross a road or have any likelihood of being intercepted by aircraft in flight or landing/taking off where they can dazzle and distract!  In other words, the receive end should be against the side of a building or hill.
  • While cheap, red laser pointers are probably too weak to cause permanent eye damage, it's best not to stare into it or point it directly at people!  A standard, cheap red laser pointer will, at its worst, probably just dazzle and maybe cause a brief headache or eye pain as well as a temporary loss of night vision.  The farther you are away from it, the less dangerous it will be.
  • In some states and areas laser pointers are highly regulated or even illegal - including some U.S. and Australian states/localities - check your local listings!
  • It is NOT recommended that any but cheap, red laser pointers be used for this purpose.  Why?  First, they are the cheapest and secondly, they are fairly safe and low power.  It's also worth considering that typical electronic detectors respond far better (e.g. are more sensitive) to red light than green or blue - not to mention there being less atmospheric attenuation at "red" wavelengths!  Some of these "fancier" laser pointers of other colors have electronic circuits in them that can prevent them from being modulated effectively.

Figure 2:
Cheap laser pointer on a tripod
Click on the image for a larger version.
One thing that you'll immediately notice about laser pointers is that despite their name, they can be fiendishly difficult to aim them - particularly as the distance increases!  For this reason it's best to contrive a means by which a camera tripod can be used to hold a laser pointer - but even this can be tricky since even a fairly expensive tripod is quite "touchy"!  To the left you can see Ron's laser pointer mount with the pointer module itself being contained within a cheap project box from Radio Shack and connected by a short cable to the rest of the circuitry.

This brings up another point as well:  Do not put both the modulator electronics and your laser pointer in the same box.  By connecting them with a cable you will be able to make adjustments and turn the thing on and off without touching the tripod and possibly disturbing your carefully-aimed beam!

Another example of a laser pointer modified for such use may be seen on the right.  When I got this pointer I couldn't see how I could remove the laser module without the possibility of damaging it so I simply used it as-is:  A wooden dowel, the same diameter as AAA cells was used and at the inside end of the dowel was a small screw to which the minus (-) side connection was made.  The connection to this screw was made via a wire laid in a shallow groove along the length of the dowel and the positive (+) side was connected to the case of the pointer itself by using some copper foil wrapped around the end of the dowel opposite the screw.  The dowel was tack-glued into place, pushing against the internal battery spring and the laser's "on" button was simply taped down.  The entire pointer was then "hot-glued" to a cheap project box that itself has inside it a 1/4"-20 bolt glued into place to allow attaching to a tripod mount while electrically insulating the laser pointer's positively-connected case from the tripod.

Figure 3:
Minimally-modified pointer on a tripod mount.  This just happens to
be mounted atop an 8" astronomical telescope (a Celestron C8)
  with a equatorial mount which allows
precise aiming - and it also includes a telescope!
Click on the image for a larger version.
A lot has been glossed over in this brief article - namely techniques about how to accomplish a laser communication over longer distances including links to descriptions of higher-performance gear and methods of precisely aiming - and if you are really interested, you can take a look at my page:

 "Using Laser Pointers for Voice Communications" (see the link below) for a lot more detail than can be covered here.

How far can a lowly laser pointer go?

Under clear-air conditions on a line-of-sight path and using the very same lasers pictured above I've had a 2-way laser pointer to laser pointer communications on a 107 mile (173 km) path with fairly good signals.  This was, of course, using high-performance receivers with orders of magnitudes better sensitivity than the one shown it Figures 1 and 4 on this page!  In the "Using Laser Pointers..." link just above one can even find additional links to actual "off the air" recordings made via long-distance laser-pointer communications systems.

There are other problems with using lasers over distance, however, namely that of scintillation - the rapid fading or "twinkling" caused by the irregularities in the atmosphere.  While this affects all types of light sources the combination of the coherent laser light and the small diameter of the beam as it exits the laser greatly exacerbates the problem - but that's a topic for another article!

Links from the "Modulated Light" (link) web site:
Figure 4:
Schematic diagrams of a simple (but deaf) receiver for testing and a simple PWM laser/LED transmitter, described
in the text above.  This unit was designed by Ron, K7RJ and is shown in Figure 1, above.
Click on the image for a larger version.
[End]

This page stolen from ka7oei.blogspot.com