I2C pins, which is input / output

Status
Not open for further replies.

m2babaey

Junior Member level 2
Joined
Oct 18, 2012
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,445
Hi
I have a microcontroller and 2 devices that supports I2C (ADE7878 (energy metering IC) and EEPROM)
I want to connect SDA and SCL in these 2 devices to my Micro with optocouplers for more protection

I think SCL is output for Micro and input for EEPROM and ADE7878 so I may connect SCL of Micro to LED side of optocoupler, right?
And I think SDA is sometimes input and sometimes output, which device pins I should connect to LED side? Micro or ADE7878 and EEPROM?

Any suggestions?

Here is a simple schematic
 
Last edited:

You're correct.

SCL is driver by the master.
SDA is bidirectional.
Remember that I2C is an open collector bus - so pullups must be used.

What are you trying to achieve with the optocoupler ?
 

1.SDA is bi directional so u required other method of isolation which increase complex circuitry.
2.Avoid isolation if possible
3.If sense High voltage in that case use isolation at analog site instead of Digital.
 

Thanks
ADE7878 deals with 3 phase voltages and currents. Currents are isolated because of using CTs (Current transformer) But isolating 3 phase voltages is expensive, so I have used a simple resistor divider
I want to use isolation because one side is 3 phase voltages in the system and in other side I have a mini-PLC, which is expensive. I want if there was a fault in power system, it doesn't burn my mini-PLC
 

As said, I2C is bidirectional. If the slaves don't utilize clock stretching (hold the clock line low to cause the master to wait), SCL can be unidirectional, but SDA never can.

There are special I2C repeater devices prepared for optocoupler interface and complete I2C isolators like ADuM1250. If you operate the I2C interface in a bit-banging style, it's easy to control separate transmitter (open drain) and receiver pins over optocouplers.

It may be reasonable to use SPI interfaced energy meter chips if isolation is required.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…