Newb: can someone confirm my button circuit?

Sorry for my stupid question, I don't have much electronic experience and Arduino was the simplest way I found for my project.

Can someone please confirm this is correct?
(err, image below)

I drawn this reading the button tutorial on Arduino guide

There's an even simpler way to detect a switch?

I have an external circuit, it's a photogate, that triggers when a laser beam is blocked it turns "on", like a switch...

There's no current on the output, it's just a 400v SCR (EC103D).

So I plan to use this wiring on the SCR output, instead of a switch.

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!

:smiley:

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?

Thanks for the help Mathieu!

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 :smiley: )
  • 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 :slight_smile:

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.

Beautiful shots, both of them! :o

So the loudspeaker throws the drop upwards? :-?

Yes, upwards, here's how:

(click the picture for setup description)

That's really neat! Is that an old trick or did you make that up?

The only other person doing with loudspeakers I know is:

See this video from him, it's absolutely awesome!!!
Imgur

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 :stuck_out_tongue:

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.

This is very cool. I want to play too! :slight_smile:

I have 2 questions:

  1. 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?
  2. 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.

Mikal

Hi Mikal,

I'm interested on the answer for #1 too :slight_smile:

I've seen people using car solenoids for the water dropper, I think it's from the fuel injection or the engine startup... it's 12V.

The solenoid is the only component I don't have yet, everything else is working and I just need to get all togheter on Arduino.

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. :slight_smile:

Thanks!

Mikal

If any HW guys would care to comment...?

That's fine you are not burning up anything. :slight_smile: