Skip to main content

GPIO trigger using Arduino Leonardo

Answered

Comments

4 comments

  • Official comment
    TDY_Ifeanyi
    Community team
    Great answers
    Expert (Gold)

    Hello Dominic,

    It is not very clear if the issue is related to the camera, configuration or switch itself.

    Please note, to trigger camera via opto-isolated Line0 would require to ground pin5 (blue color) and not pin6. Check if updating this configuration helps to resolve this issue. 

    Otherwise, one troubleshooting step is to test camera can be triggered without any external device:

    1. Enable trigger and set Trigger Source to Line2
    2. Start image acquisition
    3. Connect and disconnect Line2 (red colour) and pin6 (brown colour) at a second interval or less.
    4. You should observe camera grabbing frame during this process. 

    Please let me know if the provided information helps to resolve this issue.

    Regards,

    Ifeanyi

  • TDY_Ifeanyi
    Community team
    Great answers
    Expert (Gold)

    Hello Dominic,

    With reference to the installation guide, we specified 1k ohm resistor for both opto isolated and non-isolated line using 5V external voltage. 

    Could you shed more light on what you mean by connecting "momentary SW between Line 2 and GND"? Does it work if Line2 is directly connected to Arduino TTL line and camera pin6 (brown color) to Arduino ground?

    Regards,

    Ifeanyi

    0
  • Dominic Lim

    Hi Ifeanyi,

    Thank you for your reply.

    I currently have my Arduino connected to a 12VDC power supply, which is grounded to the same ground as the camera pin6. This is my code for the Arduino TTL output, which I trigger using a button: 

    //Write TTL pulse
        if (buttonState == HIGH) {
          // turn output on:
          digitalWrite(outputPin, HIGH);
          delayMicroseconds(12);
          digitalWrite(outputPin, LOW);
          delayMicroseconds(6); 

    When I press the button, I don't notice any change on the SpinView log, or the Line Status:


    What should I expect to see? I understand that the Frame Start trigger selector is supposed to grab an image from the continuous acquisition.

    For your question, previously I meant that I had also tried shorting Line 2 and GND as a trigger. I connected a button switch between Line 2 and GND, then pressed it to trigger - but I also didn't notice any feedback from SpinView to indicate that the trigger was received

    Please let me know if you have any advice on the troubleshooting steps I should take

    0
  • Dominic Lim

    Hi Ifeanyi,

    Thank you very much for the information, it was very helpful and has resolved my issue. Testing Line2 (red colour) to pin6 (brown colour) connection worked to grab the image.

    For Line0, I hadn't wired the ground pin5 (blue color) for the opto-isolated input. I also changed the Rext to a 560ohm resistor for Line0 (TTL pulse is from Arduino Leonardo pin), and after these 2 changes managed to trigger the image grab.

    Thanks again!

    0

Please sign in to leave a comment.

Powered by Zendesk