Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Photo diode for motorway fog detection

cupoftea

Advanced Member level 6
Advanced Member level 6
Joined
Jun 13, 2021
Messages
3,307
Helped
65
Reputation
132
Reaction score
152
Trophy points
63
Activity points
17,163
Hi
We are doing a fog detector for motorways.
LTspice and PNG schem attached.

We simply use a QSD2030 Photo diode to receive light from a nearby Infra-red LED.
It has peak sensitivity in the Infra red region so is ideal since it means
ambient light wont cause so much reading inaccuracy.

Photo diode.

If fog gets between the LED and photo diode then the photo diode current reduces and the output
voltage of the opamp reduces. So obviously there's no need to respond to fog in
a millisecond, so we choose a 1nF feedback capacitor as shown.
Also a 1MEG feedback resistor. These give a Bandwidth of 159Hz which is plenty for this.
I mean, we will take 5 readings at 1Hz sample rate, then average those for the one reading.
We will filter the infra red light to the photo diode such that in brightest sunny days, only 2uA flows in the photo diode.
Then we have good "full scale deflection". The opamp Rail is 3v3 and we bias its Non-Inv with 0.58V as shown.

The following shows our method...

We hired a consultancy to do this for us but they came up with an AC coupled solution with a 10meg feedback resistor and 0.58v bias.
This would have meant a maximum of 272nA of photo diode current which is likely the dark current at 85degC or something!
(they used a 2p2 feedback cap). Anyway, they also AC coupled the output of the "photo diode opamp" (obviously with a MLCC capacitor) to the follow-on
stage which was an AC coupled non inverting opamp stage (capacitor in series with its input resistor to ground).
Also, they then AC coupled the output of that non inverting opamp to an RC filter, and then fed that to the microcontroller.
Dont see why they bothered with the AC coupling. Also, dont see why they needed the non inverting stage after the opamp
that they used with the photo diode?...they would already have been near the 3V3 rail without needing further amplification.
 

Attachments

  • photo diode with opamp.png
    photo diode with opamp.png
    29.8 KB · Views: 14
  • Photo diode with opamp.zip
    1.2 KB · Views: 12
Why not just do this yourself instead of hiring a consultancy and bashing their design?
You don't want or need DC coupling because sunlight, oncoming headlights, thermal effects etc. will generate photocurrent which can saturate the amplifiers. Even with optical filtering.
I don't expect fog to attenuate IR very much at all. You can look at detecting cloudy days, the light spectrum, colour temperature, IR amount changes very little.
For ideas look at photoelectric smoke alarms, they use a multipath system to get a good air sample. I would also look at a differential system with two photodiodes to reliably cancel out drift.
 
You don't want or need DC coupling because sunlight, oncoming headlights, thermal effects etc. will generate photocurrent which can saturate the amplifiers. Even with optical filtering.
Thanks, did you mean "AC coupling" rather than "DC coupling"?
Also, thanks we will do it ourselves.

You surely agree that AC coupling isnt needed?
 
I'm saying no DC coupling from the photodiode. You need AC coupling, and it's a point to rolloff LF hash like from streetlights.

IR preamp.PNG


Like this high gain discrete photo-amp for 38kHz. Also notice the diode-clamp prevents the amp from being overloaded with the associated recovery time if the carrier signal is too strong.
With you using the op-amp, it might not be possible to prevent the first stage from being saturated, which is why the gain/filtering is broken up over many stages.
It's a very difficult design, what you are doing actually.
 
Have you done any testing to see if rain mimics the density of heavy fog? Do they care?

One set of tests indicates Mie scattering causes more reflectivity with particle sizes near wavelength

Effects of Fog
  • UV: Transmissivity <5–15%, reflectivity 60–80%.
  • Visible: Transmissivity 10–25%, reflectivity 40–70%.
  • Near-IR: Transmissivity 30–60% reflectivity 20–40%.
  • Mid-IR: Transmissivity <10%, reflectivity <20%.

I have made optical test equipment in my career.
I would choose a reflectivity method into a clear view and use pulse mode for both UV and IR to differentiate between fog and rain, the latter which will modulate the results more.
 
I'm not in this business, but I would expect that measurement methods for visual range at motorways or airports ("runway visual range") need to comply with certain standards and can't be chosen at will. As far as I understand diffusion (scatterometer) rather than transmission measurement is the expected method. Also visual wavelength.
 
When I had looked into detecting an overcast, cloudy sky, as it is sunlight through thick water vapor, the absorption spectra seems to be nothing special.
That leaves light intensity or scattering, but in a small, low cost module as OP surely wants, this seems not easy.

Campbell Scientific they use LIDAR (light detection and ranging) to find clouds in ceilometers. It uses a laser and backscattering.
For their pyranometers, as an example the graph shows water i.e. fog doesn't do a lot for infra-red it appears.

Campbell Scientific cloudy day spectrum.jpg
 
A pyranometer is an instrument used to measure solar radiation flux density, specifically the total amount of solar energy received per unit area on a surface. If using a thermal pile measurement, it compares the electrical voltage of a black absorptive surface to one of Bragg gradient selective wavelength. It uses a clear view of the sky with a large area wind-shielded Si-cell.

Since the sky view spectrum tilts up towards the blue spectrum near 450 nm and the SI-cell tilts up towards IR at 1000 nm or 1um peak, the product of the flux and sensor is a relatively constant flat response. We know from scattering parameters in RF like in optical wavelengths the spectral transmission loss will result in a reflection and comparing clear sky with 9.6% overcast would look like fog if you flying thru it.

Given that the size distribution of rain to fog is huge which affects the spectrum of reflection, I decided to use two LEDs of opposite ends of the visible spectrum, UV and IR to be able to detect fog when there is no rain and visa versa. Some field tests for emitters with narrow beam lens and Si, GaN, AlGaAs or GaInAs detectors with narrow beam lenses could capture the best reflection of an unobstructed view for 10 m or so to capture the reflected light. The 5mm LEDs with narrow 10 deg lens make excellent photo detectors as long as spectrum is shorter than the emitter wavelength. This would be shaped like the Si spectra but shifted to the left of the emission spectra meaning it only responds to higher energy photo wavelengths up to a certain limit.

Given these are point source and detectors the RF Friis Loss rules for path loss support that the unobstructed view required to detect fog is about the range of your typical IR remote control unit. Given the great sensitivity improvement in SNR of using a carrier modulation like TV remotes, that would eliminate false triggers from PWM-LED headlights in the same optical spectra. Typically the turn on/off times for 5mm LEDs are in the 1 to few microsecond durations, 100 kHz modulation may be a reasonable limit far away from AUDI's ( the 1st OEM) or Tesla's or Cadillac's or whatever's LED headlight harmonics. Unless you wanted to trigger/calibrate your FOG sensor with a TV remote control on a rarely used carrier f, you may want to avoid those channels.

This is just the general design thinking I have used in the past to create new instruments and might be a good start for "fog detector". Is there a demand for this? How many do you need? (0?)

Afterward's now I asked Grok to comment on @prairiedog's interesting chart.
-------------------

1. Spectral Density Comparison: Clear Sky vs. Cloudy Sky
  • Clear Sky (Blue Line): The spectral density under a clear sky shows a broad distribution of solar radiation across the wavelength range, peaking around 500–600 nm (visible light) and gradually decreasing toward the infrared region (beyond 1000 nm). This is expected because, under clear skies, direct sunlight dominates, delivering a full spectrum of solar radiation, including ultraviolet (UV), visible, and near-infrared (IR) wavelengths.
  • Cloudy Sky (Red Line): The spectral density under a cloudy sky is significantly different. It’s much lower overall, indicating that clouds reduce the total amount of solar radiation reaching the surface. The reduction is not uniform across wavelengths:
    • In the UV and visible range (300–700 nm), the cloudy sky spectrum still shows some peaks, but they are much smaller than the clear sky peaks. This suggests that clouds scatter shorter wavelengths (like blue light) more effectively, which is why the sky often appears gray or white under overcast conditions—scattered light still makes it through, but at a reduced intensity.
    • In the near-infrared range (700–2500 nm), the cloudy sky spectrum drops dramatically, almost to zero beyond 1200 nm. Clouds are highly effective at absorbing or reflecting infrared radiation, so very little IR reaches the surface under overcast conditions.
  • 2. Implications for Silicon-Cell Pyranometer Measurements
    • The black curve represents the spectral response of the silicon-cell pyranometer, which shows how sensitive the device is to different wavelengths. Silicon-cell pyranometers are most responsive between 300 nm and 1100 nm, with a peak around 900–1000 nm, but their sensitivity drops sharply beyond 1100 nm.
    • Under a clear sky, the pyranometer captures a significant portion of the solar spectrum because its sensitivity range (300–1100 nm) aligns well with the broad distribution of solar radiation, including visible and near-infrared light.
    • Under a cloudy sky, the solar spectrum shifts heavily toward shorter wavelengths (UV and visible), with very little infrared radiation. Since the silicon-cell pyranometer is less sensitive to UV and has a peak sensitivity in the near-infrared (where cloudy skies provide almost no radiation), it underestimates the total solar irradiance in overcast conditions. This mismatch between the pyranometer’s spectral response and the cloudy sky spectrum leads to the 9.6% error mentioned in the graph.
  • 3. What This Tells Us About Cloudy Sky Spectral Density
    • Reduced Overall Irradiance: Clouds significantly reduce the total solar radiation reaching the surface, as seen by the much lower amplitude of the red (cloudy) curve compared to the blue (clear) curve.
    • Wavelength-Dependent Attenuation: Clouds don’t block all wavelengths equally. They allow more UV and visible light to pass through (via scattering) while heavily attenuating infrared radiation. This results in a spectrum that’s skewed toward shorter wavelengths under cloudy conditions.
    • Impact on Measurement Accuracy: For instruments like silicon-cell pyranometers, which are optimized for a broader spectrum (including near-infrared), the cloudy sky spectrum poses a challenge. The device overweights the infrared region (where there’s little radiation under clouds) and underweights the UV/visible region (where most of the cloudy sky radiation is concentrated), leading to measurement errors.
  • 4. Broader Context
    • This graph highlights a key limitation of silicon-cell pyranometers: their spectral response doesn’t perfectly match the solar spectrum under all conditions. In contrast, thermopile pyranometers (which I mentioned in my earlier response) have a flatter spectral response across 300–2800 nm and are less prone to errors under cloudy skies because they can better capture the full range of radiation, even when the spectrum shifts.
    • The 9.6% error for overcast conditions is significant in applications like solar energy, where accurate measurements are crucial for estimating power output. For example, if a solar panel system is being monitored with a silicon-cell pyranometer on a cloudy day, the device might underestimate the available solar energy, leading to incorrect performance assessments.
  • Summary
    The cloudy sky spectral density is much lower than that of a clear sky, with a pronounced reduction in infrared radiation (beyond 700 nm) and a relative emphasis on UV and visible light (300–700 nm). This shift causes silicon-cell pyranometers to underestimate solar irradiance under overcast conditions, resulting in a 9.6% error. The graph underscores the importance of choosing the right pyranometer for the expected sky conditions—silicon-cell models are less accurate for cloudy skies, while thermopile pyranometers would provide more reliable measurements across varying weather conditions.
 
Last edited:


Write your reply...

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top