Laser intensity sensing

Hello,

I am working on a small project for which i need help with arduino programming..
i have a photodiode and a 100mw laser whose intensity will be changing continuously but will go down to zero...
i need help with collecting the values from the diode and if the value goes above a set number the a buzzer should go off....
im a beginner and need help with programming...

Hi- welcome.

I think if you're a complete beginner you ought to work through the examples, if you didn't already.

That said, you didn't show how your photodiode is connected, but presumably it's in a divider like this, where that label "adc" is an Arduino A0-A5 pin.

Then you would read it using something like this. In that example, the pot disappears and is replaced by your diode / resistor divider; the "adc" label is the same as the middle pin of the pot.

Get it that far, then have a think about the buzzer based on the value you read (and display on monitor).

Jim

Thank you for replying Jim..

Actually i have gone through the AnalogueRead example and im getting the resistance values in the range of 650-1023 at ambient light when the diode is covered and not covered respectively...
and is connected in the proposed way....
I am a mechanical engineer so dont understand that much of circuits and programming...

Saurabh

I'm only a civil engineer: I understand that stuff even less :stuck_out_tongue:

But afaik, the idea behind the divider is that the resistor you choose (1M in that link) allows you to vary the sensitivity (not sure if that's exactly the right word) of the sensor. This adafruit tutorial explains how to choose the resistor. It shows that the resistor affects how the sensor works better in "generally light" or "generally dark" ambience.

(The tutorial is for a photoresistor, not photodiode, but I guess the same thinking holds.)

You mentioned that you can help me with setting the resistance value for the buzzer...???
is that code difficult....?

saurabhp:
You mentioned that you can help me with setting the resistance value for the buzzer...???
is that code difficult....?

No I didn't say anything about a resistance for the buzzer. But it's not difficult: you need to read up on the if...else which is what you'll need to compare the actual value you read for the light to your threshold. Then if it's less than, do "this"; greater than do "that".... this and that would be say on and off.

I spent a couple years working in a laser/optics lab so hopefully I can help a little.

My first advice is to be very careful, 100mW is more than enough optical power to permanently damage your vision very quickly. Wear your laser safety goggles, control all reflections and transmitted beams, make sure nobody is wearing rings or wristwatches (a source of potential uncontrolled reflections) and be careful all around. If you haven't had any laser safety training you should consider it (let me know if you need help finding it).

I make the assumption that you are hoping to measure the laser power in Watts and not the laser intensity (Watts/meter2).

There are two basic ways to use a photodiode.

  • Photovoltaic mode uses the diode in a similar manner as a solar cell and might be useful for what you need.

  • Photoconductive mode is a slightly different mode of using the photojunction, generally a reverse bias is applied to the diode. Applying a bias voltage to the diode has a number of effects on the response to light, the useful part to you is that it improves the linearity of the response and can be used to help extend the power range it detects accurately.

There is a short explanation here at the Thorlabs site http://www.thorlabs.com/tutorials.cfm?tabID=31760 or a more thorough explanation on pages 4-5 of this info from Hamamatsu (warning large pdf of 26 pages) http://www.hamamatsu.com/resources/pdf/ssd/e02_handbook_si_photodiode.pdf

You weren't too descriptive on what your needs are with regards to how accurately you need to read the power over the whole range so either implementation might work. The voltage divider style circuit above might work fine, but if you need something more versatile I'd grab an op-amp and a voltage supply to reverse bias the diode with.

If you feel the need to practice your electronics skills a bit more you could build a comparator to trigger a buzzer rather than (or in addition to) doing it in software. Checking via arduino analog read could miss any power spikes between samples, whereas a comparator will respond to transient events that might not get caught via sampling..

Keep your eyes safe and keep us posted

As a matter of interest @Flatlander, what would the optical power of a typical classroom laser pointer be? I have a Genius 100 but the labels and the website are silent on the power.

I also have one of these, which at 3mW is pretty bright to me, so yeah I can imagine 100mW could fry your eyeballs.

It's good you read this post and responded on the dangers, never mind the technicalities of the OP's needs.

Thank-you @flatlander..
I am well aware of the dangers that are, while one is using a 100mw laser...i follow all the safety regulations...

And yes @jim its is a very bright laser..

I actually have a ttl circuit built to run the laser which also allows me to control the output of the laser from 0.5mw to 100mw..
I run all the tests with the laser at 0.5mw setting...
I actually bought this for star gazing...
but im using it anyway... :stuck_out_tongue:
My project is to transmit information from one building to other without loosing any data and fast...
The 100mw setting helps to work even on a sunny day....

JimboZA, typically anything under 5mW (of continuous wave power and not pulsed) is considered fairly safe for viewing diffuse reflections of i.e. not staring directly into the beam. Your blink response can still help you around this power range too if a careless laser pointer user blasts you in the eyes. Lasers should have a class label on them they should be 3a or lower. Your eye is also sensitive to wavelength, so your 3mW red laser would appear dim compared to a 3mW green laser. With LED powers being as high as they these days with tight emission angles they too can be eye safety hazards that aren't as obvious as a laser.

Saurabhp, I'm not too sure what kind of speed you are planning on transmitting at or how good your SNR is, but there are a couple easy tricks you can do to reduce the noise at your detector which should help your error rate.

  • First, mount your detector at the end of a tube, a cardboard paper towel roll or rolled up piece of black paper would work (but at 100mW it could be a fire risk), this will cut down on stray light
  • Second, place a polarizer at the entrance to the tube, as long as you have it rotated properly it should have almost no effect of the transmitted laser power while cutting down on the stray light that enters. A polarizer from a camera can be used or a cheap pair of polarizing sunglasses
  • Depending on the distance between your laser and detector the beam may have spread out quite a bit, if it has spread out larger than your photodiode's active area using a lens to focus the light will help. You should be able to scrounge a lens from something fairly easily
  • You should also make sure that your photodiode has good sensitivity at the wavelength you are transmitting at, if not you can find one that matches your laser wavelength on digikey or whatever supplier you use.

Doing that should help reduce your necessary power even during daylight and improve your SNR a bit. There are other techniques you can use that could cut back on on it even further but they start becoming more and more work.

Hope this helps, and it is good to see you are keeping yourself safe by doing testing at low power, I know two people who have suffered permanent vision damage from laser eye injuries so I'd hate to see someone else get injured. Laser safety isn't difficult but it is easy to make a mistake. Stay safe and keep us posted on how the project is going.

As an alternative to using a photodiode you can use an IR receiver and the IR library to transmit data. The IR receiver will respond quite well with red lasers, and most laser drivers won't have any problem keeping up with the ~38-56K modulation frequencies that IR receivers use. Most importantly, IR receivers are already designed with automatic gain control so they're pretty impervious to ambient light problems (with the exception of direct sunlight).

I think it'd be helpful if you'd be more precise as to how "fast" [sic] you want to transmit data.