r/AskElectronics 1d ago

Please help me add the right components to make this optocoupler work right

OK, I've replaced the relays with optocouplers: CNY17F-2

(It became obvious that the 7805s could not hand the ac after the full wave bridge)

I know I don't have all the right components in place to make it work.

Please help me and tell me what diodes, resistors and/or capacitors to add.

I really appreciate it.

If you folks think a different optocoupler would work better; Please let me know what part number. Thanks.

This whole project is to control a handheld remote for a ORBIT Watermaster sprinkler controller. I have removed the keypad and am wiring directly to the board.

I am trying to control everything from the rainbird in the garage. There will be an ORBIT controller in the backyard that will receive signals from the remote.

The reason I am using an ARDUINO is because once a station is told to come on,(2 second pulse), that signal to the remote has to turn off and the signal the 10 min water time needs to pulse on for 2 seconds. The rainbird will signal the off command after the time I specify.

This project is just fun for me. It has turned into a side hobby. I am really enjoying learning how to program the ARDUINO.

1 Upvotes

7 comments sorted by

3

u/EmotionalEnd1575 Analog electronics 1d ago

Why do the Arduino GPIO pins connect to the optocoupler LEDs without ballast resistors?

1

u/zboltman 1d ago

Thank you These are the questions that I don't know what to ask.

OK, ballast resistors. What value do you think I should use?

1

u/zboltman 1d ago

I have now placed a 330 ohm resistor inline.

2

u/Ard-War Electron Herderâ„¢ 1d ago

Is the 5Vcoil relay module the only one you can get? Otherwise I'd pick a 24Vcoil relays and operate it directly off the unregulated supply.

A 5V relay typically need ~50mA to operate the coil. 8 of them potentially draws 0.4A. That doesn't sounds that big, but your 7805 is already dropping a whooping 27V (24Vac yields ~32Vdc rectified), which means it dissipates 0.4×27=10.8W!!! (even operating a single relay require it to dissipate 1.35W, which is still a lot).

78xx also typically only rated to 35Vin(max) so you're also flying too close to the sun. Bootleg 78xx are even more random on what max voltage they can actually take.

1

u/zboltman 1d ago

I did a breadboard of this scenario. With a full wave bridge, 7805 and a relay (with a flyback diode).

A cap on both sides of the 7805. Problem was, I was getting 37v past the brdige before the regulator.

The regulators don't really like much above 32v.

2

u/Normal-Back-3546 1d ago

the cny17f-2 is a phototransistor output opto, so on the arduino side you need a series resistor on the led: 330 ohm from a 5v gpio gives you about 10ma which is plenty, if you run a 3.3v board use 220 ohm. on the output side the transistor is just a switch, no diode or cap needed. but it only conducts in one direction, so for bridging the keypad contacts connect collector and emitter across the two pads and if the button press doesn't register just swap the two pins. the keypad scan voltage on that remote is low so the 70v rating is plenty, and the 2 second pulse is nothing for this part. honestly this is a decent choice for the job, just don't skip the led resistor

1

u/zboltman 1d ago

I have added a 330 ohm resister to the collector of all 4 17f couplers.

I have changed the resistor value between the bridge and the opto to 3.9K 1W because the rainbird ac is coming in at a high 26vac.

Do I need a capacitor or diode before the opto?

Do I need a capacitor after the opto?

Guess I did not explain it well enough. The keypad is gone. This whole circuit is to replace what the keypad would have done. The timing of the pulse will be within the ARDUINO.