24V I/O forhome autmation, pcb design

Hello,

I'm going to use an arduino as home automation controller.

I want it to fire 24v relays and read 24v push button.

To expand output number I have designed a pcb with mcp23017 chip and optocouplers.
The relays are those : http://www.mouser.be/ProductDetail/Phoenix-Contact/2903334/?qs=sGAEpiMZZMsh60Ywjh%252b4PsWOqwgjLgvYbxNFXsFxt4Q3BS9X9sNSFw==

To read push button, I'have designed a pcb with optocouplers.

Could you guys check them ? I'm not an electronics so it's possible that there are mistakes.

I'm open to any suggestions.

Thanks

PS : sorry for bad English I speak French

I don't see any problems, but I can't read resistor values or optocoupler part numbers. Can you tell us what they are? You will also need a flyback protection diode for each relay. (This does not have to be on your circuit board)

Your English is fine!

Output lines...

*** A) I'd keep the power and ground for the relays separate from the power and ground of the opto-isolators. While it is a common "gotcha" to forget to CONNECT grounds, where you are using an opto-isolator, you can have two... ummm... isolated circuits. Just ask yourself... for every device you want to Do Something... is there a path from SOME source of voltage, through the device and back to the ground ON THE SOURCE of voltage that you are using?

b) I'd put The Diodes for the relays () on your level shifting board.. ("The diodes": Relays- especially "the diode"- An introduction to using them with microprocessors- ec1relay.htm) (Those are the "flyback" diodes the other poster mentioned. And I haven't checked your resistor values.)

Input lines...

Looks okay. But remember: the circuits you are driving will allow high current flows... possibly too high... if you don't have some resistance in series with the voltages applied to the "inputs" of the optoisolators, unlike an Arduino input, which is, effectively, of a very high resistance.

===
And your English is fine. One bit of "fine tuning"... "I'm not an electronics engineer", or "I don't know much about electronics"... but what you meant was plus clear than anything I could dit en francais, even if I knew how to get the acccent... or whatever it is called.. under the c.

Hi thanks for your responses,

A) On output side :

Optocouplers are PC817

Resistors for optocouplers are 470

Resistors for I2C SDA SCL are 4.7K

Resistors for address definition are 10k

Connection will be like this : 24v+ ==== + side on relays === - side relays ==== optocoupler ==== ground opto === ground 24v

B) On input side :

Same, optocouplers are PC817

Resistor are 2.2k

Connection will be like this : +24v ==== push button === input ( which goes in a resistor ) === ground 24v
Arduino pins will be configured in pullup mode. So if I push a button, it enable the optocoupler and pullup pin will be connected to ground.

On the 2 board ground from 5v and 24 of optocouplers are disconnected. If you see somewhere I have connected them says me it's a fault.

The flyback diode should already there in the relays. I have put the drawings from datasheet. Should I put one more ?

Thanks you for your time

relays.png

The PC817 opto isolators have CEO = 35V which might be a little low for comfort on
a noisy 24V system.

The worst case is 50% current gain in the opto isolators, so they aren't really up to
switching 18mA with 20mA in. Also you need flyback diodes, so I'd suggest using
the opto-isolators driving some ULN2803's which can handle higher currents, and
include fly-back diodes (connect the COM pin to the 24V supply).

I don't see pull-up resistors on the input opto-isolator collector pins?

Also you seem to be routing 24V ground separately from all the relay wires? You need
ground return with each cable bunch to avoid generating lots of RFI. Same goes for the
input cabling too really.

Hi back,

If I use this opto isolators : http://www.mouser.com/ds/2/427/vo617a-244789.pdf

Would it be better ?

Is the flyback diode compulsory ? As linked relay says it has one ?

If I use uln2803 after opto isolators, will I not inverse logic ?

On the input part, pull-up will be done on arduino.

On output and input 24v ground are connected together and there is a terminal block to connect it to 24v ground. Is it false ? 5v ground are connected together to arduino ground.

I'll attach better quality schematic in pdf.

I'm trying to understand all I can. Electronics is not simple :sweat_smile:

Thank you very much for your help

OptoIN.pdf (32.5 KB)

MCP23017Opto.pdf (44.3 KB)

That optoisolator would be a little better, but I would suggest a photodarlington optoisolator.

I don't think the additional flyback diode is necessary.

Use of a photodarlington would make the ULN2803 unnecessary in my opinion.

Leaving your grounds separate is ok. In fact, connecting them can be detrimental, depending on your reasons for isolation.

Da molto tempo stavo cercando informazioni su questo argomento. Grazie a tutti!
defraggler alternative