OptoIsolator

I need help picking out an optoisolator that will activate when it sees 8-24VAC and output 5V DC. I'm not sure where to start.

I attached an image of my circuit, the two green wires at the bottom are a switch that sends 5VDC to spin the motor. I would like to make this switch turn on automatically when it sees 8-24VAC.

And what do you want it do do when it sees only, say, 6V AC? What
frequency AC? Do you want DC to be ignored?

how much current does the 5V DC output take?

You are not thinking of powering a motor from the Arduino 5V rail are you?

Maybe one of these parts to sense the AC

Then a simple relay to switch power on to the motor, or an N-channel MOSFET to act as a switch to connect motor '-' to Gnd.

MarkT:
And what do you want it do do when it sees only, say, 6V AC? What
frequency AC? Do you want DC to be ignored?

how much current does the 5V DC output take?

You are not thinking of powering a motor from the Arduino 5V rail are you?

The motor is powered by the 12v DC power supply using the arduinos Vin pin.

the 5V pin on the arduino is used as a switch connected to pin 2 and a pull down resistor to tell the stepper motor to move one revolution when the circuit is closed.

Instead of a switch, I would like to use an optoisolator to switch the circuit when there is approx. 8-24VAC applied which would send 5V to pin 2 on the arduino which would tell the stepper motor to move one revolution.

If the voltage is less than 8VAC, then I don't want anything to happen. If it's more than 24VAC, then it's fine if it triggers the switch.

That's different. For that, run the AC thru a diode so it's just a ripply positive only signal, and smooth it out with a RC lowpass filter. (try 4.7K resistor and 10uF to Gnd).
Take the junction of the resistor/capacitor and connect to 2-resistor voltage divider so that 24V in outputs 5V max out. Then you can read that with an analog input and make decisions about on/off.

That's different. For that, run the AC thru a diode so it's just a ripply positive only signal, and smooth it out with a RC lowpass filter. (try 4.7K resistor and 10uF to Gnd).
Take the junction of the resistor/capacitor and connect to 2-resistor voltage divider so that 24V in outputs 5V max out. Then you can read that with an analog input and make decisions about on/off.

Thanks, for the voltage divider, you said 24V in outputs 5V max out. Is there a way to set that up to take range of 8-24V in and always output 5V?

I was hoping a simple relay or optoisolator would do the same thing, or do they not take a large range of AC voltage like that?

You could bring the power in to a switching regulator that accepts a range of DC voltages and outputs 5VDC.
I would run the AC into a fullwave bridge rectifier (4 diodes) and a filter capacitor before feeding it into the switching regulator.
Check the regulators at www.pololu.com and see if they have high enough current output for your motor.

You could bring the power in to a switching regulator that accepts a range of DC voltages and outputs 5VDC.
I would run the AC into a fullwave bridge rectifier (4 diodes) and a filter capacitor before feeding it into the switching regulator.
Check the regulators at www.pololu.com and see if they have high enough current output for your motor.

Thanks, although I'm not looking to drive the motor with the doorbell voltage. It's a stepper motor which is powered a separate 12V DC supply and controlled with a stepper driver. I need the doorbell AC Voltage to act as a interrupt on the arduino digital pin so when someone presses the doorbell, the arduino signals the driver to turn the motor one rotation.

The doorbell voltage can be 8-24VAC. I think the rectifier would work, but only if I knew the exact AC voltage the bell supplied and then regulate that to 5 volts. How can I make a circuit that takes any AC voltage between 8 and 24V and outputs 5V DC? is that even possible?

It is an odd sort of bell that gives you 6V when it is not pushed. Are you sure it will.
A simple transistor with a potential divider on the base and a collector resistor to 5V will do what you want once you rectify and smooth the AC.

Grumpy_Mike:
It is an odd sort of bell that gives you 6V when it is not pushed. Are you sure it will.
A simple transistor with a potential divider on the base and a collector resistor to 5V will do what you want once you rectify and smooth the AC.

It's 0v when not pressed. 8-24V AC when pressed. I would like it to be 5V DC when pressed. I found this stepdown voltage regulator that I think will do the trick.

You do not need a regulator, you need what I told you you needed.

Is there a way to set that up to take range of 8-24V in and always output 5V?

Yeah, it's called a WINDOW DETECTOR

FYI, needless to say, you have to rectify the ac and convert it to dc before using the above circuit.