Go Down

Topic: Digital pin input floating - pull-up resistor present (Read 565 times) previous topic - next topic

DStoupin

Brief:
I'm trying to make Arduino catch shutter signal from a camera trigger (a controller that sends shutter signals to a camera). However I end up having a floating input.

Long:
The camera trigger signal seems universal across most devices: the circuit is 3.3V and it falls to 0 when the signal is sent. Camera fires. The circuit comes back to 3.3V. There's actually also a focus signal in the third pin but I'm not using it, so let's ignore this one for the sake of simplicity.
So catching the shutter signal from any device is as simple as reading the pin going from high (3.3V) to low (0V).

The board is Arduino UNO.
The camera trigger is a time lapse controller with lots of fancy functions (works well, its signal is clear and doesn't seem to float)
The task is to catch the trigger by arduino and create commands for multiple other devices.
The output from arduino works so I'm going to skip on pins 8-12 (on the diagram) and only focus on the input

My first solution was to use internal pullup.
Code (relevant bits only)
Code: [Select]

#include <avr/interrupt.h>
pinMode(2, INPUT_PULLUP);
attachInterrupt(digitalPinInterrupt(2), buttonPressed, FALLING);


The input was floating and slight touch of the UNO or the camera trigger would create a false positive.

The second solution was to use an external pullup resitor (on the diagram attached).

The code was (relevant lines only):
Code: [Select]

#include <avr/interrupt.h>
pinMode(2, INPUT);
attachInterrupt(digitalPinInterrupt(2), buttonPressed, FALLING);


The outcome is pretty much the same (a bit better).


There gotta be something that I misunderstand (new to it!). Any help appreciated.

dougp

If the circuit is indeed as your graphic shows you do not have an input pullup, merely a resistor between the camera and Arduino.

A pullup resistor pulls up  to some positive voltage.  You could do away with your pullup by using the AT328's internal pullup.  See drawing below regarding S3 and S2:

I don't trust atoms.  They make up everything.

No private consultations undertaken!

DStoupin

Thank you,

The internal pullup (INPUT_PULLUP on pin 2) was floating when I tried and there was no 10k resistor there between the camera trigger and the pin.

That's why I tried to to use "external pull up," which in my case is not like with a button. There's already a 3.3V circuit in the camera trigger. How can I pull up a system without a button? Technically the whole camera trigger is a button I guess, but it operates on its own circuit and I don't think I can just pump current into it.

dougp

So if you put an LED in series (cathode to shutter controller ground) with a 180 Ohm resistor, both across the shutter output, the LED will illuminate when the shutter trips?
I don't trust atoms.  They make up everything.

No private consultations undertaken!

jremington

#4
Aug 24, 2019, 11:22 pm Last Edit: Aug 24, 2019, 11:25 pm by jremington
Quote
The input was floating and slight touch of the UNO or the camera trigger would create a false positive.
This is not evidence for a floating input.

The way you have it wired, with an interrupt triggered by a falling edge, that observation suggests that grounding the input with a relatively low resistance circuit (including your sweaty finger) produces that falling edge.

Try using an external 1K pullup resistor from pin 2 to 3.3V.

DStoupin

Thank you guys.

Quote
This is not evidence for a floating input.

The way you have it wired, with an interrupt triggered by a falling edge, that observation suggests that grounding the input with a relatively low resistance circuit (including your sweaty finger) produces that falling edge.
Indeed it is not a floating pin. When I touch the AC power board or its plug, there's false positive. It seems like a grounding issue. What's the best procedure for fixing it? Power Arduino with a battery so it doesn't share ground with anything?

I don't think I can externally pullup the trigger signal as it works on its own circuit and trying to run a separate current through the camera controller makes it malfunction. So far I removed the 10k resistor to make the signal stronger for testing purposes.

jremington

#6
Aug 25, 2019, 07:08 am Last Edit: Aug 25, 2019, 07:10 am by jremington
Quote
Power Arduino with a battery so it doesn't share ground with anything?
The Arduino must share ground with anything it controls.

Your diagram doesn't provide enough information to say what the real problem is.

Where does that mysterious wire labeled "power" go?

Quote
I don't think I can externally pullup the trigger signal as it works on its own circuit and trying to run a separate current through the camera controller makes it malfunction.
Sorry, that makes no sense at all.  What powers the other things attached to the Arduino?

MarkT

A pullup resistor needs to go from the pin to the relevant supply, here the 3V3 rail.  10k isn't
much better than the builtin pullup, use 2k2 or 1k
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up