Im a not an electronic engineer nor do I understand optical science so forgive my basic pleas for help.

I want to detect a light on my heating boiler. I think the led is on a PCB and there is a tube that directs the light to a diffuser on the front panel. The light is Green but not sure if that is diffuser or the led?

I used a very basic phototransistor circuit emitter to ground, collector to 3.3v via a resistor. I am feeding the collector to a raspberry pi gpio input. It works fine when testing against a bright Green led (3.3v via 330Ohm resistor). However, when I try and detect the boiler light it doesn’t work.

I have tried increasing the resistor on the collector from 10K to 500k then 1M and next 6M. This definitely helped with the sensitivity on my test breadboard with a dimly lit LED. Unfortunately, it still didn’t detect the boiler light? Should it be able to detect light through a “diffuser”? Would an LDR be a better option, this isn’t high frequency stuff, only to detect when a boiler is running? I only have a cheap Multimeter and tried measuring volt drop across resistor but gave up:)

  • 1
    \$\begingroup\$ What phototransistor are you using? The wevelenghts must be matched. \$\endgroup\$ Commented Dec 4, 2023 at 1:52
  • \$\begingroup\$ used 2 different types. both for visible spectrum and both worked fine for red and green leds (just not the diffused green light on my boiler:( \$\endgroup\$
    – Mark E
    Commented Dec 4, 2023 at 9:44

1 Answer 1


If it's visible green, and it's not an IR-filtered phototransistor, it will read any other source of green just as well as an LED source.

It may just be that the green is too dim (in part because of the diffuser), or there's too much ambient light interfering with it.

You didn't say what the pin voltage was when used with the various resistors, and with the phototransistor illuminated or not, so I'm guessing this, at least in part, explains the issue.

If you aren't willing to modify the boiler, you've probably done about all you can do. Perhaps you can find another solution, like measuring the power input, or fuel consumption, exhaust temperature, etc.

  • \$\begingroup\$ Thanks for response. The voltage was 3.3v from positive supply from raspberry pi. I did try and measure volt drop across resistor for various resistor values and test led brightness values. I gave up when I encountered a value of over 4 volts across the 1M resistor at dark current (100nA) :). Probably something to with meter impedance or something? I didn’t want to go down that rabbit hole:) \$\endgroup\$
    – Mark E
    Commented Dec 4, 2023 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.