depthai-core
depthai-core copied to clipboard
[Feature-Request] IR Pulse Code Embed
Why would I want an "IR Pulse Code Transmitter" built into my camera's IR light?! IR pulse codes are prevalent in the world (TV Remotes, Camera Remotes, Security Systems, etc.) and they all are used to make "remote" objects do things. It's how we communicate with so many of the things around us each day. When a camera (especially one with a neural accelerator) processes something it is trained to detect, communicating that output is important! Usually this is a computer, but what if the vision system also had a voice?
What would this solution do?? An IR pulse train COULD BE one of the answers to this problem. In our case, we would like to transmit an "inhibit" command when we see a particular device in front of the camera to prevent the object from moving, but it could just as easily control a drone, open a door, turn off a TV, etc. It need not even effectively adjust the existing IR PWM duty cycle if so desired.
How could this be done??? Imagine being able to call a function in your script that could transmit a pre-defined pulse code (on/off delays in the range of 20-3000 us) with a specific "carrier" frequency (30-60 kHz). This would allow you to generate pulse codes that can be sent to other devices in the world to make them do things. It's the camera's digital IR voice. It could even sit on top of the existing LED duty cycle if the user is willing to have a slight change to the IR light quality during the transmit function.
My suggestion for this would be to build a function that would use the following inputs:
- desired carrier frequency - range 30-60kHz
- desired PWM duty cycle for carrier frequency - default 50%
- pulse train array (list of on-times and off-times)
The pulse train array could be arranged with columns "PWM On" & "PWM Off" with as many rows as necessary to accomplish the pulse train signal. Would likely need to have tight-ish timing to make sure the pulse trains are close enough for consistent performance. May need to set the Interrupt Handler for this subroutine higher than non-timing-critical tasks.
The following adafruit link discusses the IR Pulse Code implementation on Arduino and it seemed very helpful to describe the feature for that architecture. https://learn.adafruit.com/ir-sensor/ir-remote-signals