0

I'm using a TSOP34838 IR reciever on an ATMEGA MCU, However, I see a problem in dark areas... If I put my finger in front of the receiever, it starts spewing out garbage, even worse when the room is completely dark (intended use case is a custombuilt rgb controller, so.. darkness is kinda needed to see the rgb). Powered via a wallwart, and more than enough (1k uF) caps on the power rail.

Issue dissapears when I connect for example my oscilloscope's grounding lead to the circuit... Therefore is quite undebuggable.. does anyone have any ideas in what I could try?

Rando Hinn
  • 75
  • 9
  • 1
    Sounds like a noise issue to me. Lets see layout and schematic. My betting is your finger is putting noise on the line when it's in front of the receiver. What's the protocol for the interface out of the receiver? What ESD protection have you put in place? The fact the noise goes away when you plug another ground into the circuit makes it even more likely it's a noise problem. – Puffafish Jul 10 '19 at 15:02
  • 1
    Please post the schematics and PCB layout. We can't know how you designed and built the device. – Justme Jul 10 '19 at 15:16
  • 1
    We aren't at your bench, post schematics and PCB layout – Voltage Spike Jul 10 '19 at 15:19
  • 2
    Try a stiffer pullup resistor. Try making a version of the setup powered with batteries with no external connections and doing something like blipping a piezo when it detects, put it in a dark box and see what happens. Saw this kind of thing once ages ago and traced it to a difference in production vs. sample components; in retrospect I suspect it was an early encounter with counterfeits or rejected parts snuck out the back door and sold without authorization. That said, a sound reception algorithm should be able to deal with this - was able to solve my problem by improving the software. – Chris Stratton Jul 10 '19 at 15:42
  • 1
    "Powered via a wallwart" that's highly suspect, especially in conjunction with a change of behavior when the scope is connected. The recommendation to do a battery powered test with no connections is to remove factors like this until you find the actual cause. – Chris Stratton Jul 10 '19 at 15:45

1 Answers1

1

IR receivers work by measuring the leakage current on a photodiode with a high-gain amplifier. Because of the high impedances involved, they can pick up electrical noise from nearby sources - like your finger for example. There are shielded versions of IR sensors which help with this issue. Otherwise, just know to keep your finger away...

Also, some light sources can interfere with IR sensors, such as high-frequency fluorescent light ballasts. A light filter can reduce this.

More: why does it stop when the scope is connected? Your wall-wart DC supply has a 'floating' output that is probably injecting hum on your setup due to leakage from the line to the ungrounded secondary. (If it's a really cheap wall-wart it can be quite a lot.) This is normal and not (usually) hazardous, but it can cause problems with sensitive circuits like this.

In this case the sensor is picking up that floating-ground hum as a difference between itself and your somewhat-grounded body. With the scope attached the power supply secondary is no longer floating, and the hum is shunted away to ground. So with both sides grounded, the difference disappears, and along with it, the sensor misbehavior.

Try this: Touch the board's ground and bring your finger to the sensor. I predict that the problem won't happen then, either. Why? Your body will be at roughly the same potential as that leaky wall-wart ground, no noise will couple to the sensor.

What's this noise then? Try this: Measure it with your scope with the probe ground connected to earth and the board itself ungrounded. That is, have the low-voltage side floating. You will see the floating ground hum / leakage that typically looks like spikes at twice the line frequency. It can be surprisingly large - 60V in some cases, and it may depend on which way you have the wall-wart plugged in. But because it's a weak AC path it's very low current so it's not dangerous.

Where does it come from? The noise is AC coupling from the primary to the secondary, through the transformer that isolates the two domains. And if you’re really unlucky, besides line-frequency noise there may be some switching noise riding on it too, which might be in the bandpass range of the sensor (e.g., 38KHz.)

Finally, why it’s worse in the dark: the sensor AGC function is maxed out so it will be at high gain, making it more sensitive to noise.

hacktastical
  • 49,832
  • 2
  • 47
  • 138
  • Keep in mind that these aren't just amplified photodiodes, they have filters looking for a modulation frequency and an AGC which is typically looking for that to be keyed on and off at a reasonable pulse rate. – Chris Stratton Jul 10 '19 at 18:29
  • Yes, while that’s true, it isn’t the explanation of the root cause of the problem: coupling from the human body to the photodiode amp, nor does it explain how to mitigate against it: shielding, or distance. – hacktastical Jul 10 '19 at 19:17
  • I added information about the power supply grounding, which seems to be the main underlying issue when combined with the high impedance node in the sensor. – hacktastical Jul 10 '19 at 19:34
  • I have narrowed it to indeed be grounding problems. Shielding the receiver seems to help, will search and order some that already have a shield on. – Rando Hinn Jul 13 '19 at 10:01