If your photogate turns on by becoming conductive, that is correct: when the switch is non-conductive, the pull-up will pull your pin to 5V, and when it is conductive, the pin will be pulled to gnd.
If i understood correctly and it is a Silicon Controlled Rectifier with the gate connected to a photodiode, that should be the case but you can expect some leakage current which means the pull-up will have a voltage drop across it... but normally not enough to make a difference for a digital read.
By the way, there's another guy on this board trying to make a camera flash controller who'd love to get his hands on your opto-isolated SCR!
Oh, another thing: SCRs exhibit hysteresis behavior. This means that the current needed to switch them ON is higher than the current needed to keep them turned on... so you may have difficulty turning the switch back off once it is on, or you may notice the light level needed to turn it on is noticeably brighter than the one at which it turns off again.
This may or may not be a good thing in your application.
What are you trying to do, if you don't mind me prying?
The whole idea is to take pictures of water drops.
I plan to use:
a solenoid for controlling flow of water drops eletronically
a photogate laser trigger (already have this working)
a loudspeaker and amplifier (my hometheater subwoofer, I need a simpler speaker )
camera and high speed flashes (have that too)
Steps:
Arduino activates camera on long exposure (3 seconds), that should be easy, I plan to use a 4N28 optocoupler
Arduino activates solenoid (another optocoupler), that produces a water drop
The falling drop crosses a laser beam (it turns on the SCR from my original question here)
Arduino detects the SCR close, then wait X miliseconds
Arduino activates the loudspeaker... it has another water drop on top of it
Arduino waits Y miliseconds
Arduino activates a wireless flash trigger, that activates multiple flashes (another optocoupler)
By adjusting X and Y miliseconds, I plan to capture the exact moment the 2 waterdrops splash on each other.
I was able to make it work separate... now I want it togheter... Here's some results:
Using a sound trigger, activated by loudspeaker, with a delay to wait the waterdrop formation:
A waterdrop on a US dime 0.10 cent coin, falling from 2 feet, detected by laser:
I did both photos
The only thing missing for my whole setup is connecting everything togheter on Arduino to get miliseconds precision, I'm tired of adjusting delays on potentiometers... and the solenoid I just started researching.
The only other person doing with loudspeakers I know is:
See this video from him, it's absolutely awesome!!!
His setups are very complex, microprocessed and all time based... mine are much simpler, triggering with sound trigger circuit to do similar shots is my idea
Now I want to improve, hopefully Arduino will be the key!
There's also another technique of 2 consecutive water drops... when the first hits a surface and splash upwards, a second drop splash on it. I will try it when I get a solenoid water dropper working.
Couldn't ChL's original switch circuit have been simplified by using the Arduino's internal pull-up resistors and the digitalWrite(pin, HIGH) trick on an INPUT pin?
Where can you get a solenoid water dropper? Or solenoid toys in general?
Thanks for the post. I would love to keep up with this project.
I have personally created a couple of little projects that use this topology
Gnd---Switch---Pin8
and then
pinMode(8, INPUT);
digitalWrite(8, HIGH);
to employ the internal pullup. It seems to work, but I have some lingering doubts about whether I am slowly burning up my Arduino pins. If any HW guys would care to comment...?
I may have to pay a visit to the automotive store. I read in another thread about a guy making a fountain sculpture thingy out of windshield wiper spray pumps.