decisions

Infrared at 38kHz

Infrared detectors traditionally suffer from interference - false triggering, and failing to trigger. This has been a common problem in pinball machines - "bloody optos" being a catchphrase I've heard many times. To overcome the interference problem, I'm using an infrared receiver that only "listens" to infrared (IR) that has a carrier frequency of 38 kHz. In simple terms, if the IR light is not blinking on and off at 38,000 times a second, it gets ignored.

There are other gotchas using these receivers - if they see the carrier for longer than a smallish burst, then instead of indicating I can see the light, they turn off. The next time the light is obscured and reappears then they see the light again.

I thought I'd use this behaviour to my advantage, and have the receivers saturated all the time (continuous carrier) - that way I'd get a nice clean pulse every time, after the ball passes the receiver. This actually works quite well, but not for very fast, or multiple balls.

So back to the original idea of sending little bursts of 38kHz infrared. Did that and works a treat. You can see the flickering LEDs in the video in Serpent Lanes.

Since the transmitter does NOT provide a 38 kHz signal (It's just an IR LED) I have to modulate it myself,

I used a Raspberry Pi Pico 2040 because it's fast, cheap and has 2 cores. Wrote a little  C++ to generate the IR pulses for each lane and test for obstructions (the ball), and output the detection in a smoothed-out-way¹, as well as a bit of code to monitor temperature to add to the Watchdog.

Tested over time with different lighting and interference environments² and it works well.


1 Technical term for a clean signal.
2 Left it in different rooms.