Using a Solar Cell as a Light Sensor (for custom laser tag)

about a week ago my first Arduino board got fried. so this for now will have to be all theoretical.

I am working on a prototype for a Laser tag game based on real lasers (yes im being concerned with eye safty and the likes)

Rather then using smallish light sensors i am atempting to use flexible solar cells as targets to be intigrated into a vest or some kind of wearable target.

I have done some tests (as much as i can without being able to control the laser with the Arduino board) and the laser will consistantly provide a voltage spike.

The main idea behind the vest will be to interpret a coded laser signal that has a set frequency like 10KHZ. the voltage from the cell ranges from 0 in darkness to about 3ish in regular light.

What would be a proper setup for the arduino board to read spikes in the voltage in any light to get a frequency?

i dont know what the response time of the cell is. I was planning on using the board to find that out before it died.

3v's doesnt come directly from the laser. in regular ambient light ill get 3.1v with the laser ill get 3.2 or 3.3

so id need the arduino board to be able to identify any spike with a specific frequency.

o id need the arduino board to be able to identify any spike with a specific frequency.

Have you identified this frequency with an oscilloscope?
Until you've done that, a KE7GKP suggests, you may be wasting your time.

Im at work so i cant verify directly, but in total darkness i belive the laser provided almost 1v from the cell. and as more ambient light reached the cell that number got smaller. But the spikes were readable with a voltmeter in any light source.

I guess my question is more of a hardware question. how would the solar cell which provides a charge get interpreted by the board. would it go to an analog pin? how do i interpret the voltage in the software?

Forget the Arduino until you've verified that the photovoltaic will respond to a 10kHz modulated beam.
If it doesn't you're simply wasting time trying to interface to something I suspect cannot work.

The arduino in the gun will be modulating the laser at what ever frequency I need. Seeing as I dont have a working arduino board right now I simply stated this talk would be mostly theoretical.

So in theory I can modulate the laser anywhere from say 1mHZ to google plex GHZ. /sarcasm

That being said, my question is still valid. How do you get an arduino board to read voltage coming in as something meaningful?

Well, to read a 10kHz signal, you'll need to sample at 20kHz minimum, and the standard analogRead takes over 100us, so there's going to be a speed gap of over 10kHz there.
Have a look around for ways of speeding up analogue reads.

so an analog pin can interpret a signal from 0 to 5v? i can tell the difference between 3v and 4v?

the reading a frequency off the solar cell depends on the ambient light around. in complete darkness the freqency is easy to interpret as off and on. however in shade and sunlight the off voltage will vary as will the on voltage.

if the analog pin couldn't tell the difference between voltages then standing in different light sources would never register a hit.

in complete darkness the freqency is easy to interpret as off and on

Are you absolutely certain about that?
You’ve viewed it on an oscilloscope?

i dont own an occiloscope so no. But viewing on my voltmeter at say once a second voltage went up to .9v and down to 0.00v so that is what im going by.

But viewing on my voltmeter at say once a second voltage went up to .9v and down to 0.00v so that is what im going by

Voltmeters are OK for DC and low frequency AC, but like a solar cell, not great at 10kHz.

Laser light is intense - the whole beam falls on the detector so there won't be an inverse-square fall off in total luminous flux. The simplest way to detect a particular frequency is to sample at an integer multiple of the transmitted signal and do simple digital filtering to get the amplitude of the signal at the frequency of interest. Easiest would be sample at 4 times the frequency, call the successive samples a, b, c, d, a2, b2, c2, d2 etc, calculate x = sum of a's - sum of c's, y = sum of b's - sum of d's, result = xx+yy.

Do this over a sliding window onto the samples and you have a nice little complex resonator based detector that you can make arbitrarily band limited with crystal control of frequencies.

KE7GKP:
You will need to be very clever to accomplish this without using an oscilloscope or something similar. A meter probably isn't going to cut it.

I was planning on writing the reciving code to detect a burst and light an LED or something. I would send smaller and smaller bursts from the laser until I no longer got a hit detected. What ever the smallest busrt detected would set my frequency. So for instance start at 500 milliseconds, and hopefully get down to less then 30.

After that test is sucessful recode to interpret simple binary codes likely to be hard coded for testing purposes. I figure I will probably need to adjust the frequency during this step as well to properly read 1's and 0's

on a side note i hopefully will be ordering 2 new arduino nano boards this weekend.

What if someone goes into a brighter (more sun) area?

…or sneaks a flashlight into the playing area?

daveg360:
What if someone goes into a brighter (more sun) area?

Full on direct sunlight may be the only issue i come against. If the sunlight is bright enough to max out the voltage on the solar cell it will be impossible for the laser to make the current spike at all. I will need to do more testing.

...or sneaks a flashlight into the playing area?

This is why there needs to be some kind of modulation. if there isnt any modulation then the same effect would apply going from shade to sun or back. but if the reciver is looking for a specific frequency it would be impossible for a person to use a flashlight to create that frequency.

I read this post this morning thinking this would be nearly impossible like everyone else, but eight hours later and I came up with an idea: set the solar panel to drive an LED and "optocouple" that LED with an IR receiver.

I've just tested this with a 38KHz modulated pen laser (~2mw) directed at a Seeedstudio 6V solar panel driving a 5mm LED pointing at a Vishay TSOP4038 receiver. It seems to work pretty well, and I don't see any ambient light effect against the solar panel other than the fact that the panel has to supply enough juice to turn the LED on.

How's that for a simple solution? XD

Full on direct sunlight may be the only issue i come against. If the sunlight is bright enough to max out the voltage on the solar cell it will be impossible for the laser to make the current spike at all. I will need to do more testing.

Don't worry it won't max out with sunlight, photovoltaics work just fine at many times sunlight intensity.

MarkT:

Full on direct sunlight may be the only issue i come against. If the sunlight is bright enough to max out the voltage on the solar cell it will be impossible for the laser to make the current spike at all. I will need to do more testing.

Don't worry it won't max out with sunlight, photovoltaics work just fine at many times sunlight intensity.

Thanks thats good to know. A friend of mine who is helping me on parts of this project (as hes an electrical engineer) was concerned the Arduino chip wouldnt be fast enough to use an FFT algorithm. Has anyone used this before?

1 Like