OG0VA1B External Trigger
External Trigger Signal
Pinout Definition
Name | Pin |
---|---|
trigger input | XVS |
ground | GND |
Windows GUI
Access Camera Kit
Tip
The new version of OG0VA1B Evaluation Kit supports external trigger function. If you need related application, please contact sales@arducam.com for the configuration file.
External Trigger Python code
This tutorial is based on Raspberry Pi. You can use any embedded device that supports signal transmission in practice. Please correctly connect the camera and trigger signal parts according to the hardware connection section.
import RPi.GPIO as GPIO
import time
import argparse
GPIO.setwarnings(False)
GPIO.cleanup()
GPIO.setmode(GPIO.BCM)
GPIO.setup(18,GPIO.OUT)
def main(framerate, trigger_time):
trigger_time = trigger_time / 1000
sleep_time = 1/framerate
sleep_time = round(sleep_time, 3) - trigger_time
print("Start Trigger! Press CTRL+C to exit")
try:
while 1:
GPIO.output(18, GPIO.HIGH)
time.sleep(trigger_time)
GPIO.output(18, GPIO.LOW)
time.sleep(sleep_time)
except KeyboardInterrupt:
GPIO.cleanup()
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Trigger")
parser.add_argument("-f", "--framerate", type=float, default=30, help="frame rate")
parser.add_argument("-t", "--trigger-time", type=float, default=1, help="Trigger signal maintains high level time (ms)")
args = parser.parse_args()
main(args.framerate, args.trigger_time)
-f: frame rate of external trigger, in this example the trigger is 140 frames
python3 trigger.py -f 140
Demonstration
Due to the default exposure time is relatively long, if you want to get a higher frame rate, you need to reduce the exposure time. For example, if you need to trigger externally to 140 frames, you need to adjust the exposure time to about 600 us.
Note
If the frame rate does not reach the desired frame rate, you can try to reduce the exposure time.